tsuki: use `ensureDBOwnership` for postgres for nixos 24.05 migration

This commit is contained in:
Oystein Kristoffer Tveit 2024-06-10 00:43:04 +02:00
parent 68bf2cd1b0
commit 9187a62d6f
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
6 changed files with 15 additions and 32 deletions

View File

@ -55,14 +55,10 @@ in {
services.postgresql = lib.mkIf cfg.enable {
enable = true;
ensureDatabases = [ "headscale" ];
ensureUsers = [
(rec {
ensureUsers = [{
name = "headscale";
ensurePermissions = {
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
};
})
];
ensureDBOwnership = true;
}];
};
environment.systemPackages = lib.mkIf cfg.enable [ pkgs.headscale ];

View File

@ -53,11 +53,10 @@ in {
services.postgresql = {
ensureDatabases = [ "hedgedoc" ];
ensureUsers = [{
name = "hedgedoc";
ensurePermissions = {
"DATABASE \"hedgedoc\"" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
}];
};

View File

@ -5,9 +5,7 @@
cfg = config.services;
db = name: {
inherit name;
ensurePermissions = {
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
};
in {
enable = true;

View File

@ -170,9 +170,7 @@ in
o = lib.optional;
db = name: {
inherit name;
ensurePermissions = {
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
};
ensureDBOwnership = true;
};
in {
enable = true;

View File

@ -58,13 +58,9 @@
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
(rec {
name = "nextcloud";
ensurePermissions = {
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
};
})
];
ensureUsers = [{
name = "nextcloud";
ensureDBOwnership = true;
}];
};
}

View File

@ -59,14 +59,10 @@ in {
services.postgresql = lib.mkIf cfg.enable {
enable = true;
ensureDatabases = [ "vaultwarden" ];
ensureUsers = [
(rec {
name = "vaultwarden";
ensurePermissions = {
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
};
})
];
ensureUsers = [{
name = "vaultwarden";
ensureDBOwnership = true;
}];
};
local.socketActivation.vaultwarden = {