2024-01-23 16:15:40 -05:00
|
|
|
{pkgs, ...}: {
|
2024-01-22 22:47:31 -05:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
../corosync.nix
|
|
|
|
|
2024-01-23 23:42:41 -05:00
|
|
|
../blocky.nix
|
2024-01-22 22:47:31 -05:00
|
|
|
../caddy.nix
|
2024-01-23 23:42:41 -05:00
|
|
|
../headscale
|
|
|
|
../unbound.nix
|
2024-01-22 22:47:31 -05:00
|
|
|
];
|
2024-01-22 21:22:48 -05:00
|
|
|
|
2024-01-22 21:46:59 -05:00
|
|
|
# TODO: update script
|
2024-01-23 23:42:41 -05:00
|
|
|
services.pacemaker = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
resources = {
|
|
|
|
"blocky" = {
|
|
|
|
enable = true;
|
|
|
|
dependsOn = ["unbound"];
|
|
|
|
};
|
|
|
|
|
|
|
|
"caddy" = {
|
|
|
|
enable = true;
|
|
|
|
virtualIps = [
|
|
|
|
{
|
|
|
|
id = "main";
|
|
|
|
interface = "eno1";
|
|
|
|
ip = "10.0.0.130";
|
|
|
|
}
|
|
|
|
];
|
2024-01-22 22:47:31 -05:00
|
|
|
};
|
2024-01-23 16:15:40 -05:00
|
|
|
|
2024-01-23 23:42:41 -05:00
|
|
|
"headscale" = {
|
|
|
|
enable = true;
|
|
|
|
dependsOn = ["caddy"];
|
|
|
|
};
|
|
|
|
|
|
|
|
"unbound" = {
|
|
|
|
enable = true;
|
|
|
|
dependsOn = ["caddy"];
|
|
|
|
};
|
|
|
|
};
|
2024-01-22 21:22:48 -05:00
|
|
|
};
|
2024-01-23 23:42:41 -05:00
|
|
|
|
|
|
|
# NFS client setup
|
|
|
|
services.rpcbind.enable = true;
|
2024-01-23 17:58:48 -05:00
|
|
|
boot.supportedFilesystems = ["nfs"];
|
2024-01-23 16:15:40 -05:00
|
|
|
environment.systemPackages = with pkgs; [nfs-utils];
|
|
|
|
|
2024-01-23 23:42:41 -05:00
|
|
|
systemd.mounts = let
|
|
|
|
host = "10.0.0.249";
|
|
|
|
in [
|
2024-01-23 16:15:40 -05:00
|
|
|
{
|
|
|
|
type = "nfs";
|
|
|
|
mountConfig = {
|
|
|
|
Options = "noatime";
|
|
|
|
};
|
2024-01-23 23:42:41 -05:00
|
|
|
what = "${host}:/caddy";
|
2024-01-23 16:15:40 -05:00
|
|
|
where = "/var/lib/caddy";
|
|
|
|
requiredBy = ["caddy.service"];
|
|
|
|
}
|
2024-01-23 23:42:41 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
type = "nfs";
|
|
|
|
mountConfig = {
|
|
|
|
Options = "noatime";
|
|
|
|
};
|
|
|
|
what = "${host}:/headscale";
|
|
|
|
where = "/var/lib/headscale";
|
|
|
|
requiredBy = ["headscale.service"];
|
|
|
|
}
|
2024-01-23 16:15:40 -05:00
|
|
|
];
|
2024-01-22 21:22:48 -05:00
|
|
|
}
|