summaryrefslogtreecommitdiff
path: root/tests/services-activate-system-changed-label-prefix.nix
blob: 2c2f60385c5be9bf351e8c2739a90308abb2dc71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{ config, pkgs, ... }:

{
  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'[< ]' '$6 ~ "^/nix/store/.*" {print $6}')
    grep "ln -sfn .* /run/current-system" "$script"
  '';
}