about summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-23 12:58:51 +0300
committerGitHub <noreply@github.com>2024-04-23 12:58:51 +0300
commit5a2d4496d31e30b9ca709dcd3cb43c930a1b26ac (patch)
tree4112478a753fceb74cbabe1ad606f1079cacf525 /nixos/tests
parent0219cfd0ae52d76921ce385f2cd55451a3827f76 (diff)
parent9258f57625b474c542938a295ee0e85c9c5533ff (diff)
Merge pull request #297726 from r-vdp/systemd-unit-names
systemd: add a name option to all systemd units
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/systemd.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix
index 1a39cc73c8868..4b087d403f37d 100644
--- a/nixos/tests/systemd.nix
+++ b/nixos/tests/systemd.nix
@@ -1,7 +1,7 @@
 import ./make-test-python.nix ({ pkgs, ... }: {
   name = "systemd";
 
-  nodes.machine = { lib, ... }: {
+  nodes.machine = { config, lib, ... }: {
     imports = [ common/user-account.nix common/x11.nix ];
 
     virtualisation.emptyDiskImages = [ 512 512 ];
@@ -38,9 +38,18 @@ import ./make-test-python.nix ({ pkgs, ... }: {
       script = "true";
     };
 
+    systemd.services.testDependency1 = {
+      description = "Test Dependency 1";
+      wantedBy = [ config.systemd.services."testservice1".name ];
+      serviceConfig.Type = "oneshot";
+      script = ''
+        true
+      '';
+    };
+
     systemd.services.testservice1 = {
       description = "Test Service 1";
-      wantedBy = [ "multi-user.target" ];
+      wantedBy = [ config.systemd.targets.multi-user.name ];
       serviceConfig.Type = "oneshot";
       script = ''
         if [ "$XXX_SYSTEM" = foo ]; then