summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorWael M. Nasreddine <wael@keeptruckin.com>2020-04-14 14:53:31 -0700
committerWael M. Nasreddine <wael.nasreddine@gmail.com>2020-04-14 15:01:37 -0700
commitcee84f4ea04d0ce3a6dc1f2c34d09a0ae5beed95 (patch)
tree218fe513d6e572e26bc5655e30d4a627b795bca0 /tests
parent053f2cb9cb0ce7ceb4933cbd76e2d28713ad85da (diff)
launchd: allow customization of the default launchd prefix
Diffstat (limited to 'tests')
-rw-r--r--tests/services-activate-system-changed-label-prefix.nix15
-rw-r--r--tests/services-nix-daemon.nix1
-rw-r--r--tests/sockets-nix-daemon.nix1
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/services-activate-system-changed-label-prefix.nix b/tests/services-activate-system-changed-label-prefix.nix
new file mode 100644
index 0000000..5ac9969
--- /dev/null
+++ b/tests/services-activate-system-changed-label-prefix.nix
@@ -0,0 +1,15 @@
+{ config, pkgs, ... }:
+
+{
+ services.activate-system.enable = true;
+ launchd.labelPrefix = "org.nix-darwin";
+
+ test = ''
+ echo checking activation service in /Library/LaunchDaemons >&2
+ grep "org.nix-darwin.activate-system" ${config.out}/Library/LaunchDaemons/org.nix-darwin.activate-system.plist
+
+ echo checking activation of /run/current-system >&2
+ script=$(cat ${config.out}/Library/LaunchDaemons/org.nix-darwin.activate-system.plist | awk -F'[< ]' '$3 ~ "^/nix/store/.*" {print $3}')
+ grep "ln -sfn .* /run/current-system" "$script"
+ '';
+}
diff --git a/tests/services-nix-daemon.nix b/tests/services-nix-daemon.nix
index 52760eb..6c972df 100644
--- a/tests/services-nix-daemon.nix
+++ b/tests/services-nix-daemon.nix
@@ -8,6 +8,7 @@ in
{
services.nix-daemon.enable = true;
nix.package = nix;
+ launchd.labelPrefix = "org.nix-darwin"; # should not have an effect on nix-daemon
environment.variables.NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-certificates.crt";
diff --git a/tests/sockets-nix-daemon.nix b/tests/sockets-nix-daemon.nix
index 6db6d5e..d1b2827 100644
--- a/tests/sockets-nix-daemon.nix
+++ b/tests/sockets-nix-daemon.nix
@@ -8,6 +8,7 @@ in
services.nix-daemon.enable = true;
services.nix-daemon.enableSocketListener = true;
nix.package = nix;
+ launchd.labelPrefix = "org.nix-darwin"; # should not have an effect on nix-daemon
test = ''
echo checking nix-daemon service in /Library/LaunchDaemons >&2