diff options
Diffstat (limited to 'system/settings/darwin.nix')
-rw-r--r-- | system/settings/darwin.nix | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/system/settings/darwin.nix b/system/settings/darwin.nix index 460d47bd..daa6f09a 100644 --- a/system/settings/darwin.nix +++ b/system/settings/darwin.nix @@ -4,25 +4,26 @@ , ... }: { imports = [ - ../../pin.nix + ./configuration/nix.nix ]; services.nix-daemon = { enable = true; enableSocketListener = true; }; + + environment.profiles = with lib; mkMerge [ + (mkOrder 800 [ "\${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile" ]) + [ "/run/current-system/sw" "/nix/var/nix/profiles/default" ] + ]; + + environment.darwinConfig = "$HOME/.config/nixpkgs/darwin-configuration.nix"; nix = { - settings.cores = lib.mkDefault 0; daemonIOLowPriority = true; gc = { - automatic = true; user = "alan"; options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))"; }; settings.extra-platforms = "aarch64-darwin x86_64-darwin"; - settings.experimental-features = "nix-command flakes"; - settings.warn-dirty = false; - settings.keep-outputs = true; - settings.keep-derivations = true; linux-builder.enable = true; settings.trusted-users = [ "@admin" ]; @@ -32,6 +33,22 @@ allowUnfree = true; }; + # needed so that nix-darwin can activate the system as root + security.sudo.extraConfig = '' + Defaults env_keep += "NIX_PATH" + ''; + + launchd.user.agents.lorri = lib.mkIf config.services.lorri.enable { + serviceConfig = { + RunAtLoad = lib.mkForce false; + Sockets = { + daemon = { + SockPathName = "${(builtins.getEnv "HOME")}/Library/Caches/com.github.target.lorri.lorri.lorri/daemon.socket"; + }; + }; + }; + }; + environment.launchDaemons = { "limit.maxfiles.plist" = { text = '' |