1
0

nix-config.nix 1.9 KB

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