dotfiles/modules/nixos/common/core/users.nix
2025-12-12 10:39:49 +01:00

51 lines
1.2 KiB
Nix

{
inputs,
config,
pkgs,
lib,
...
}: let
cfg = config.elements;
in
with lib;
with builtins; {
options = {
elements = {
users = mkOption {
type = types.listOf types.str;
default = [];
};
};
};
config = let
mkIfUser = name: mkIf (elem name cfg.users);
#secretFor = name: file: mkIfUser name {rekeyFile = ./../../../.. + "/secrets/${file}";};
in {
# age.secrets.christopher-password = secretFor "christopher" "christopher-password.age";
programs.fish.enable = true;
users = {
users.christopher = mkIfUser "christopher" {
isNormalUser = true;
# passwordFile = config.age.secrets.christopher-password.path;
shell = pkgs.fish;
extraGroups = [
"wheel"
"docker"
"dialout"
"uinput"
"pico"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBEqcR3f71g7yuxQtUewrqdoEh8jDHtkB1973GF0EQ6q christopher@all"
];
};
groups.christopher = {
members = ["christopher"];
gid = 1000;
};
};
};
}