nix.nix 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. { lib, pkgs, config, outputs, ... }:
  2. {
  3. nix = {
  4. settings = {
  5. substituters = [
  6. "https://cache.nixos.org/"
  7. "https://devenv.cachix.org"
  8. "https://nix-community.cachix.org"
  9. ];
  10. trusted-public-keys = [
  11. "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
  12. "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
  13. "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  14. ];
  15. trusted-users = [ "root" "@wheel" "@admin" ];
  16. };
  17. optimise.automatic = lib.mkDefault true;
  18. extraOptions = ''
  19. warn-dirty = false
  20. experimental-features = nix-command flakes impure-derivations
  21. auto-optimise-store = true
  22. '' + lib.optionalString (pkgs.system == "aarch64-darwin") ''
  23. extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
  24. '';
  25. gc = {
  26. automatic = true;
  27. options = "--delete-older-than 7d";
  28. };
  29. # Map registries to channels
  30. # Very useful when using legacy commands
  31. nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}")
  32. config.nix.registry;
  33. };
  34. nixpkgs = {
  35. overlays = [
  36. outputs.overlays.additions
  37. outputs.overlays.modifications
  38. outputs.overlays.unstable-packages
  39. ];
  40. config = {
  41. allowUnfree = true;
  42. allowUnsupportedSystem = true;
  43. };
  44. };
  45. }