summaryrefslogtreecommitdiff
path: root/modules/nixos/root.nix
blob: 4e27694e85dce94c9391cec11ffc9edb3c1b48bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
    };
  };
}