summaryrefslogtreecommitdiff
path: root/tests/checks-nix-gc.nix
blob: e3dccd7f69c79903ee5192d4ee6859772867d8ec (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.gc.automatic = true;
  nix.package = nix;

  test = ''
    echo checking nix-gc validation >&2
    grep "nix.gc.user = " ${config.out}/activate-user

    echo checking nix-gc service in /Library/LaunchDaemons >&2
    grep "<string>org.nixos.nix-gc</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist
    (! grep "<key>UserName</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist)
  '';
}