1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-19 14:53:03 +00:00
nix-darwin/tests/services-nix-optimise.nix

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

20 lines
633 B
Nix
Raw Normal View History

2024-03-25 16:34:10 -07:00
{ config, pkgs, ... }:
let
nix = pkgs.runCommand "nix-2.2" { } "mkdir -p $out";
2024-03-25 16:34:10 -07:00
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>" \
2024-03-25 16:34:10 -07:00
${config.out}/Library/LaunchDaemons/org.nixos.nix-optimise.plist
(! grep "<key>KeepAlive</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-optimise.plist)
'';
}