my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixos/hardware/fs: simplify

isabel dccbf62a ca9b06af

+13 -22
+13 -22
modules/nixos/hardware/fs.nix
··· 1 - { lib, config, ... }: 2 - let 3 - inherit (lib) mkIf mkMerge filterAttrs; 4 - 5 - hasBtrfs = (filterAttrs (_: v: v.fsType == "btrfs") config.fileSystems) != { }; 6 - in 1 + { config, ... }: 7 2 { 8 - config = mkMerge [ 9 - { 10 - # discard blocks that are not in use by the filesystem, good for SSDs health 11 - services.fstrim = { 12 - enable = true; 13 - interval = "weekly"; 14 - }; 15 - } 3 + # discard blocks that are not in use by the filesystem, good for SSDs health 4 + services = { 5 + fstrim = { 6 + enable = true; 7 + interval = "weekly"; 8 + }; 16 9 17 10 # clean btrfs devices 18 - (mkIf hasBtrfs { 19 - services.btrfs.autoScrub = { 20 - enable = true; 21 - interval = "weekly"; 22 - fileSystems = [ "/" ]; 23 - }; 24 - }) 25 - ]; 11 + btrfs.autoScrub = { 12 + enable = config.boot.supportedFilesystems.btrfs or false; 13 + interval = "weekly"; 14 + fileSystems = [ "/" ]; 15 + }; 16 + }; 26 17 }