summary refs log tree commit diff
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2021-09-22 11:19:26 +0200
committerrnhmjoj <rnhmjoj@inventati.org>2021-09-22 11:20:30 +0200
commit87d76b1783f5c34c2402a8d9c635341e011df220 (patch)
tree41f6fe10d563070303664e4642959b71cc483dea
parent08cd8667eeef874dc99c2d0f5ecdb88d6f454a14 (diff)
downloadnixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.tar
nixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.tar.gz
nixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.tar.bz2
nixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.tar.lz
nixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.tar.xz
nixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.tar.zst
nixpkgs-87d76b1783f5c34c2402a8d9c635341e011df220.zip
nixos/tests/mysql: fix nogroup
This fixes the evaluation after for #133166.
-rw-r--r--nixos/tests/mysql/mysql.nix36
1 files changed, 29 insertions, 7 deletions
diff --git a/nixos/tests/mysql/mysql.nix b/nixos/tests/mysql/mysql.nix
index 2ec9c3d50a3..dce5fa26acf 100644
--- a/nixos/tests/mysql/mysql.nix
+++ b/nixos/tests/mysql/mysql.nix
@@ -1,4 +1,26 @@
-import ./../make-test-python.nix ({ pkgs, ...} : {
+import ./../make-test-python.nix ({ pkgs, ...}:
+
+
+let
+  # Setup common users
+  users = { ... }:
+  {
+    users.groups.testusers = { };
+
+    users.users.testuser = {
+      isSystemUser = true;
+      group = "testusers";
+    };
+
+    users.users.testuser2 = {
+      isSystemUser = true;
+      group = "testusers";
+    };
+  };
+
+in
+
+{
   name = "mysql";
   meta = with pkgs.lib.maintainers; {
     maintainers = [ eelco shlevy ];
@@ -9,8 +31,8 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
       { pkgs, ... }:
 
       {
-        users.users.testuser = { isSystemUser = true; };
-        users.users.testuser2 = { isSystemUser = true; };
+        imports = [ users ];
+
         services.mysql.enable = true;
         services.mysql.initialDatabases = [
           { name = "testdb3"; schema = ./testdb.sql; }
@@ -40,12 +62,12 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
       { pkgs, ... }:
 
       {
+        imports = [ users ];
+
         # prevent oom:
         # Kernel panic - not syncing: Out of memory: compulsory panic_on_oom is enabled
         virtualisation.memorySize = 1024;
 
-        users.users.testuser = { isSystemUser = true; };
-        users.users.testuser2 = { isSystemUser = true; };
         services.mysql.enable = true;
         services.mysql.initialDatabases = [
           { name = "testdb3"; schema = ./testdb.sql; }
@@ -75,8 +97,8 @@ import ./../make-test-python.nix ({ pkgs, ...} : {
       { pkgs, ... }:
 
       {
-        users.users.testuser = { isSystemUser = true; };
-        users.users.testuser2 = { isSystemUser = true; };
+        imports = [ users ];
+
         services.mysql.enable = true;
         services.mysql.initialScript = pkgs.writeText "mariadb-init.sql" ''
           ALTER USER root@localhost IDENTIFIED WITH unix_socket;