1
0
Fork 0
nix-configuration/modules/base/nix.nix

58 lines
1.4 KiB
Nix
Raw Normal View History

2024-05-01 09:35:38 -04:00
# Nix configuration
{
pkgs,
config,
lib,
inputs,
...
}:
{
nix = {
settings = {
# Enable Flakes
experimental-features = [
"nix-command"
"flakes"
];
2024-05-01 09:35:38 -04:00
# Use Lix instead of Nix
extra-substituters = [ "https://cache.lix.systems" ];
trusted-public-keys = [ "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o=" ];
2024-05-06 08:38:54 -04:00
# Avoid signature verification messages when doing remote builds
trusted-users = [ "${config.users.users.aires.name}" ];
};
2024-05-01 09:35:38 -04:00
# Enable periodic nix store optimization
optimise.automatic = true;
2024-05-01 09:35:38 -04:00
# Configure NixOS to use the same software channel as Flakes
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
2024-05-01 09:35:38 -04:00
# Configure remote build machines (mainly Haven)
# To enable remote builds for a specific host, add `nix.distributedBuilds = true;` to its config
buildMachines = [
{
hostName = "haven";
systems = [
"x86_64-linux"
"aarch64-linux"
];
protocol = "ssh-ng";
supportedFeatures = [
"nixos-test"
"kvm"
"benchmark"
"big-parllel"
];
}
];
2024-05-01 09:35:38 -04:00
# When using a builder, use its package store
extraOptions = ''
builders-use-substitutes = true
'';
};
2024-05-06 14:34:29 -04:00
}