2022-12-05 01:18:31 +01:00
|
|
|
{ pkgs, inputs, lib, config, ... }: {
|
2021-11-21 14:33:20 +01:00
|
|
|
nix = {
|
2022-04-05 20:17:08 +02:00
|
|
|
gc.automatic = true;
|
2022-08-16 10:31:45 +02:00
|
|
|
optimise.automatic = true;
|
2021-11-21 14:33:20 +01:00
|
|
|
|
2022-04-05 20:17:08 +02:00
|
|
|
# Protect nix-shell from garbage collection
|
|
|
|
# TODO: look into whether this is still needed when using nix flakes
|
2021-11-21 14:33:20 +01:00
|
|
|
extraOptions = ''
|
2022-04-05 20:17:08 +02:00
|
|
|
keep-outputs = true
|
|
|
|
keep-derivations = true
|
2022-08-18 09:53:29 +02:00
|
|
|
experimental-features = nix-command flakes
|
2021-11-21 14:33:20 +01:00
|
|
|
'';
|
2022-04-04 01:10:26 +02:00
|
|
|
|
2022-12-05 01:18:31 +01:00
|
|
|
# This will add each flake input as a registry
|
|
|
|
# To make nix3 commands consistent with your flake
|
|
|
|
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
|
|
|
|
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
|
|
# nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
|
|
|
|
2022-08-16 10:31:45 +02:00
|
|
|
settings = {
|
|
|
|
trusted-users = [ "root" "adrielus" "@wheel" ];
|
|
|
|
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
|
|
|
# Caching and whatnot
|
|
|
|
substituters = [
|
|
|
|
"https://cache.nixos.org"
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://cm-idris2-pkgs.cachix.org"
|
|
|
|
"https://danth.cachix.org"
|
|
|
|
# "https://all-hies.cachix.org" # Do I even use all-hies anymore?
|
|
|
|
];
|
2022-04-04 01:10:26 +02:00
|
|
|
|
2022-08-16 10:31:45 +02:00
|
|
|
trusted-public-keys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"cm-idris2-pkgs.cachix.org-1:YB2oJSEsD5oMJjAESxolC2GQtE6B5I6jkWhte2gtXjk="
|
|
|
|
"danth.cachix.org-1:wpodfSL7suXRc/rJDZZUptMa1t4MJ795hemRN0q84vI="
|
|
|
|
# "all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k="
|
|
|
|
];
|
|
|
|
};
|
2021-11-21 14:33:20 +01:00
|
|
|
};
|
|
|
|
}
|