about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2024-05-15 09:51:48 +0200
committerGitHub <noreply@github.com>2024-05-15 09:51:48 +0200
commit67cf6279d046f35a3a5be87af074ef063354d1b2 (patch)
treecb3b819161b5defbc8db1734fdf86b37fd52f1dd /nixos
parent6278ba4ea9ced7a7c1a304040cd9d735c7e2ffa8 (diff)
Revert "nixos/garage: drop replication_mode setting"
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-servers/garage.nix25
1 files changed, 7 insertions, 18 deletions
diff --git a/nixos/modules/services/web-servers/garage.nix b/nixos/modules/services/web-servers/garage.nix
index f75829d64d67c..39ea8f21b126f 100644
--- a/nixos/modules/services/web-servers/garage.nix
+++ b/nixos/modules/services/web-servers/garage.nix
@@ -52,6 +52,13 @@ in
             type = types.path;
             description = "The main data storage, put this on your large storage (e.g. high capacity HDD)";
           };
+
+          replication_mode = mkOption {
+            default = "none";
+            type = types.enum ([ "none" "1" "2" "3" "2-dangerous" "3-dangerous" "3-degraded" 1 2 3 ]);
+            apply = v: toString v;
+            description = "Garage replication mode, defaults to none, see: <https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#replication-mode> for reference.";
+          };
         };
       };
       description = "Garage configuration, see <https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/> for reference.";
@@ -64,24 +71,6 @@ in
   };
 
   config = mkIf cfg.enable {
-
-    assertions = [
-      # We removed our module-level default for replication_mode. If a user upgraded
-      # to garage 1.0.0 while relying on the module-level default, they would be left
-      # with a config which evaluates and builds, but then garage refuses to start
-      # because either replication_factor or replication_mode is required.
-      # This assertion can be removed in NixOS 24.11, when all users have been warned once.
-      {
-        assertion = (cfg.settings ? replication_factor || cfg.settings ? replication_mode) || lib.versionOlder cfg.package "1.0.0";
-        message = ''
-          Garage 1.0.0 requires an explicit replication factor to be set.
-          Please set replication_factor to 1 explicitly to preserve the previous behavior.
-          https://git.deuxfleurs.fr/Deuxfleurs/garage/src/tag/v1.0.0/doc/book/reference-manual/configuration.md#replication_factor
-
-        '';
-      }
-    ];
-
     environment.etc."garage.toml" = {
       source = configFile;
     };