summary refs log tree commit diff
path: root/nixos/modules/services/databases/mysql.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-05-17 00:13:29 +0200
committerFlorian Klink <flokli@flokli.de>2019-05-31 22:27:55 +0200
commitedd10c12f76145decf19f81e9c86ad5ad4a01c0e (patch)
tree83a58cdfaa903324a36e48238ed21de3f7f9be0a /nixos/modules/services/databases/mysql.nix
parent25494cc19388c63f620051fa7e60f6e5f0af4d5f (diff)
downloadnixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.tar
nixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.tar.gz
nixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.tar.bz2
nixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.tar.lz
nixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.tar.xz
nixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.tar.zst
nixpkgs-edd10c12f76145decf19f81e9c86ad5ad4a01c0e.zip
nixos/mysql: run as mysql user and group
As we don't need to setup data directories from ExecStartPre= scripts
anymore, which required root, but use systemd.tmpfiles.rules instead,
everything can be run as just the mysql user.
Diffstat (limited to 'nixos/modules/services/databases/mysql.nix')
-rw-r--r--nixos/modules/services/databases/mysql.nix2
1 files changed, 2 insertions, 0 deletions
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
index 7b097e95e14..97e58fd228f 100644
--- a/nixos/modules/services/databases/mysql.nix
+++ b/nixos/modules/services/databases/mysql.nix
@@ -326,6 +326,8 @@ in
         '';
 
         serviceConfig = {
+          User = cfg.user;
+          Group = "mysql";
           Type = if hasNotify then "notify" else "simple";
           # /run/mysqld needs to be created in addition to pidDir, as they could point to different locations
           RuntimeDirectory = "mysqld";