From f39eb36250a7bd11bacc3454d9378f5bcdf683cf Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 26 Nov 2023 10:23:18 +0100 Subject: [PATCH] nixos/snapraid: remove from top-level I don't use this tool but saw it in the top level and that's not where it should live. This could arguably also be seen as a RAID; it's a bit of an in-between. --- nixos/doc/manual/release-notes/rl-2111.section.md | 2 +- nixos/modules/module-list.nix | 2 +- nixos/modules/{tasks => services/backup}/snapraid.nix | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) rename nixos/modules/{tasks => services/backup}/snapraid.nix (97%) diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md index 400eb1062d9a..8edf4fd35e4f 100644 --- a/nixos/doc/manual/release-notes/rl-2111.section.md +++ b/nixos/doc/manual/release-notes/rl-2111.section.md @@ -100,7 +100,7 @@ In addition to numerous new and upgraded packages, this release has the followin - [opensnitch](https://github.com/evilsocket/opensnitch), an application firewall. Available as [services.opensnitch](#opt-services.opensnitch.enable). - [snapraid](https://www.snapraid.it/), a backup program for disk arrays. - Available as [snapraid](#opt-snapraid.enable). + Available as [snapraid](#opt-services.snapraid.enable). - [Hockeypuck](https://github.com/hockeypuck/hockeypuck), a OpenPGP Key Server. Available as [services.hockeypuck](#opt-services.hockeypuck.enable). diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 7f708f6e57c7..99a4dc850d61 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -364,6 +364,7 @@ ./services/backup/mysql-backup.nix ./services/backup/postgresql-backup.nix ./services/backup/postgresql-wal-receiver.nix + ./services/backup/snapraid.nix ./services/backup/restic-rest-server.nix ./services/backup/restic.nix ./services/backup/rsnapshot.nix @@ -1501,7 +1502,6 @@ ./tasks/network-interfaces.nix ./tasks/powertop.nix ./tasks/scsi-link-power-management.nix - ./tasks/snapraid.nix ./tasks/stratis.nix ./tasks/swraid.nix ./tasks/trackpoint.nix diff --git a/nixos/modules/tasks/snapraid.nix b/nixos/modules/services/backup/snapraid.nix similarity index 97% rename from nixos/modules/tasks/snapraid.nix rename to nixos/modules/services/backup/snapraid.nix index 9570c6b76123..c9b2550e80e8 100644 --- a/nixos/modules/tasks/snapraid.nix +++ b/nixos/modules/services/backup/snapraid.nix @@ -2,10 +2,15 @@ with lib; -let cfg = config.snapraid; +let cfg = config.services.snapraid; in { - options.snapraid = with types; { + imports = [ + # Should have never been on the top-level. + (mkRenamedOptionModule [ "snapraid" ] [ "services" "snapraid" ]) + ]; + + options.services.snapraid = with types; { enable = mkEnableOption (lib.mdDoc "SnapRAID"); dataDisks = mkOption { default = { };