Merge pull request 'speed up machine_flake eval' (#252) from Mic92-main into main

This commit is contained in:
clan-bot
2023-09-06 14:08:15 +00:00
4 changed files with 7 additions and 4 deletions

2
.gitignore vendored
View File

@@ -1,6 +1,6 @@
.direnv .direnv
result* result*
pkgs/clan-cli/clan_cli/nixpkgs pkgs/clan-cli/clan_cli/deps_flake
pkgs/clan-cli/clan_cli/webui/assets pkgs/clan-cli/clan_cli/webui/assets
# python # python

View File

@@ -48,6 +48,4 @@ def machine_flake(monkeymodule: pytest.MonkeyPatch) -> Generator[Path, None, Non
) )
# check that an empty config is returned if no json file exists # check that an empty config is returned if no json file exists
monkeymodule.chdir(flake) monkeymodule.chdir(flake)
# monkeypatch get_clan_flake_toplevel to return the flake
monkeymodule.setattr("clan_cli.dirs.get_clan_flake_toplevel", lambda: flake)
yield flake yield flake

View File

@@ -11,7 +11,12 @@
(if builtins.pathExists ./machines/machine1.json (if builtins.pathExists ./machines/machine1.json
then builtins.fromJSON (builtins.readFile ./machines/machine1.json) then builtins.fromJSON (builtins.readFile ./machines/machine1.json)
else { }) else { })
{ nixpkgs.hostPlatform = "x86_64-linux"; } {
nixpkgs.hostPlatform = "x86_64-linux";
# speed up by not instantiating nixpkgs twice and disable documentation
nixpkgs.pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
documentation.enable = false;
}
]; ];
}; };
}; };