{ config , pkgs , lib , ... }: { imports = [ ../../pin.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" ] ]; 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; settings.use-xdg-base-directories = true; linux-builder.enable = true; settings.trusted-users = [ "@admin" ]; }; nixpkgs.config = { allowUnfree = true; }; 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 = '' <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>limit.maxfiles</string> <key>ProgramArguments</key> <array> <string>launchctl</string> <string>limit</string> <string>maxfiles</string> <string>64000</string> <string>524288</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> ''; }; }; environment.systemPackages = with pkgs; [ watch coreutils-prefixed nixos-rebuild # for rebuilds of remote systems ]; }