Extract the per-host rialo user definition into a Snowfall module (metacfg.user.rialo.enable) so it can be shared across hosts instead of copy-pasting the file. Enable it on both amd and x1.
34 lines
565 B
Nix
34 lines
565 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
with lib;
|
|
with lib.metacfg;
|
|
let
|
|
cfg = config.metacfg.user.rialo;
|
|
in
|
|
{
|
|
options.metacfg.user.rialo = with types; {
|
|
enable = mkBoolOpt false "Whether or not to enable the rialo user.";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
users.users.rialo = {
|
|
isNormalUser = true;
|
|
home = "/home/rialo";
|
|
group = "users";
|
|
shell = pkgs.bash;
|
|
uid = 1001;
|
|
extraGroups = [
|
|
"wheel"
|
|
"docker"
|
|
"dialout"
|
|
"tss"
|
|
];
|
|
};
|
|
|
|
nix.settings.trusted-users = [ "rialo" ];
|
|
};
|
|
}
|