mariadb: fix user creation

This commit is contained in:
2023-11-12 17:29:54 +08:00
parent 44ee17f2ff
commit fed092c67c
2 changed files with 4 additions and 4 deletions

6
flake.lock generated
View File

@@ -958,11 +958,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1699703546,
"narHash": "sha256-LcjcFtZlfuq3zzNm0xP5mrEBlPa185x/Y+do2j39CmQ=",
"lastModified": 1699782692,
"narHash": "sha256-oB8PrzbdOj2BLMkbVtV1UgSnyVedeRY57tZAsGUPFSM=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "045b0394cd64a1d40e16753672f87bc4b2f726e1",
"rev": "963d5addeb1fd398abba2ad704d724c78e145b57",
"type": "github"
},
"original": {

View File

@@ -53,7 +53,7 @@ inputs:
mysql = "${inputs.config.services.mysql.package}/bin/mysql";
in
# set user password
''echo "ALTER USER '${db.value.user}'@'localhost' IDENTIFIED VIA unix_socket OR mysql_native_password ''
''echo "ALTER USER '${db.value.user}' IDENTIFIED VIA unix_socket OR mysql_native_password ''
+ ''USING PASSWORD('$(cat ${passwordFile})');" | ${mysql} -N'')
(attrsToList mariadb.instances)));
sops.secrets = listToAttrs (map