nixos-config/users/simon/default.nix

54 lines
1.3 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{ config, options, pkgs, ... }:
let
# hacky way of inheriting a nixos option into home manager
inheritOption = name:
let
path = pkgs.lib.splitString "." name;
option = pkgs.lib.getAttrFromPath path options;
value = pkgs.lib.getAttrFromPath path config;
in
# setting `value` doesnt work (always is default value in other modules)
option // { default = value; };
in
{
imports = [
(import "${(import ../../nix/sources.nix).home-manager}/nixos")
];
users.users.simon = {
isNormalUser = true;
extraGroups = [
"adbusers"
"dialout"
"libvirtd"
"lp"
"networkmanager"
"video"
"wheel"
];
openssh.authorizedKeys.keys = config.sbruder.pubkeys.trustedKeys;
initialPassword = "foobar"; # for vm
};
home-manager.useUserPackages = true;
home-manager.useGlobalPkgs = true;
home-manager.users.simon = { lib, pkgs, ... }: {
options.sbruder = {
full = inheritOption "sbruder.full";
gui.enable = inheritOption "sbruder.gui.enable";
games.enable = inheritOption "sbruder.games.enable";
unfree = {
allowAssets = inheritOption "sbruder.unfree.allowAssets";
allowSoftware = inheritOption "sbruder.unfree.allowSoftware";
};
};
imports = [ ./modules ];
config = {
home.stateVersion = "20.09";
};
};
}