mirror of
https://github.com/ellmau/nixos.git
synced 2025-12-19 09:29:36 +01:00
Replace mariadb with psql and set it up accordingly
This commit is contained in:
parent
15fcd6bdef
commit
306c0ffd69
@ -12,14 +12,20 @@ with lib;{
|
|||||||
hostName = "cloudstore.ellmauthaler.net";
|
hostName = "cloudstore.ellmauthaler.net";
|
||||||
https = true;
|
https = true;
|
||||||
config = {
|
config = {
|
||||||
dbtype = "mysql";
|
dbtype = "pgsql";
|
||||||
dbuser = "cloudstore_user";
|
dbuser = "cloudstore_user";
|
||||||
|
dbname = "nextcloud";
|
||||||
dbpassFile = config.sops.secrets.cloudstore_user.path;
|
dbpassFile = config.sops.secrets.cloudstore_user.path;
|
||||||
adminuser = "storemin";
|
adminuser = "storemin";
|
||||||
adminpassFile = config.sops.secrets.storemin.path;
|
adminpassFile = config.sops.secrets.storemin.path;
|
||||||
|
dbhost = "/run/postgresql";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services."nextcloud-setup" = {
|
||||||
|
requires = [ "postgresql.service" ];
|
||||||
|
after = [ "postrgresql.service" ];
|
||||||
|
};
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
storemin.sopsFile = ../../secrets/server.yaml;
|
storemin.sopsFile = ../../secrets/server.yaml;
|
||||||
cloudstore_user.sopsFile = ../../secrets/server.yaml;
|
cloudstore_user.sopsFile = ../../secrets/server.yaml;
|
||||||
|
|||||||
@ -5,9 +5,14 @@ with lib;{
|
|||||||
cfg = config.elss.server.sql;
|
cfg = config.elss.server.sql;
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
services.mysql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.mariadb;
|
package = pkgs.postgresql_14;
|
||||||
|
ensureDatabases = [ "nextcloud" ];
|
||||||
|
ensureUsers = [{
|
||||||
|
name = "nextcloud";
|
||||||
|
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user