🚚 [shared] Added shared config that shared desktop config inherits from
This commit is contained in:
25
shared/desktop/modules/security/ssh.nix
Normal file
25
shared/desktop/modules/security/ssh.nix
Normal file
@ -0,0 +1,25 @@
|
||||
# /nix/store/<hash>/etc/ssh/ssh_config & /nix/store/<hash>/etc/ssh/authorized_keys
|
||||
{
|
||||
systemConfig,
|
||||
systems,
|
||||
common,
|
||||
...
|
||||
}:
|
||||
with builtins;
|
||||
let
|
||||
domain = "dns.${common.domain}";
|
||||
in
|
||||
{
|
||||
programs.ssh.knownHosts = listToAttrs (
|
||||
map (system: {
|
||||
name = system.hostName;
|
||||
value = {
|
||||
extraHostNames = [ "${system.hostName}.${domain}" ];
|
||||
publicKey = system.ssh.publicKey;
|
||||
};
|
||||
}) systems
|
||||
);
|
||||
users.users.${systemConfig.username}.openssh.authorizedKeys.keys = (
|
||||
map (system: system.ssh.publicKey) systems
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user