tsuki: use `ensureDBOwnership` for postgres for nixos 24.05 migration
This commit is contained in:
parent
68bf2cd1b0
commit
9187a62d6f
|
@ -55,14 +55,10 @@ in {
|
||||||
services.postgresql = lib.mkIf cfg.enable {
|
services.postgresql = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = [ "headscale" ];
|
ensureDatabases = [ "headscale" ];
|
||||||
ensureUsers = [
|
ensureUsers = [{
|
||||||
(rec {
|
|
||||||
name = "headscale";
|
name = "headscale";
|
||||||
ensurePermissions = {
|
ensureDBOwnership = true;
|
||||||
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
|
}];
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = lib.mkIf cfg.enable [ pkgs.headscale ];
|
environment.systemPackages = lib.mkIf cfg.enable [ pkgs.headscale ];
|
||||||
|
|
|
@ -53,11 +53,10 @@ in {
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
ensureDatabases = [ "hedgedoc" ];
|
ensureDatabases = [ "hedgedoc" ];
|
||||||
|
|
||||||
ensureUsers = [{
|
ensureUsers = [{
|
||||||
name = "hedgedoc";
|
name = "hedgedoc";
|
||||||
ensurePermissions = {
|
ensureDBOwnership = true;
|
||||||
"DATABASE \"hedgedoc\"" = "ALL PRIVILEGES";
|
|
||||||
};
|
|
||||||
}];
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,7 @@
|
||||||
cfg = config.services;
|
cfg = config.services;
|
||||||
db = name: {
|
db = name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
ensurePermissions = {
|
ensureDBOwnership = true;
|
||||||
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -170,9 +170,7 @@ in
|
||||||
o = lib.optional;
|
o = lib.optional;
|
||||||
db = name: {
|
db = name: {
|
||||||
inherit name;
|
inherit name;
|
||||||
ensurePermissions = {
|
ensureDBOwnership = true;
|
||||||
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -58,13 +58,9 @@
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = [ "nextcloud" ];
|
ensureDatabases = [ "nextcloud" ];
|
||||||
ensureUsers = [
|
ensureUsers = [{
|
||||||
(rec {
|
name = "nextcloud";
|
||||||
name = "nextcloud";
|
ensureDBOwnership = true;
|
||||||
ensurePermissions = {
|
}];
|
||||||
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,14 +59,10 @@ in {
|
||||||
services.postgresql = lib.mkIf cfg.enable {
|
services.postgresql = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = [ "vaultwarden" ];
|
ensureDatabases = [ "vaultwarden" ];
|
||||||
ensureUsers = [
|
ensureUsers = [{
|
||||||
(rec {
|
name = "vaultwarden";
|
||||||
name = "vaultwarden";
|
ensureDBOwnership = true;
|
||||||
ensurePermissions = {
|
}];
|
||||||
"DATABASE \"${name}\"" = "ALL PRIVILEGES";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
local.socketActivation.vaultwarden = {
|
local.socketActivation.vaultwarden = {
|
||||||
|
|
Loading…
Reference in New Issue