mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-12-07 21:42:16 -06:00
chore: init
This commit is contained in:
commit
1b2c1ea359
891 changed files with 37053 additions and 0 deletions
41
modules/nixos/core/ssh/default.nix
Executable file
41
modules/nixos/core/ssh/default.nix
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
flake,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (flake.config.people) user0 user1;
|
||||
inherit (flake.config.machines) devices;
|
||||
hostname = config.networking.hostName;
|
||||
mars = devices.mars.name;
|
||||
deimos = devices.deimos.name;
|
||||
ceres = devices.ceres.name;
|
||||
|
||||
getUserKeys = user: flake.config.people.users.${user}.sshKeys;
|
||||
|
||||
user0Key = {
|
||||
${user0} = {
|
||||
openssh.authorizedKeys.keys = getUserKeys user0;
|
||||
};
|
||||
};
|
||||
user1Key = {
|
||||
${user1} = {
|
||||
openssh.authorizedKeys.keys = getUserKeys user1;
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
users.users =
|
||||
if hostname == mars then
|
||||
user0Key // user1Key
|
||||
else if
|
||||
builtins.elem hostname [
|
||||
deimos
|
||||
ceres
|
||||
]
|
||||
then
|
||||
user0Key
|
||||
else
|
||||
{ };
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue