summaryrefslogtreecommitdiff
path: root/services/mysql.nix
diff options
context:
space:
mode:
Diffstat (limited to 'services/mysql.nix')
-rw-r--r--services/mysql.nix10
1 files changed, 7 insertions, 3 deletions
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 = "%";
+ };
};
}
);