summaryrefslogtreecommitdiff
path: root/modules/nixos/root.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-04-17 12:00:55 -0400
committerseth <[email protected]>2023-04-17 12:01:21 -0400
commit92ca826539092f33c8e19a19c7a9ea0def2aece0 (patch)
treec6ff98c3f645f189b559bc1a69904fec217a946c /modules/nixos/root.nix
parent98921a299be9f22bde9204e1fd05d0ea0fb0c6ed (diff)
move most configurations to modules
Diffstat (limited to 'modules/nixos/root.nix')
-rw-r--r--modules/nixos/root.nix19
1 files changed, 19 insertions, 0 deletions
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;
+ };
+ };
+}