46 lines
1.0 KiB
Nix
46 lines
1.0 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
machine,
|
|
...
|
|
}: let
|
|
machines = import ./machines.nix;
|
|
in {
|
|
users.users =
|
|
builtins.mapAttrs
|
|
(name: value: lib.mkIf (builtins.elem name machine.users) value)
|
|
{
|
|
"andromeda" = {
|
|
isNormalUser = true;
|
|
description = "andromeda";
|
|
hashedPasswordFile = builtins.toString config.age.secrets.andromeda-pw.path;
|
|
extraGroups = [
|
|
"networkmanager"
|
|
"wheel"
|
|
];
|
|
};
|
|
};
|
|
environment.persistence."/persist".users = lib.mkIf config.environment.persistence."/persist".enable (
|
|
builtins.mapAttrs
|
|
(name: value: lib.mkIf (builtins.elem name machine.users) value)
|
|
{
|
|
"andromeda" = {
|
|
directories = [
|
|
".backups"
|
|
".local/share/Anki2"
|
|
".local/share/chat.fluffy.fluffychat"
|
|
".local/share/zoxide"
|
|
".ssh"
|
|
"conf"
|
|
"Downloads"
|
|
"pp"
|
|
];
|
|
files = [
|
|
".bash_history"
|
|
".brush_history"
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|