diff --git a/modules/services/nix-daemon.nix b/modules/services/nix-daemon.nix index 4ae5ff9b..f29d8a99 100644 --- a/modules/services/nix-daemon.nix +++ b/modules/services/nix-daemon.nix @@ -14,6 +14,18 @@ in description = "Whether to activate system at boot time."; }; + services.nix-daemon.logFile = mkOption { + type = types.nullOr types.path; + default = null; + example = "/var/log/nix-daemon.log"; + description = '' + The logfile to use for the nix-daemon service. Alternatively + sudo launchctl debug system/org.nixos.nix-daemon --stderr + can be used to stream the logs to a shell after restarting the service with + sudo launchctl kickstart -k system/org.nixos.nix-daemon. + ''; + }; + services.nix-daemon.tempDir = mkOption { type = types.nullOr types.path; default = null; @@ -38,6 +50,7 @@ in serviceConfig.LowPriorityIO = config.nix.daemonIONice; serviceConfig.Nice = config.nix.daemonNiceLevel; serviceConfig.SoftResourceLimits.NumberOfFiles = 4096; + serviceConfig.StandardErrorPath = cfg.logFile; serviceConfig.EnvironmentVariables = config.nix.envVars // { NIX_SSL_CERT_FILE = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"; }