refactor: moved modules to legacy-modules
This commit is contained in:
parent
d646b954ac
commit
db7ac35613
233 changed files with 5 additions and 5 deletions
44
legacy-modules/nixos-modules/ssh.nix
Normal file
44
legacy-modules/nixos-modules/ssh.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
services.openssh.impermanence.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.services.openssh.enable && config.storage.impermanence.enable;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
ports = [22];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
UseDns = true;
|
||||
X11Forwarding = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
storage.datasets.replicate."system/root" = {
|
||||
files = lib.mkIf config.services.openssh.impermanence.enable (builtins.listToAttrs (
|
||||
lib.lists.flatten (
|
||||
builtins.map (hostKey: [
|
||||
{
|
||||
name = hostKey.path;
|
||||
value = {enable = true;};
|
||||
}
|
||||
{
|
||||
name = "${hostKey.path}.pub";
|
||||
value = {enable = true;};
|
||||
}
|
||||
])
|
||||
config.services.openssh.hostKeys
|
||||
)
|
||||
));
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue