{ config, pkgs, options, lib, ... }: let # Most of the standard Darwin-detection methods cause infinite recursion. isDarwin = options.environment ? "darwinConfig"; in { nix.nixPath = [ "nixos-config=/run/current-system/nixlib/sys/${config.networking.hostName}.nix" "/run/current-system/nixlib" ]; nix.settings.auto-optimise-store = true; nix.daemonCPUSchedPolicy = "idle"; nix.settings.trusted-users = [ "@wheel" ]; nix.settings.substituters = [ "https://cache.dataaturservice.se/spectrum/" ]; nix.settings.trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "spectrum-os.org-1:rnnSumz3+Dbs5uewPlwZSTP0k3g/5SRG4hD7Wbr9YuQ=" ]; system.extraSystemBuilderCmds = '' ln -s ${lib.cleanSource ../..} $out/nixlib ''; nixpkgs.overlays = let inherit (builtins) attrNames readDir; dir = ../../overlays; names = attrNames (readDir dir); in map (o: import "${dir}/${o}") names; services = lib.optionalAttrs isDarwin { nix-daemon.enable = true; }; }