| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- { lib, pkgs, config, ... }:
- {
- nix = {
- package = pkgs.nix;
- settings = {
- substituters = [
- "https://cache.nixos.org/"
- "https://devenv.cachix.org"
- "https://nix-community.cachix.org"
- ];
- trusted-public-keys = [
- "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
- "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
- "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
- ];
- trusted-users = [ "root" "@wheel" "@admin" ];
- };
- extraOptions = ''
- warn-dirty = false
- experimental-features = nix-command flakes impure-derivations
- auto-optimise-store = true
- '' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
- extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
- '';
- gc = {
- automatic = true;
- options = "--delete-older-than 7d";
- };
- # Map registries to channels
- # Very useful when using legacy commands
- nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}")
- config.nix.registry;
- # TODO: Conditionally add the optimise attribute if it exists
- # } // lib.mkIf (lib.hasAttr "nix.optimise.automatic" config) {
- # optimise = {
- # automatic = lib.mkDefault true;
- # };
- };
- nixpkgs = {
- # TODO: re-enable overlays when we bring them back here
- # overlays = [
- # outputs.overlays.additions
- # outputs.overlays.modifications
- # outputs.overlays.unstable-packages
- # ];
- config = {
- allowUnfree = true;
- allowUnsupportedSystem = true;
- };
- };
- }
|