nix.nix 1.4 KB

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