{ config , pkgs , lib , ... }: { services.nix-daemon = { enable = true; enableSocketListener = true; }; 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" ]; }; nixpkgs.config = { allowUnfree = true; }; environment.launchDaemons = { "limit.maxfiles.plist" = { text = '' Label limit.maxfiles ProgramArguments launchctl limit maxfiles 64000 524288 RunAtLoad ''; }; }; environment.systemPackages = with pkgs; [ watch coreutils-prefixed nixos-rebuild # for rebuilds of remote systems ]; }