Merge pull request #263234 from CobaltCause/garage-statedirectory

nixos/garage: set `StateDirectory` if used at all
This commit is contained in:
Emily 2023-10-27 17:26:39 +02:00 committed by GitHub
commit f4e67057e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,7 @@ in
serviceConfig = {
ExecStart = "${cfg.package}/bin/garage server";
StateDirectory = mkIf (hasPrefix "/var/lib/garage" cfg.settings.data_dir && hasPrefix "/var/lib/garage" cfg.settings.metadata_dir) "garage";
StateDirectory = mkIf (hasPrefix "/var/lib/garage" cfg.settings.data_dir || hasPrefix "/var/lib/garage" cfg.settings.metadata_dir) "garage";
DynamicUser = lib.mkDefault true;
ProtectHome = true;
NoNewPrivileges = true;