diff --git a/hosts/hermit/configuration.nix b/hosts/hermit/configuration.nix index 87a268d..47a3fc6 100644 --- a/hosts/hermit/configuration.nix +++ b/hosts/hermit/configuration.nix @@ -1,5 +1,4 @@ { - config, lib, pkgs, ... @@ -79,10 +78,7 @@ }; }; other = { - system = { - hostname = "hermit"; - username = "cr"; - }; + system.username = "cr"; home-manager = { enable = true; diff --git a/modules/other/module.nix b/modules/other/module.nix index e870ec2..dc85a56 100644 --- a/modules/other/module.nix +++ b/modules/other/module.nix @@ -1 +1,9 @@ -_: {imports = [./home-manager.nix ./system.nix ./xdg.nix ./git.nix];} +_: { + imports = [ + ./home-manager.nix + ./system.nix + ./xdg.nix + ./git.nix + /users.nix + ]; +} diff --git a/modules/other/system.nix b/modules/other/system.nix index 60fb9b2..aa876e9 100644 --- a/modules/other/system.nix +++ b/modules/other/system.nix @@ -1,32 +1,10 @@ -{ - config, - lib, - ... -}: -with lib; let - cfg = config.modules.other.system; +{lib, ...}: let + inherit (lib) mkOption types; in { options.modules.other.system = { - hostname = mkOption { - description = "hostname for this system"; - type = types.str; - }; - username = mkOption { description = "username for this system"; type = types.str; }; - - gitPath = mkOption { - description = "path to the flake directory"; - type = types.str; - }; - }; - - config = { - users.users.${cfg.username} = { - isNormalUser = true; - extraGroups = ["wheel" "networking"]; - }; }; } diff --git a/modules/other/users.nix b/modules/other/users.nix new file mode 100644 index 0000000..be1e22f --- /dev/null +++ b/modules/other/users.nix @@ -0,0 +1,22 @@ +{config, ...}: let + inherit (config.meta.mainUser) username; +in { + users = { + mutableUsers = false; + users = { + ${username} = { + isNormalUser = true; + extraGroups = [ + "wheel" + "networking" + "video" + "networkmanager" + "audio" + "nix" + ]; + hashedPasswordFile = "/etc/passwords/cr"; + }; + root.hashedPasswordFile = "/persist/passwords/root"; + }; + }; +}