1
0

nix.nix 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. ''
  30. warn-dirty = false
  31. experimental-features = nix-command flakes impure-derivations
  32. auto-optimise-store = true
  33. ''
  34. + lib.optionalString (pkgs.system == "aarch64-darwin") ''
  35. extra-platforms = x86_64-darwin aarch64-darwin x86_64-linux aarch64-linux
  36. '';
  37. gc = {
  38. automatic = true;
  39. options = "--delete-older-than 7d";
  40. };
  41. # Map registries to channels
  42. # Very useful when using legacy commands
  43. nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
  44. };
  45. nixpkgs = {
  46. overlays = [
  47. outputs.overlays.additions
  48. outputs.overlays.modifications
  49. outputs.overlays.unstable-packages
  50. ];
  51. config = {
  52. allowUnfree = true;
  53. allowUnsupportedSystem = true;
  54. };
  55. };
  56. }