2024-09-04 14:20:11 +10:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
2021-03-04 10:56:14 +01:00
|
|
|
|
|
|
|
let
|
2023-09-05 17:27:20 +10:00
|
|
|
asGB = size: toString (size * 1024 * 1024 * 1024);
|
2021-03-04 10:56:14 +01:00
|
|
|
in
|
|
|
|
{
|
2024-11-21 13:36:17 +10:00
|
|
|
nixpkgs.hostPlatform = {
|
|
|
|
inherit (pkgs.hostPlatform) system;
|
|
|
|
};
|
|
|
|
|
2021-03-04 10:56:14 +01:00
|
|
|
nix = {
|
2022-01-29 11:24:20 +01:00
|
|
|
settings.trusted-public-keys = [
|
2021-03-04 10:56:14 +01:00
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
];
|
|
|
|
|
2024-07-24 19:05:26 +10:00
|
|
|
settings.substituters = [ "https://nix-community.cachix.org" ];
|
2021-03-04 10:56:14 +01:00
|
|
|
|
2022-01-29 11:24:20 +01:00
|
|
|
# auto-free the /nix/store
|
2024-08-11 12:05:42 +10:00
|
|
|
settings.min-free = asGB 1;
|
2023-09-07 13:48:46 +10:00
|
|
|
settings.max-free = asGB 50;
|
2021-03-04 10:56:14 +01:00
|
|
|
|
2024-09-04 14:20:11 +10:00
|
|
|
channel.enable = false;
|
|
|
|
# disable global registry
|
|
|
|
settings.flake-registry = "";
|
|
|
|
# set system registry
|
|
|
|
registry = {
|
|
|
|
nixpkgs.to = {
|
|
|
|
type = "path";
|
|
|
|
path = inputs.nixpkgs;
|
|
|
|
};
|
|
|
|
self.to = {
|
|
|
|
type = "path";
|
|
|
|
path = inputs.self;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
# explicitly set nix-path, NIX_PATH to nixpkgs from system registry
|
|
|
|
settings.nix-path = [ "nixpkgs=flake:nixpkgs" ];
|
|
|
|
nixPath = config.nix.settings.nix-path;
|
2021-03-04 10:56:14 +01:00
|
|
|
|
2024-08-11 12:05:42 +10:00
|
|
|
gc.automatic = pkgs.lib.mkDefault true;
|
2023-09-07 12:47:33 +10:00
|
|
|
gc.options = pkgs.lib.mkDefault "--delete-older-than 14d";
|
2021-03-04 10:56:14 +01:00
|
|
|
};
|
|
|
|
}
|