From 92ca826539092f33c8e19a19c7a9ea0def2aece0 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 17 Apr 2023 12:00:55 -0400 Subject: move most configurations to modules --- modules/nixos/root.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/nixos/root.nix (limited to 'modules/nixos/root.nix') diff --git a/modules/nixos/root.nix b/modules/nixos/root.nix new file mode 100644 index 0000000..4e27694 --- /dev/null +++ b/modules/nixos/root.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + cfg = config.nixos.defaultRoot; + inherit (lib) mkEnableOption mkIf; +in { + options.nixos.defaultRoot.enable = mkEnableOption "enable default root user"; + + config = mkIf cfg.enable { + users.users.root = { + home = "/root"; + uid = config.ids.uids.root; + group = "root"; + passwordFile = config.age.secrets.rootPassword.path; + }; + }; +} -- cgit v1.2.3