mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-06-05 21:25:22 +02:00

This is done by not depending on the flake itself, allowing the bits of a dirty tree to not affect the hash. This enables equivalence testing with `just eval-vm bob` and checking if the system closure hash changes or not.
40 lines
1008 B
Nix
40 lines
1008 B
Nix
{ lib, config, inputs, ... }:
|
|
{
|
|
nix = {
|
|
gc = {
|
|
automatic = true;
|
|
options = "--delete-older-than 2d";
|
|
};
|
|
optimise.automatic = true;
|
|
|
|
settings = {
|
|
allow-dirty = true;
|
|
builders-use-substitutes = true;
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
log-lines = 50;
|
|
use-xdg-base-directories = true;
|
|
};
|
|
|
|
/* This makes commandline tools like
|
|
** nix run nixpkgs#hello
|
|
** and nix-shell -p hello
|
|
** use the same channel the system
|
|
** was built with
|
|
*/
|
|
registry = lib.mkMerge [
|
|
{
|
|
"nixpkgs".flake = inputs.nixpkgs;
|
|
"nixpkgs-unstable".flake = inputs.nixpkgs-unstable;
|
|
}
|
|
# We avoid the reference to self in vmVariant to get a stable system .outPath for equivalence testing
|
|
(lib.mkIf (!config.virtualisation.isVmVariant) {
|
|
"pvv-nix".flake = inputs.self;
|
|
})
|
|
];
|
|
nixPath = [
|
|
"nixpkgs=${inputs.nixpkgs}"
|
|
"unstable=${inputs.nixpkgs-unstable}"
|
|
];
|
|
};
|
|
}
|