diff --git a/flake.nix b/flake.nix index d88d8d2..13c95f0 100644 --- a/flake.nix +++ b/flake.nix @@ -141,7 +141,6 @@ }; }; }; - services.fstrim.enable = true; } # Home manager configuration @@ -162,6 +161,14 @@ } ./nixos_modules/bertof_user.nix + + # Some defaults + { + services.fstrim.enable = true; + services.fwupd.enable = true; + services.smartd.enable = true; + } + ./nixos_modules/btrfs_scrub.nix ./nixos_modules/distributed.nix ./nixos_modules/remote-deploy.nix ./nixos_modules/extended_registry.nix diff --git a/freya/configuration.nix b/freya/configuration.nix index 5cae319..87c9e92 100644 --- a/freya/configuration.nix +++ b/freya/configuration.nix @@ -145,10 +145,6 @@ with lib; { # }; # }; # }; - smartd = { - enable = true; - notifications.x11.enable = true; - }; # sonarr = { enable = true; openFirewall = true; group = "users"; }; thermald.enable = true; # transmission = { diff --git a/loki/configuration.nix b/loki/configuration.nix index 0fc195b..1a4732a 100644 --- a/loki/configuration.nix +++ b/loki/configuration.nix @@ -170,10 +170,6 @@ with lib; { }; }; }; - smartd = { - enable = true; - notifications.x11.enable = true; - }; sonarr = { enable = true; openFirewall = true; diff --git a/nixos_modules/btrfs_scrub.nix b/nixos_modules/btrfs_scrub.nix new file mode 100644 index 0000000..0eaf53d --- /dev/null +++ b/nixos_modules/btrfs_scrub.nix @@ -0,0 +1,14 @@ +{ lib, config, ... }: +let + inherit (builtins) mapAttrs attrValues; + inherit (lib) filterAttrs unique; + btrfsFileSystems = + filterAttrs (_k: v: v.fsType == "btrfs") config.fileSystems; + btrfsDevices = + unique (attrValues (mapAttrs (_: v: v.device) btrfsFileSystems)); +in { + services.btrfs.autoScrub = { + enable = true; + fileSystems = btrfsDevices; + }; +} diff --git a/odin/common_configuration.nix b/odin/common_configuration.nix index 9aa5f1c..a4cfc01 100644 --- a/odin/common_configuration.nix +++ b/odin/common_configuration.nix @@ -84,8 +84,6 @@ with lib; { ]; }; - services.fwupd.enable = true; - services.keybase.enable = true; # Enable sound. @@ -229,12 +227,6 @@ with lib; { }; }; - # SMART - services.smartd = { - enable = true; - notifications.x11.enable = true; - }; - # FPRINTD # services.fprintd = { # enable = true; diff --git a/thor/configuration.nix b/thor/configuration.nix index b5638b4..4eed544 100644 --- a/thor/configuration.nix +++ b/thor/configuration.nix @@ -96,7 +96,6 @@ with lib; { # updater.enable = true; # }; dbus.packages = with pkgs; [ dconf ]; - fwupd.enable = true; gnome.gnome-keyring.enable = true; gvfs = { enable = true; @@ -121,10 +120,6 @@ with lib; { # media-session.enable = true; }; power-profiles-daemon.enable = true; - smartd = { - enable = true; - notifications.x11.enable = true; - }; snapper = { configs = let common = {