From 52fd493096ce056fc7c6e7ef1f2bb43d71d8f68e Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Tue, 11 Jul 2023 11:40:55 +0100 Subject: [PATCH] blade-paris: not on ZFS --- ops/nixos/blade-paris/default.nix | 1 + ops/nixos/lib/blade.nix | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ops/nixos/blade-paris/default.nix b/ops/nixos/blade-paris/default.nix index fbfce4e5cd..66c8ede10b 100644 --- a/ops/nixos/blade-paris/default.nix +++ b/ops/nixos/blade-paris/default.nix @@ -20,6 +20,7 @@ in { }; my.ip.tailscale = "100.117.185.118"; my.ip.tailscale6 = "fd7a:115c:a1e0:ab12:4843:cd96:6275:b976"; + my.blade.onZFS = false; my.blade.bay = 2; my.blade.macAddress = { internal = "e4:11:5b:ac:e4:8a"; diff --git a/ops/nixos/lib/blade.nix b/ops/nixos/lib/blade.nix index 581a02a158..da7e49d68e 100644 --- a/ops/nixos/lib/blade.nix +++ b/ops/nixos/lib/blade.nix @@ -30,6 +30,8 @@ in { type = lib.types.nullOr lib.types.str; default = null; }; + + onZFS = lib.mkOption { type = lib.types.bool; default = true; }; }; config = { @@ -62,18 +64,24 @@ in { options = [ "defaults" "size=${size}" "mode=755" ]; }; in { - "/" = zfs "tank/local/root"; - "/tmp" = zfs "tank/local/tmp"; - "/nix" = zfs "tank/local/nix"; - "/var" = zfs "tank/safe/var"; - "/home" = zfs "tank/safe/home"; "/boot" = { device = "/dev/disk/by-label/boot"; fsType = "ext4"; }; "/var/log" = tmpfs "2G"; "/var/cache" = tmpfs "16G"; - } // (lib.optionalAttrs (config.services.ceph.osd.enable || config.services.ceph.mgr.enable || config.services.ceph.mon.enable || config.services.ceph.mgr.enable) { + } // (lib.optionalAttrs (config.my.blade.onZFS) { + "/" = zfs "tank/local/root"; + "/tmp" = zfs "tank/local/tmp"; + "/nix" = zfs "tank/local/nix"; + "/var" = zfs "tank/safe/var"; + "/home" = zfs "tank/safe/home"; + }) // (lib.optionalAttrs (!config.my.blade.onZFS) { + "/" = { + device = "/dev/disk/by-label/root"; + fsType = "ext4"; + }; + }) // (lib.optionalAttrs (config.services.ceph.osd.enable || config.services.ceph.mgr.enable || config.services.ceph.mon.enable || config.services.ceph.mgr.enable) { "/var/lib/ceph" = { device = "/dev/disk/by-label/var-lib-ceph"; fsType = "xfs";