summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorJakub Stachurski <j.stachurski@student.utwente.nl>2026-01-25 17:23:01 +0100
committerJakub Stachurski <j.stachurski@student.utwente.nl>2026-01-25 17:23:01 +0100
commit19835b9be47ba9b96b1f72c93c98e3c3866a858a (patch)
tree17b21a488ca321fe2831229381f06ed1f32b57b5 /services
parent77b23ce8e86b24e6aed30fadced85d6a2d7dd0a7 (diff)
Fixes in secrets and services.
Mostly fixes connection to mysql and the unix-socket auth for it.
Diffstat (limited to 'services')
-rw-r--r--services/freshrss.nix3
-rw-r--r--services/mysql.nix10
-rw-r--r--services/uptimekuma.nix3
-rw-r--r--services/vaultwarden.nix2
-rw-r--r--services/wakapi.nix6
5 files changed, 14 insertions, 10 deletions
diff --git a/services/freshrss.nix b/services/freshrss.nix
index acb1770..2cabe68 100644
--- a/services/freshrss.nix
+++ b/services/freshrss.nix
@@ -54,6 +54,7 @@ in
enableACME = cfg.doACME;
};
+ systemd.services.freshrss.after = ["mysql.service"];
wilkuu.services.mysql = {
enable = true;
users."freshrss" = {
@@ -80,7 +81,7 @@ in
virtualHost = cfg.domain;
database = {
passFile = config.sops.secrets."fresh-rss/db_pass".path;
- host = "localhost";
+ host = "127.0.0.1";
port = config.wilkuu.services.mysql.port;
name = "freshrss";
user = "freshrss";
diff --git a/services/mysql.nix b/services/mysql.nix
index 92db5f7..445751a 100644
--- a/services/mysql.nix
+++ b/services/mysql.nix
@@ -35,10 +35,10 @@ let
name:
''
-- Clauses for user ${name}
- ALTER USER IF EXISTS '${name}'@'localhost' IDENTIFIED BY unix_socket';
- CREATE USER IF NOT EXISTS '${name}'@'localhost' IDENTIFIED BY unix_socket';
+ ALTER USER IF EXISTS '${name}'@'localhost' IDENTIFIED VIA unix_socket;
+ CREATE USER IF NOT EXISTS '${name}'@'localhost' IDENTIFIED VIA unix_socket;
''
- + (lib.concatMapAttrsStringSep "\n" (priviledge_clause name) (create_users_ensure name));
+ + (lib.concatMapAttrsStringSep "\n" (priviledge_clause "'${name}'@'localhost'") (create_users_ensure name));
in
{
@@ -105,7 +105,8 @@ in
lib.concatLines (
(builtins.attrValues (builtins.mapAttrs add-user-clauses cfg.users))
++ (map add-unix-user-clauses cfg.unix_users)
- )
+ ++ ["FLUSH PRIVILEGES;"]
+ )
);
};
@@ -116,6 +117,7 @@ in
package = pkgs.mariadb;
settings = {
mysqld = {
+ # socket="/var/lib/mysql/mysql.sock";
log_error = "/var/log/mysql_err.log";
log_warnings = 2;
};
diff --git a/services/uptimekuma.nix b/services/uptimekuma.nix
index 1ac6006..32549c3 100644
--- a/services/uptimekuma.nix
+++ b/services/uptimekuma.nix
@@ -33,6 +33,7 @@ in
users.groups.uptimekuma = { };
systemd.services.uptime-kuma.serviceConfig.User = "uptimekuma";
+ systemd.services.uptime-kuma.after = ["mysql.service"];
# sops.secrets =
# (lib.genAttrs (map toSops secrets)
@@ -69,7 +70,7 @@ in
UPTIME_KUMA_PORT = "3111";
UPTIME_KUMA_HOST = "127.0.0.1";
UPTIME_KUMA_DB_TYPE = "sqlite";
- UPTIME_KUMA_DB_SOCKET = "/var/lib/mysql/mysql.sock";
+ UPTIME_KUMA_DB_SOCKET = "/run/mysqld/mysqld.sock";
};
};
});
diff --git a/services/vaultwarden.nix b/services/vaultwarden.nix
index 4aa24ba..90feace 100644
--- a/services/vaultwarden.nix
+++ b/services/vaultwarden.nix
@@ -61,7 +61,7 @@ in
services.vaultwarden = {
enable = cfg.enable;
- backupDir = "/srv/data/vaultwarden";
+ backupDir = cfg.backupDir;
config = {
DOMAIN = cfg.domain;
ROCKET_ADDRESS = "127.0.0.1";
diff --git a/services/wakapi.nix b/services/wakapi.nix
index c89a46a..69251d3 100644
--- a/services/wakapi.nix
+++ b/services/wakapi.nix
@@ -64,10 +64,11 @@ in
};
};
+ systemd.services.wakapi.after = ["mysql.service"];
services.wakapi = {
enable = true;
stateDir = cfg.dataDir;
- passwordSaltFile = config.sops.secrets.wakapi/password_salt;
+ passwordSaltFile = config.sops.secrets."wakapi/password_salt".path;
settings = {
server = {
port = 3111;
@@ -83,10 +84,9 @@ in
datetime_format = "Mon, 02 Jan 2006 15:04";
};
db = {
- socket = "/var/lib/mysql/mysql.sock";
+ socket = "/run/mysqld/mysqld.sock";
name = "wakapi";
dialect = "mysql";
- charset = "utf8mb4";
};
security = {
insecure_cookies = false;