From abb7513d572616d088872643b5b5b225659cbd16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 2 Dec 2024 19:48:26 +0200 Subject: [PATCH] rm zfs --- modules/base/default.nix | 2 -- modules/base/snapshot/default.nix | 41 --------------------------- modules/base/zfs/default.nix | 18 ------------ modules/services/jakstpub/default.nix | 6 ---- 4 files changed, 67 deletions(-) delete mode 100644 modules/base/snapshot/default.nix delete mode 100644 modules/base/zfs/default.nix diff --git a/modules/base/default.nix b/modules/base/default.nix index 707dc35..d37da62 100644 --- a/modules/base/default.nix +++ b/modules/base/default.nix @@ -10,11 +10,9 @@ let in { imports = [ - ./snapshot ./sshd ./unitstatus ./users - ./zfs ]; options.mj = with lib.types; { diff --git a/modules/base/snapshot/default.nix b/modules/base/snapshot/default.nix deleted file mode 100644 index 6f47cd7..0000000 --- a/modules/base/snapshot/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, lib, ... }: -{ - options.mj.base.snapshot = { - enable = lib.mkEnableOption "Enable zfs snapshots"; - - mountpoints = lib.mkOption { - default = { }; - type = with lib.types; listOf str; - }; - }; - - config = lib.mkIf config.mj.base.snapshot.enable { - services.sanoid = { - enable = true; - templates.prod = { - hourly = 24; - daily = 7; - autosnap = true; - autoprune = true; - }; - extraArgs = [ "--verbose" ]; - datasets = - let - fs_zfs = lib.filterAttrs (_: v: v.fsType == "zfs") config.fileSystems; - mountpoint2fs = builtins.listToAttrs ( - map (mountpoint: { - name = mountpoint; - value = builtins.getAttr mountpoint fs_zfs; - }) config.mj.base.snapshot.mountpoints - ); - s_datasets = lib.mapAttrs' (_mountpoint: fs: { - name = fs.device; - value = { - use_template = [ "prod" ]; - }; - }) mountpoint2fs; - in - s_datasets; - }; - }; -} diff --git a/modules/base/zfs/default.nix b/modules/base/zfs/default.nix deleted file mode 100644 index 6667f72..0000000 --- a/modules/base/zfs/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, ... }: -{ - options.mj.base.zfs = with lib.types; { - enable = lib.mkEnableOption "Enable common zfs options"; - }; - - config = lib.mkIf config.mj.base.zfs.enable { - # TODO - #services.zfs = assert lib.assertMsg (config.mj.base.unitstatus.enable "mj.base.unitstatus must be enabled"; { - services.zfs = { - autoScrub.enable = true; - trim.enable = true; - expandOnBoot = "all"; - }; - - mj.base.unitstatus.units = [ "zfs-scrub" ]; - }; -} diff --git a/modules/services/jakstpub/default.nix b/modules/services/jakstpub/default.nix index 1a32939..b9e4287 100644 --- a/modules/services/jakstpub/default.nix +++ b/modules/services/jakstpub/default.nix @@ -61,18 +61,12 @@ in }; public = defaults // { - #"path" = cfg.dataDir; "path" = "/var/run/samba/dataDir"; "writeable" = "yes"; "read only" = "no"; "create mask" = "0664"; "directory mask" = "0775"; }; - #snapshots = defaults // { - # "path" = cfg.dataDir + "/.zfs/snapshot"; - # "writeable" = "no"; - # "read only" = "yes"; - #}; }; };