1
0

nix.nix 1.4 KB

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