1
0

nix-config.nix 1.8 KB

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