From bb87f9ebadc3bb5c5158d9fbad9a5acef8c8f692 Mon Sep 17 00:00:00 2001 From: Jakub Stachurski Date: Wed, 11 Feb 2026 15:29:51 +0100 Subject: Apply changes from messing around and making things work --- services/mysql.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'services/mysql.nix') diff --git a/services/mysql.nix b/services/mysql.nix index 83a5033..06edfcb 100644 --- a/services/mysql.nix +++ b/services/mysql.nix @@ -23,10 +23,10 @@ let ( '' -- Clauses for user ${name} - ALTER USER IF EXISTS '${name}'@'%' IDENTIFIED BY '${ucfg.sopsPlaceholder}'; - CREATE USER IF NOT EXISTS '${name}'@'%' IDENTIFIED BY '${ucfg.sopsPlaceholder}'; + ALTER USER IF EXISTS '${name}'@'${ucfg.host}' IDENTIFIED BY '${ucfg.sopsPlaceholder}'; + CREATE USER IF NOT EXISTS '${name}'@'${ucfg.host}' IDENTIFIED BY '${ucfg.sopsPlaceholder}'; '' - + (lib.concatMapAttrsStringSep "\n" (priviledge_clause "'name'@'%'") (create_users_ensure name)) + + (lib.concatMapAttrsStringSep "\n" (priviledge_clause "'${name}'@'${ucfg.host}'") (create_users_ensure name)) ) else " -- Ommitted user ${name}"; @@ -84,6 +84,10 @@ in allowedRanges = mkOption { type = types.listOf types.str; }; + host = mkOption { + type = types.str; + default = "%"; + }; }; } ); -- cgit v1.3.1