nixos-config/users/simon/default.nix
Simon Bruder a68b429a58
Remove user from docker group
This prevents unauthorised programs to effectively be root.
2021-01-17 18:06:12 +01:00

53 lines
1.3 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 = {
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";
};
};
}