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" ];
|
||||
};
|
||||
}
|
||||
|
|
@ -13,7 +13,6 @@ with lib.metacfg;
|
|||
./acme.nix
|
||||
./nginx.nix
|
||||
./opencode.nix
|
||||
./rialo.nix
|
||||
];
|
||||
|
||||
services.rustdesk-server.signal.enable = false;
|
||||
|
|
@ -44,6 +43,7 @@ with lib.metacfg;
|
|||
secureboot.enable = true;
|
||||
homeprinter.enable = true;
|
||||
build.enable = true;
|
||||
user.rialo.enable = true;
|
||||
|
||||
system = {
|
||||
limits = {
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
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" ];
|
||||
}
|
||||
|
|
@ -53,6 +53,7 @@ with lib.metacfg;
|
|||
podman.enable = true;
|
||||
secureboot.enable = true;
|
||||
homeprinter.enable = true;
|
||||
user.rialo.enable = true;
|
||||
|
||||
system = {
|
||||
limits = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue