users: custom property to define users with root

This commit is contained in:
Katherina Walshe-Grey 2025-03-17 02:57:15 +00:00
parent 55000c365a
commit d8e85815bd
7 changed files with 29 additions and 7 deletions

View file

@ -1,3 +1,9 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkOption types genAttrs;
cfg = config.fountain;
in
{
# TODO: consider DRY-ing these
imports = [
@ -7,5 +13,21 @@
./trungle.nix
];
users.mutableUsers = false;
options.fountain = {
admins = mkOption {
type = types.listOf types.str;
default = [ ];
description = "List of users who should have root on this system";
};
};
config = {
users.mutableUsers = false;
users.users = genAttrs cfg.admins
(name: {
extraGroups = [ "wheel" ];
}
);
};
}