2018-06-21 16:22:12 +03:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2019-01-17 00:47:19 +03:00
|
|
|
cacert = pkgs.runCommand "cacert-0.0.0" {} "mkdir -p $out";
|
2022-08-15 00:16:56 +03:00
|
|
|
nix = pkgs.runCommand "nix-2.2" {} "mkdir -p $out";
|
2018-06-21 16:22:12 +03:00
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
services.nix-daemon.enable = true;
|
|
|
|
nix.package = nix;
|
2020-04-15 00:53:31 +03:00
|
|
|
launchd.labelPrefix = "org.nix-darwin"; # should not have an effect on nix-daemon
|
2018-06-21 16:22:12 +03:00
|
|
|
|
2019-01-17 00:47:19 +03:00
|
|
|
environment.variables.NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-certificates.crt";
|
|
|
|
|
2018-06-21 16:22:12 +03: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
|
2020-02-25 00:34:18 +03:00
|
|
|
grep "<string>/bin/wait4path" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
|
|
|
grep "&&" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
|
|
|
grep "exec ${nix}/bin/nix-daemon</string>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
2018-06-21 16:22:12 +03:00
|
|
|
grep "<key>KeepAlive</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist
|
2023-08-03 11:47:58 +03:00
|
|
|
(! grep "<key>Sockets</key>" ${config.out}/Library/LaunchDaemons/org.nixos.nix-daemon.plist)
|
2018-06-21 16:22:12 +03:00
|
|
|
|
2019-01-17 00:47:19 +03: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 16:22:12 +03:00
|
|
|
echo checking nix-daemon reload in /activate >&2
|
2020-03-28 19:16:11 +03:00
|
|
|
grep "launchctl kill HUP system/org.nixos.nix-daemon" ${config.out}/activate
|
2018-06-21 16:22:12 +03:00
|
|
|
|
2018-10-24 18:30:34 +03:00
|
|
|
echo checking NIX_REMOTE=daemon in setEnvironment >&2
|
|
|
|
grep "NIX_REMOTE=daemon" ${config.system.build.setEnvironment}
|
2018-06-21 16:22:12 +03:00
|
|
|
'';
|
|
|
|
}
|