diff --git a/modules/options/meta/module.nix b/modules/options/meta/module.nix deleted file mode 100644 index 4440d8c..0000000 --- a/modules/options/meta/module.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (builtins) elemAt; - inherit (lib) options types; - inherit (options) mkOption; - inherit (types) listOf str; -in { - options.meta = { - users = mkOption { - type = listOf str; - default = ["cr"]; - description = '' - A list of users on a system. - ''; - }; - mainUser = { - username = mkOption { - type = str; - default = elemAt config.meta.users 0; - description = '' - The main user for each system. This is the first element of the list of users by default. - ''; - }; - gitSigningKey = mkOption { - type = str; - description = '' - The main user's git signing key, used to automatically sing git commits with this key - ''; - }; - }; - }; -} diff --git a/modules/other/users.nix b/modules/other/users.nix index 75d41a9..1fa4711 100644 --- a/modules/other/users.nix +++ b/modules/other/users.nix @@ -1,29 +1,62 @@ { config, + lib, pkgs, self, ... }: let + inherit (builtins) elemAt; + inherit (lib.options) mkOption; + inherit (lib.types) listOf str; + inherit (config.meta.mainUser) username; in { - users = { - mutableUsers = true; - users = { - ${username} = { - isNormalUser = true; - extraGroups = [ - "wheel" - "networking" - "video" - "networkmanager" - "audio" - "nix" - "docker" - ]; - shell = self.packages.${pkgs.stdenv.system}.fish; - # hashedPasswordFile = "/etc/passwords/cr"; + options.meta = { + users = mkOption { + type = listOf str; + default = ["cr"]; + description = '' + A list of users on a system. + ''; + }; + mainUser = { + username = mkOption { + type = str; + default = elemAt config.meta.users 0; + description = '' + The main user for each system. This is the first element of the list of users by default. + ''; + }; + gitSigningKey = mkOption { + type = str; + description = '' + The main user's git signing key, used to automatically sing git commits with this key + ''; + default = '' + ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAAWEDj/Yib6Mqs016jx7rtecWpytwfVl28eoHtPYCM9TVLq81VIHJSN37lbkc/JjiXCdIJy2Ta3A3CVV5k3Z37NbgAu23oKA2OcHQNaRTLtqWlcBf9fk9suOkP1A3NzAqzivFpBnZm3ytaXwU8LBJqxOtNqZcFVruO6fZxJtg2uE34mAw== ''; + }; + }; + }; + config = { + users = { + mutableUsers = true; + users = { + ${username} = { + isNormalUser = true; + extraGroups = [ + "wheel" + "networking" + "video" + "networkmanager" + "audio" + "nix" + "docker" + ]; + shell = self.packages.${pkgs.stdenv.system}.fish; + # hashedPasswordFile = "/etc/passwords/cr"; + }; + # root.hashedPasswordFile = "/persist/passwords/root"; }; - # root.hashedPasswordFile = "/persist/passwords/root"; }; }; }