From ae705f203ba557967ccc616c6ea704dbb214ee45 Mon Sep 17 00:00:00 2001 From: chn Date: Wed, 9 Jul 2025 10:02:28 +0800 Subject: [PATCH] devices.srv2: separate swap config --- devices/srv2/default.nix | 16 ++++++---------- devices/srv2/node0/default.nix | 1 + devices/srv2/node1/default.nix | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/devices/srv2/default.nix b/devices/srv2/default.nix index d577153f..940f895b 100644 --- a/devices/srv2/default.nix +++ b/devices/srv2/default.nix @@ -7,17 +7,13 @@ inputs: model.type = "server"; system = { - fileSystems = + fileSystems.mount = let inherit (inputs.config.nixos.model.cluster) clusterName nodeName; in { - mount = let inherit (inputs.config.nixos.model.cluster) clusterName nodeName; in - { - vfat."/dev/disk/by-partlabel/${clusterName}-${nodeName}-boot" = "/boot"; - btrfs."/dev/disk/by-partlabel/${clusterName}-${nodeName}-root1" = - { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; }; - nfs."${inputs.topInputs.self.config.dns."chn.moe".getAddress "wg1.pc"}:/" = - { mountPoint = "/nix/remote/pc"; hard = false; }; - }; - swap = [ "/nix/swap/swap" ]; + vfat."/dev/disk/by-partlabel/${clusterName}-${nodeName}-boot" = "/boot"; + btrfs."/dev/disk/by-partlabel/${clusterName}-${nodeName}-root1" = + { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; }; + nfs."${inputs.topInputs.self.config.dns."chn.moe".getAddress "wg1.pc"}:/" = + { mountPoint = "/nix/remote/pc"; hard = false; }; }; nixpkgs.cuda.capabilities = [ diff --git a/devices/srv2/node0/default.nix b/devices/srv2/node0/default.nix index 198fee14..3b19f81a 100644 --- a/devices/srv2/node0/default.nix +++ b/devices/srv2/node0/default.nix @@ -16,6 +16,7 @@ inputs: trust = [ "eno2" ]; }; nix.remote.slave = {}; + fileSystems.swap = [ "/dev/disk/by-partlabel/srv2-node0-swap" ]; }; services = { diff --git a/devices/srv2/node1/default.nix b/devices/srv2/node1/default.nix index bc79d4ef..7a7142d7 100644 --- a/devices/srv2/node1/default.nix +++ b/devices/srv2/node1/default.nix @@ -13,6 +13,7 @@ inputs: { ip = "192.168.178.2"; mask = 24; gateway = "192.168.178.1"; dns = "192.168.178.1"; }; trust = [ "enp58s0" ]; }; + fileSystems.swap = [ "/nix/swap/swap" ]; }; services.beesd."/".hashTableSizeMB = 64; };