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 = {
|
config.services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.postgresql_15;
|
package = pkgs.postgresql_15;
|
||||||
ensureDatabases = [ "mastodon" "matrix-synapse" "nextcloud" "maddy" ];
|
ensureDatabases = [ "mastodon" "matrix-synapse" "nextcloud" "maddy" "plausible" ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
name = "mastodon";
|
name = "mastodon";
|
||||||
|
@ -33,12 +33,20 @@
|
||||||
};
|
};
|
||||||
ensureClauses.login = true;
|
ensureClauses.login = true;
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "plausible";
|
||||||
|
ensurePermissions = {
|
||||||
|
"DATABASE plausible" = "ALL PRIVILEGES";
|
||||||
|
};
|
||||||
|
ensureClauses.login = true;
|
||||||
|
}
|
||||||
];
|
];
|
||||||
initialScript = pkgs.writeText "pg-init.sql" ''
|
initialScript = pkgs.writeText "pg-init.sql" ''
|
||||||
ALTER DATABASE nextcloud OWNER TO nextcloud;
|
ALTER DATABASE nextcloud OWNER TO nextcloud;
|
||||||
ALTER DATABASE mastodon OWNER TO mastodon;
|
ALTER DATABASE mastodon OWNER TO mastodon;
|
||||||
ALTER DATABASE "matrix-synapse" OWNER TO "matrix-synapse";
|
ALTER DATABASE "matrix-synapse" OWNER TO "matrix-synapse";
|
||||||
ALTER DATABASE maddy OWNER TO maddy;
|
ALTER DATABASE maddy OWNER TO maddy;
|
||||||
|
ALTER DATABASE plausible OWNER TO plausible;
|
||||||
'';
|
'';
|
||||||
identMap = ''
|
identMap = ''
|
||||||
# ArbitraryMapName systemUser DBUser
|
# ArbitraryMapName systemUser DBUser
|
||||||
|
|
|
@ -25,23 +25,18 @@
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = "matrix-synapse";
|
group = "matrix-synapse";
|
||||||
};
|
};
|
||||||
|
plausible = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "plausible";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups = {
|
users.groups = {
|
||||||
mastodon = {
|
mastodon.members = [ "mastodon" config.services.nginx.user ];
|
||||||
members = [ "mastodon" config.services.nginx.user ];
|
nextcloud.members = [ "nextcloud" config.services.nginx.user ];
|
||||||
};
|
photoprism.members = [ "photoprism" config.services.nginx.user ];
|
||||||
nextcloud = {
|
matrix-synapse.members = [ "matrix-synapse" config.services.nginx.user ];
|
||||||
members = [ "nextcloud" config.services.nginx.user ];
|
maddy.members = [ "maddy" ];
|
||||||
};
|
plausible.members = [ "plausible" ];
|
||||||
photoprism = {
|
|
||||||
members = [ "photoprism" config.services.nginx.user ];
|
|
||||||
};
|
|
||||||
matrix-synapse = {
|
|
||||||
members = [ "matrix-synapse" config.services.nginx.user ];
|
|
||||||
};
|
|
||||||
maddy = {
|
|
||||||
members = [ "maddy" ];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue