72 lines
1.7 KiB
Nix
72 lines
1.7 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.secret0.path;
|
|
extraGroups = [
|
|
"networkmanager"
|
|
"wheel"
|
|
];
|
|
};
|
|
"mtgmonkey" = {
|
|
isNormalUser = true;
|
|
description = "mtgmonkey";
|
|
hashedPasswordFile = builtins.toString config.age.secrets.secret1.path;
|
|
extraGroups = [
|
|
(lib.mkIf
|
|
(machine == machines.lenovo)
|
|
"networkmanager")
|
|
"wheel"
|
|
];
|
|
openssh.authorizedKeys.keys = [
|
|
(lib.mkIf
|
|
(machine == machines._173-249-5-230)
|
|
config.pub-keys.ssh.andromeda)
|
|
];
|
|
};
|
|
};
|
|
environment.persistence."/nix/persist".users = lib.mkIf config.environment.persistence."/nix/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"
|
|
];
|
|
};
|
|
"mtgmonkey" = {
|
|
directories = [
|
|
".local/share/zoxide"
|
|
".ssh"
|
|
];
|
|
files = [
|
|
".bash_history"
|
|
".brush_history"
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|