flake/nixos/profiles/core/nix.nix

54 lines
1.3 KiB
Nix
Raw Normal View History

2024-07-10 05:45:51 +08:00
{
lib,
config,
2024-07-10 07:18:57 +08:00
inputs,
2024-07-10 05:45:51 +08:00
...
}:
{
2023-09-19 08:17:43 +08:00
nix.settings = {
2023-11-27 20:33:27 +08:00
substituters =
2024-07-10 05:45:51 +08:00
(lib.optionals (config.time.timeZone == "Asia/Shanghai") [
"https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" # TUNA - 清华大学 Mirror
])
2023-12-03 16:16:41 +08:00
++ [
"https://nix-community.cachix.org"
"https://guanran928.cachix.org"
2023-11-27 20:33:27 +08:00
];
2023-09-19 08:17:43 +08:00
trusted-public-keys = [
2023-09-27 07:40:21 +08:00
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"guanran928.cachix.org-1:BE/iBCj2/pqJXG908wHRrcaV0B2fC+KbFjHsXY6b91c="
2023-09-19 08:17:43 +08:00
];
2024-01-25 02:06:42 +08:00
2024-07-07 21:40:43 +08:00
experimental-features = [
"auto-allocate-uids"
"cgroups"
2024-07-10 07:18:57 +08:00
"flakes"
"nix-command"
2024-07-07 21:40:43 +08:00
"no-url-literals"
];
2024-07-10 07:18:57 +08:00
flake-registry = "";
trusted-users = [ "@wheel" ];
2024-07-07 21:40:43 +08:00
allow-import-from-derivation = false;
2024-01-25 02:06:42 +08:00
auto-allocate-uids = true;
2024-07-10 07:18:57 +08:00
auto-optimise-store = true;
2024-01-25 02:06:42 +08:00
builders-use-substitutes = true;
use-cgroups = true;
2023-09-19 08:17:43 +08:00
use-xdg-base-directories = true;
};
2024-07-10 07:18:57 +08:00
nix = {
# Add each flake input as a registry
# To make nix3 commands consistent with the flake
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
2024-07-10 07:18:57 +08:00
# Disable nix-channel
channel.enable = false;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
2024-06-05 17:51:12 +08:00
};
2023-09-19 08:17:43 +08:00
}