feat: moved services over to using the new storage datasets
This commit is contained in:
parent
757a3892e1
commit
c2701ea8f0
23 changed files with 281 additions and 606 deletions
|
|
@ -10,46 +10,35 @@
|
|||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
ports = [22];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
UseDns = true;
|
||||
X11Forwarding = false;
|
||||
};
|
||||
config = {
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
ports = [22];
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
UseDns = true;
|
||||
X11Forwarding = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
(lib.mkIf config.storage.zfs.enable (lib.mkMerge [
|
||||
{
|
||||
# SSH host keys need to be persisted to maintain server identity
|
||||
}
|
||||
(lib.mkIf (!config.services.openssh.impermanence.enable) {
|
||||
# TODO: placeholder to configure a unique dataset for this service
|
||||
})
|
||||
(lib.mkIf config.services.openssh.impermanence.enable {
|
||||
storage.impermanence.datasets."persist/replicate/system/root" = {
|
||||
files = 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
|
||||
)
|
||||
);
|
||||
};
|
||||
})
|
||||
]))
|
||||
];
|
||||
};
|
||||
|
||||
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