nixos-config/users/simon/default.nix
Simon Bruder a02d3cb883
Use separate state version for every machine
This also uses the system state version as the home-manager state
version.

Fixes #35.
2021-01-31 12:21:05 +01:00

54 lines
1.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ 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 = config.system.stateVersion;
};
};
}