summaryrefslogtreecommitdiffstats
path: root/tests/services-nix-optimise.nix
blob: acdc1dcefa6c8b444ca6195811804e3fa17cc483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ config, pkgs, ... }:

let
  nix = pkgs.runCommand "nix-2.2" { } "mkdir -p $out";
in

{
  nix.optimise.automatic = true;
  nix.package = nix;

  test = ''
    echo checking nix-optimise service in /Library/LaunchDaemons >&2
    grep "<string>org.nixos.nix-optimise</string>" \
      ${config.out}/Library/LaunchDaemons/org.nixos.nix-optimise.plist
    grep "<string>/bin/wait4path /nix/store &amp;&amp; exec ${nix}/bin/nix-store --optimise</string>" \
      ${config.out}/Library/LaunchDaemons/org.nixos.nix-optimise.plist
    (! grep "<key>KeepAlive</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-optimise.plist)
  '';
}