From 42e561df6c4be0a94362cfbb9497b3f97b2db6ed Mon Sep 17 00:00:00 2001 From: dichgrem Date: Mon, 25 Aug 2025 10:25:06 +0800 Subject: [PATCH] remove:zfs --- hosts/dos/env.nix | 7 ------ hosts/example/env.nix | 7 ------ modules/system/bootstrap.nix | 2 -- modules/system/zfs.nix | 42 ------------------------------------ 4 files changed, 58 deletions(-) delete mode 100644 modules/system/zfs.nix diff --git a/hosts/dos/env.nix b/hosts/dos/env.nix index 3a94542..cad0281 100644 --- a/hosts/dos/env.nix +++ b/hosts/dos/env.nix @@ -16,13 +16,6 @@ HotSpot-Use-Case = false; ### See https://nixos.wiki/wiki/Internet_Connection_Sharing - ZFS-Networking-HostID = ""; - ### See https://search.nixos.org/options?channel=unstable&show=networking.hostId&from=0&size=30&sort=relevance&query=networking.hostId - ### Could be generated by `head -c4 /dev/urandom | od -A none -t x4` - - ZFS-Use-Case = false; - ### See https://openzfs.github.io/openzfs-docs/Getting%20Started/NixOS/index.html - ## Software related QEMU-VM-Use-Case = true; ### See https://github.com/qemu/qemu ; https://github.com/virt-manager/virt-manager diff --git a/hosts/example/env.nix b/hosts/example/env.nix index d73485b..be30f97 100644 --- a/hosts/example/env.nix +++ b/hosts/example/env.nix @@ -16,13 +16,6 @@ HotSpot-Use-Case = false; ### See https://nixos.wiki/wiki/Internet_Connection_Sharing - ZFS-Networking-HostID = ""; - ### See https://search.nixos.org/options?channel=unstable&show=networking.hostId&from=0&size=30&sort=relevance&query=networking.hostId - ### Could be generated by `head -c4 /dev/urandom | od -A none -t x4` - - ZFS-Use-Case = false; - ### See https://openzfs.github.io/openzfs-docs/Getting%20Started/NixOS/index.html - ## Software related QEMU-VM-Use-Case = false; ### See https://github.com/qemu/qemu ; https://github.com/virt-manager/virt-manager diff --git a/modules/system/bootstrap.nix b/modules/system/bootstrap.nix index 9f4573d..5c1ac86 100644 --- a/modules/system/bootstrap.nix +++ b/modules/system/bootstrap.nix @@ -13,7 +13,6 @@ Locale StateVersion TimeZone - ZFS-Use-Case ; in with lib; { @@ -55,7 +54,6 @@ in } ]; theme = mkForce "${pkgs.minimal-grub-theme}"; - zfsSupport = ZFS-Use-Case; }; systemd-boot = mkIf (BootLoader == "systemd-boot") { configurationLimit = 50; diff --git a/modules/system/zfs.nix b/modules/system/zfs.nix deleted file mode 100644 index 21c8f57..0000000 --- a/modules/system/zfs.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - hostname, - lib, - pkgs, - ... -}: let - inherit - (import ../../hosts/${hostname}/env.nix) - KernelPackages - ZFS-Networking-HostID - ZFS-Use-Case - ; -in - with lib; { - config = mkIf ZFS-Use-Case { - boot = { - kernelParams = ["zfs_force=1"]; - supportedFilesystems = ["zfs"]; - zfs = { - devNodes = "/dev/disk/by-id"; - forceImportRoot = false; - package = mkIf (strings.hasInfix "linuxPackages_cachyos" KernelPackages) pkgs.zfs_cachyos; - }; - }; - networking.hostId = ZFS-Networking-HostID; - services.zfs = { - autoScrub = { - enable = true; - interval = "weekly"; - }; - trim = { - enable = true; # HDD no need - interval = "weekly"; - }; - autoSnapshot.enable = true; - }; - systemd.services = { - zfs-share.enable = mkForce false; - zfs-zed.enable = mkForce false; - }; - }; - }