users: custom property to define users with root
This commit is contained in:
parent
55000c365a
commit
d8e85815bd
7 changed files with 29 additions and 7 deletions
|
@ -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" ];
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue