about summary refs log tree commit diff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/boot/default.nix1
-rw-r--r--modules/system/btrfs/default.nix15
2 files changed, 12 insertions, 4 deletions
diff --git a/modules/system/boot/default.nix b/modules/system/boot/default.nix
index cac1cec..5a5ac25 100644
--- a/modules/system/boot/default.nix
+++ b/modules/system/boot/default.nix
@@ -24,7 +24,6 @@ in
       tmpOnTmpfs = true;
 
       initrd = {
-        luks.devices."system".allowDiscards = true;
         network = lib.mkIf cfg.initrd.network.enable {
           enable = true;
           postCommands = ''
diff --git a/modules/system/btrfs/default.nix b/modules/system/btrfs/default.nix
index d569c78..3446b2c 100644
--- a/modules/system/btrfs/default.nix
+++ b/modules/system/btrfs/default.nix
@@ -1,5 +1,14 @@
-{ ... }:
-
+{ lib, config, ... }:
+let
+  cfg = config.my.systems.btrfs;
+in
 {
-  services.btrfs.autoScrub.enable = true;
+  options.my.systems.btrfs = with lib; {
+    enable = mkEnableOption "btrfs configuration";
+  };
+
+  config = lib.mkIf cfg.enable
+    {
+      services.btrfs.autoScrub.enable = !config.virtualisation.libvirtd.enable;
+    };
 }