diff options
Diffstat (limited to '')
-rw-r--r-- | modules/system/default.nix | 2 | ||||
-rw-r--r-- | modules/system/users/default.nix (renamed from hosts/common/system/users.nix) | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/modules/system/default.nix b/modules/system/default.nix index 1f832bf..3f7d3ec 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -1 +1 @@ -{ ... }: { imports = [ ./console ./locale ./nix ]; } +{ ... }: { imports = [ ./console ./locale ./nix ./users ]; } diff --git a/hosts/common/system/users.nix b/modules/system/users/default.nix index 7d847f3..b39067c 100644 --- a/hosts/common/system/users.nix +++ b/modules/system/users/default.nix @@ -1,6 +1,8 @@ { config, lib, pkgs, ... }: - -{ +let + groupExists = grp: builtins.hasAttr grp config.users.groups; + groupsIfExist = builtins.filter groupExists; +in { # Users are managed through this configuration. If a user is added # manually, it will be removed on system activation. users.mutableUsers = false; @@ -12,7 +14,11 @@ group = "fcuny"; home = "/home/fcuny"; shell = pkgs.fish; - extraGroups = [ "users" "wheel" "docker" ]; + extraGroups = groupsIfExist [ + "docker" + "users" + "wheel" # `sudo` for the user. + ]; hashedPassword = "$6$i.z1brxtb44JAEco$fDD2Izl.zRR9vBCB2VBKPScChGw38EEl7QEiBTJ/EwgP3oSL0X3ZHq0PJ.RtqzBsWTPUjl4F3MKOBMhnaAPr6."; openssh.authorizedKeys.keys = [ |