2024-05-01 09:35:38 -04:00
|
|
|
# Nix configuration
|
|
|
|
{ pkgs, config, lib, inputs, ... }: {
|
|
|
|
nix = {
|
|
|
|
# Use the latest and greatest Nix
|
2024-05-02 17:24:11 -04:00
|
|
|
package = pkgs.nixVersions.latest;
|
2024-05-01 09:35:38 -04:00
|
|
|
|
|
|
|
settings = {
|
|
|
|
# Enables Flakes
|
|
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
|
|
|
# Avoid signature verification messages when doing remote builds
|
|
|
|
trusted-users = [ "${config.users.users.aires.name}" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Enable periodic nix store optimization
|
|
|
|
optimise.automatic = true;
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
|
|
|
# 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"
|
|
|
|
];
|
|
|
|
}];
|
|
|
|
|
|
|
|
# When using a builder, use its package store
|
|
|
|
extraOptions = ''
|
|
|
|
builders-use-substitutes = true
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|