diff --git a/hosts/c1/configuration.nix b/hosts/c1/configuration.nix index fad24ee..0d2cf29 100644 --- a/hosts/c1/configuration.nix +++ b/hosts/c1/configuration.nix @@ -10,6 +10,7 @@ enable = true; serial = 1; ethLanName = "ens16f0"; + ethRDMAName = "ens2f1np1"; }; }; system.stateVersion = "25.05"; diff --git a/hosts/c2/configuration.nix b/hosts/c2/configuration.nix index 10d081e..9c43f02 100644 --- a/hosts/c2/configuration.nix +++ b/hosts/c2/configuration.nix @@ -10,6 +10,7 @@ enable = true; serial = 2; ethLanName = "ens16f0"; + ethRDMAName = "ens2f1np1"; }; }; system.stateVersion = "25.05"; diff --git a/modules/nasp/main.nix b/modules/nasp/main.nix index 2b00fe2..25b2bf3 100644 --- a/modules/nasp/main.nix +++ b/modules/nasp/main.nix @@ -276,6 +276,28 @@ in }; }; }; + systemd.timers."home2-sockets-clean" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "0:0:0"; + Unit = "home2-sockets-clean.service"; + }; + }; + systemd.services."home2-sockets-clean" = { + serviceConfig = { + Type = "simple"; + User = "root"; + }; + script = '' + cd /home2/run + for i in ./*.sock; do + if ! socat -u OPEN:/dev/null UNIX-CONNECT:$i 1>/dev/null 2>&1; then + rm $i + fi + done + ''; + path = [ pkgs.socat ]; + }; }) # registry (lib.mkIf (registryCfg.enable) { @@ -463,6 +485,7 @@ in (lib.mkIf (cCfg.enable) { networking.hostName = "c" + (builtins.toString cCfg.serial); networking.nameservers = [ "192.168.20.1" ]; + zramSwap.enable = true; nasp.docker.enable = lib.mkDefault true; nasp.registry.enable = lib.mkDefault true; nasp.nginx.enable = lib.mkDefault true; @@ -486,15 +509,16 @@ in (lib.mkIf (cCfg.enable && cCfg.ethRDMAName != "") { systemd.network.networks."10-eth-rdma" = { matchConfig.Name = cCfg.ethRDMAName; - address = [ "12.12.12.${builtins.toString (cCfg.serial + 100)}/24" ]; + address = [ "10.10.10.${builtins.toString (cCfg.serial + 100)}/24" ]; linkConfig.RequiredForOnline = "no"; }; networking.rxe = { enable = true; interfaces = [ "${cCfg.ethRDMAName}" ]; }; + environment.systemPackages = [ pkgs.rdma-core ]; networking.firewall.extraInputRules = '' - ip saddr 12.12.12.0/24 accept + ip saddr 10.10.10.0/24 accept ''; }) ]);