mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-20 03:40:29 +05:00
Add plausible user and database
This commit is contained in:
parent
a13a134360
commit
0af7d3e6a4
|
@ -3,7 +3,7 @@
|
|||
config.services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_15;
|
||||
ensureDatabases = [ "mastodon" "matrix-synapse" "nextcloud" "maddy" ];
|
||||
ensureDatabases = [ "mastodon" "matrix-synapse" "nextcloud" "maddy" "plausible" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "mastodon";
|
||||
|
@ -33,12 +33,20 @@
|
|||
};
|
||||
ensureClauses.login = true;
|
||||
}
|
||||
{
|
||||
name = "plausible";
|
||||
ensurePermissions = {
|
||||
"DATABASE plausible" = "ALL PRIVILEGES";
|
||||
};
|
||||
ensureClauses.login = true;
|
||||
}
|
||||
];
|
||||
initialScript = pkgs.writeText "pg-init.sql" ''
|
||||
ALTER DATABASE nextcloud OWNER TO nextcloud;
|
||||
ALTER DATABASE mastodon OWNER TO mastodon;
|
||||
ALTER DATABASE "matrix-synapse" OWNER TO "matrix-synapse";
|
||||
ALTER DATABASE maddy OWNER TO maddy;
|
||||
ALTER DATABASE plausible OWNER TO plausible;
|
||||
'';
|
||||
identMap = ''
|
||||
# ArbitraryMapName systemUser DBUser
|
||||
|
|
|
@ -25,23 +25,18 @@
|
|||
isSystemUser = true;
|
||||
group = "matrix-synapse";
|
||||
};
|
||||
plausible = {
|
||||
isSystemUser = true;
|
||||
group = "plausible";
|
||||
};
|
||||
};
|
||||
|
||||
users.groups = {
|
||||
mastodon = {
|
||||
members = [ "mastodon" config.services.nginx.user ];
|
||||
};
|
||||
nextcloud = {
|
||||
members = [ "nextcloud" config.services.nginx.user ];
|
||||
};
|
||||
photoprism = {
|
||||
members = [ "photoprism" config.services.nginx.user ];
|
||||
};
|
||||
matrix-synapse = {
|
||||
members = [ "matrix-synapse" config.services.nginx.user ];
|
||||
};
|
||||
maddy = {
|
||||
members = [ "maddy" ];
|
||||
};
|
||||
mastodon.members = [ "mastodon" config.services.nginx.user ];
|
||||
nextcloud.members = [ "nextcloud" config.services.nginx.user ];
|
||||
photoprism.members = [ "photoprism" config.services.nginx.user ];
|
||||
matrix-synapse.members = [ "matrix-synapse" config.services.nginx.user ];
|
||||
maddy.members = [ "maddy" ];
|
||||
plausible.members = [ "plausible" ];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue