Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

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

feat: Enable btrfs auto scrub

+18 -1
+18 -1
modules/nixos/base/default.nix
··· 2 2 # your system. Help is available in the configuration.nix(5) man page, on 3 3 # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). 4 4 5 - { inputs 5 + { config 6 + , inputs 6 7 , lib 7 8 , pkgs 8 9 , system 9 10 , ... 10 11 }: 11 12 13 + let 14 + getFileSystemsByFsType = fsType: 15 + lib.filterAttrs (_: fs: fs.fsType == fsType) config.fileSystems; 16 + in 12 17 { 13 18 imports = [ 14 19 ../../shared ··· 126 131 # Services 127 132 services = { 128 133 blueman.enable = true; 134 + btrfs.autoScrub = 135 + let 136 + btrfsFileSystems = getFileSystemsByFsType "btrfs"; 137 + in 138 + lib.mkIf (btrfsFileSystems != { }) { 139 + enable = true; 140 + interval = "monthly"; 141 + fileSystems = 142 + if btrfsFileSystems?"/" 143 + then [ "/" ] 144 + else lib.attrNames btrfsFileSystems; 145 + }; 129 146 fstrim = { 130 147 enable = true; 131 148 interval = "weekly";