1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-07 01:07:03 +00:00
nix-darwin/tests/services-nix-gc.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
651 B
Nix
Raw Normal View History

2019-01-03 20:58:57 +01:00
{ config, pkgs, ... }:
let
nix = pkgs.runCommand "nix-2.2" { } "mkdir -p $out";
2019-01-03 20:58:57 +01:00
in
{
nix.gc.automatic = true;
nix.gc.options = "--delete-older-than 30d";
nix.package = nix;
test = ''
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 "<string>/bin/wait4path /nix/store &amp;&amp; exec ${nix}/bin/nix-collect-garbage --delete-older-than 30d</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist
(! grep "<key>KeepAlive</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-gc.plist)
2019-01-03 20:58:57 +01:00
'';
}