2025-01-28 22:21:31 -06:00
|
|
|
{
|
|
|
|
flake,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
inherit (flake.config.people)
|
2025-01-08 19:06:14 -06:00
|
|
|
user0
|
2025-01-28 22:21:31 -06:00
|
|
|
user2
|
2025-01-08 19:06:14 -06:00
|
|
|
;
|
2025-01-28 22:21:31 -06:00
|
|
|
inherit (flake.config.people.users.${userLogic})
|
2025-01-08 19:06:14 -06:00
|
|
|
sshKeys
|
|
|
|
;
|
2025-01-28 22:21:31 -06:00
|
|
|
inherit (flake.config.machines)
|
|
|
|
devices
|
|
|
|
;
|
|
|
|
hostname = config.networking.hostName;
|
2025-01-30 13:37:27 -06:00
|
|
|
user0devices = devices.desktop.name || devices.server.name;
|
|
|
|
user2devices = devices.fallaryn.name;
|
2025-01-28 22:21:31 -06:00
|
|
|
|
|
|
|
userLogic =
|
2025-01-30 13:37:27 -06:00
|
|
|
if hostname == user0devices then
|
2025-01-28 22:21:31 -06:00
|
|
|
user0
|
2025-01-30 13:37:27 -06:00
|
|
|
else if hostname == user2devices then
|
2025-01-28 22:21:31 -06:00
|
|
|
user2
|
|
|
|
else
|
|
|
|
"";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
users.users.${userLogic} = {
|
2024-10-06 15:25:05 -05:00
|
|
|
openssh.authorizedKeys.keys = sshKeys;
|
|
|
|
};
|
|
|
|
}
|