mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 02:37:09 +00:00
nix-daemon: add tests
This commit is contained in:
parent
27a5758728
commit
9987c71c83
3 changed files with 46 additions and 0 deletions
|
@ -100,6 +100,8 @@ let
|
|||
tests.programs-zsh = makeTest ./tests/programs-zsh.nix;
|
||||
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
|
||||
tests.services-buildkite-agent = makeTest ./tests/services-buildkite-agent.nix;
|
||||
tests.services-nix-daemon = makeTest ./tests/services-nix-daemon.nix;
|
||||
tests.sockets-nix-daemon = makeTest ./tests/sockets-nix-daemon.nix;
|
||||
tests.services-ofborg = makeTest ./tests/services-ofborg.nix;
|
||||
tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix;
|
||||
tests.services-skhd = makeTest ./tests/services-skhd.nix;
|
||||
|
|
24
tests/services-nix-daemon.nix
Normal file
24
tests/services-nix-daemon.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
nix = pkgs.runCommand "nix-0.0.0" {} "mkdir -p $out";
|
||||
in
|
||||
|
||||
{
|
||||
services.nix-daemon.enable = true;
|
||||
nix.package = nix;
|
||||
|
||||
test = ''
|
||||
echo checking nix-daemon service in /Library/LaunchDaemons >&2
|
||||
grep "<string>org.nixos.nix-daemon</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
grep "<string>exec ${nix}/bin/nix-daemon</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
grep "<key>KeepAlive</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
! grep "<key>Sockets</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
|
||||
echo checking nix-daemon reload in /activate >&2
|
||||
grep "pkill -HUP nix-daemon" ${config.out}/activate
|
||||
|
||||
echo checking NIX_REMOTE=daemon in /etc/bashrc >&2
|
||||
grep "NIX_REMOTE=daemon" ${config.out}/etc/bashrc
|
||||
'';
|
||||
}
|
20
tests/sockets-nix-daemon.nix
Normal file
20
tests/sockets-nix-daemon.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
nix = pkgs.runCommand "nix-0.0.0" {} "mkdir -p $out";
|
||||
in
|
||||
|
||||
{
|
||||
services.nix-daemon.enable = true;
|
||||
services.nix-daemon.enableSocketListener = true;
|
||||
nix.package = nix;
|
||||
|
||||
test = ''
|
||||
echo checking nix-daemon service in /Library/LaunchDaemons >&2
|
||||
grep "<string>org.nixos.nix-daemon</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
grep "<string>exec ${nix}/bin/nix-daemon</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
! grep "<key>KeepAlive</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
grep "<key>Sockets</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
grep "/nix/var/nix/daemon-socket/socket" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
||||
'';
|
||||
}
|
Loading…
Add table
Reference in a new issue