mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-15 17:45:12 -05:00
33 lines
579 B
Nix
Executable file
33 lines
579 B
Nix
Executable file
{
|
|
flake,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
inherit (flake.config.people)
|
|
user0
|
|
user2
|
|
;
|
|
inherit (flake.config.people.users.${userLogic})
|
|
sshKeys
|
|
;
|
|
inherit (flake.config.machines)
|
|
devices
|
|
;
|
|
hostname = config.networking.hostName;
|
|
user0devices = devices.desktop.name || devices.server.name;
|
|
user2devices = devices.fallaryn.name;
|
|
|
|
userLogic =
|
|
if hostname == user0devices then
|
|
user0
|
|
else if hostname == user2devices then
|
|
user2
|
|
else
|
|
"";
|
|
in
|
|
{
|
|
users.users.${userLogic} = {
|
|
openssh.authorizedKeys.keys = sshKeys;
|
|
};
|
|
}
|