nix-settings.nix 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {
  2. inputs,
  3. system,
  4. nixpkgs,
  5. max-jobs,
  6. }:
  7. # Nix daemon settings that can't be put in `nixConfig`.
  8. {
  9. extraOptions = ''
  10. keep-outputs = true
  11. keep-derivations = true
  12. http-connections = 0
  13. '';
  14. nixPath = [
  15. "nixpkgs=${nixpkgs}"
  16. "home-manager=${inputs.home}"
  17. ];
  18. package = inputs.nix.packages.${system}.default;
  19. gc = {
  20. automatic = true;
  21. dates = "weekly";
  22. options = "--delete-older-than 3d";
  23. };
  24. optimise.automatic = true;
  25. registry = {
  26. system.flake = inputs.self;
  27. default.flake = nixpkgs;
  28. nixpkgs.flake = nixpkgs;
  29. home-manager.flake = inputs.home;
  30. };
  31. settings = let
  32. isDarwin = nixpkgs.lib.hasSuffix "darwin" system;
  33. in {
  34. accept-flake-config = true;
  35. experimental-features = ["ca-derivations" "flakes" "nix-command"];
  36. inherit max-jobs;
  37. auto-optimise-store = true;
  38. sandbox = !isDarwin;
  39. sandbox-fallback = nixpkgs.lib.mkForce isDarwin;
  40. # home-manager will attempt to rebuild the world otherwise...
  41. substituters = [
  42. "https://cache.nixos.org?priority=7"
  43. "https://cache.garnix.io?priority=6"
  44. "https://nix-community.cachix.org?priority=5"
  45. "https://ezkea.cachix.org"
  46. "https://nixpkgs-wayland.cachix.org"
  47. "https://ludovico-home-manager.cachix.org"
  48. ];
  49. trusted-public-keys = [
  50. "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
  51. "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
  52. "ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI="
  53. "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
  54. "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
  55. "ludovico-home-manager.cachix.org-1:0C6ekMczzOf71RZpFtdxgE1sbALZaAqHclFavdwPZUU="
  56. ];
  57. trusted-users = ["root" "@wheel"];
  58. allowed-users = ["@wheel"];
  59. };
  60. }