2018-06-21 13:22:12 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2019-01-16 21:47:19 +00:00
|
|
|
cacert = pkgs.runCommand "cacert-0.0.0" {} "mkdir -p $out";
|
2018-09-14 19:23:18 +00:00
|
|
|
nix = pkgs.runCommand "nix-0.0.0" { version = "1.11.6"; } "mkdir -p $out";
|
2018-06-21 13:22:12 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
services.nix-daemon.enable = true;
|
|
|
|
nix.package = nix;
|
|
|
|
|
2019-01-16 21:47:19 +00:00
|
|
|
environment.variables.NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-certificates.crt";
|
|
|
|
|
2018-06-21 13:22:12 +00:00
|
|
|
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
|
|
|
|
|
2019-01-16 21:47:19 +00:00
|
|
|
echo checking NIX_SSL_CERT_FILE in nix-daemon service >&2
|
|
|
|
grep "<key>NIX_SSL_CERT_FILE</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
|
|
|
grep "<string>${cacert}/etc/ssl/certs/ca-certificates.crt</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
|
|
|
|
2018-06-21 13:22:12 +00:00
|
|
|
echo checking nix-daemon reload in /activate >&2
|
|
|
|
grep "pkill -HUP nix-daemon" ${config.out}/activate
|
|
|
|
|
2018-10-24 15:30:34 +00:00
|
|
|
echo checking NIX_REMOTE=daemon in setEnvironment >&2
|
|
|
|
grep "NIX_REMOTE=daemon" ${config.system.build.setEnvironment}
|
2018-06-21 13:22:12 +00:00
|
|
|
'';
|
|
|
|
}
|