refactor: share rialo user as a reusable nixos module
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.
This commit is contained in:
parent
9b811825a6
commit
e3d00e650c
4 changed files with 36 additions and 19 deletions
34
modules/nixos/user/rialo/default.nix
Normal file
34
modules/nixos/user/rialo/default.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
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" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue