dotfiles/nixos/modules/ssh.nix

34 lines
538 B
Nix
Raw Normal View History

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