Skip to content

Commit 13ac013

Browse files
committed
nixosTests/diskoInstallMenu: overwrite flake trying to avoid rebuilds on insignificant changes
1 parent e4b0dd5 commit 13ac013

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

nix/checks/nixosTests/diskoInstallMenu.nix

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
{
22
inputs,
3+
lib,
34
self,
45
...
56
}:
7+
let
8+
inherit (builtins) mapAttrs;
9+
inherit (lib.trivial) flip;
10+
11+
# overwrite nixosConfigurations
12+
modifiedConfigs = flip mapAttrs self.nixosConfigurations (
13+
_: cfg:
14+
cfg.extendModules {
15+
modules = [
16+
self.modules.nixos.flakeSuppressRevision # avoid rebuilds after unrelated changes
17+
];
18+
}
19+
);
20+
modifiedSelf = self // {
21+
nixosConfigurations = modifiedConfigs;
22+
outputs = self.outputs // {
23+
nixosConfigurations = modifiedConfigs;
24+
};
25+
};
26+
in
627
{
728
_class = "flake";
829
perSystem =
@@ -12,6 +33,7 @@
1233

1334
# similar to disko-install-menu.checks.SYSTEM.offineBuilds-*
1435
# (TODO in disko-install-menu, export test framework & use here)
36+
# TODO still rebuilds on unsignificant changes, fix that
1537
diskoOfflineInstall = pkgs.testers.runNixOSTest {
1638
name = "diskoOfflineInstall";
1739
# similar as above: allow customizations with overlays
@@ -23,12 +45,14 @@
2345
enable = true;
2446
offlineCapable = true;
2547
options = {
26-
defaultFlake = "${self}";
48+
# should not be used on --debug-test-build
49+
# & fixed to avoid rebuilds after unrelated changes
50+
defaultFlake = "/non-existing/path_to/flake";
2751
defaultHost = "empty";
2852
};
2953
listedFlakes.defaultFlake = {
3054
offlineHosts.empty = true;
31-
offlineReference = self;
55+
offlineReference = modifiedSelf;
3256
};
3357
};
3458
virtualisation = {

0 commit comments

Comments
 (0)