nixos/garage: fix replication 1.0 assertion

Use the `cfg.package.version` (string) instead of the entire package so
users don't see  `error: value is a set while a string was expected`
instead of the intended assertion message.
This commit is contained in:
Sarah Brofeldt 2024-06-03 09:51:19 +02:00
parent 57610d2f8f
commit f7393d13fe

View File

@ -83,7 +83,7 @@ in
# These assertions 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";
assertion = (cfg.settings ? replication_factor || cfg.settings ? replication_mode) || lib.versionOlder cfg.package.version "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.