layers: add collapseLayers

This commit is contained in:
Astro 2021-04-10 23:12:13 +02:00
parent 78c9363b64
commit 4771cee64b
2 changed files with 16 additions and 1 deletions

View File

@ -41,7 +41,11 @@ wfvm.makeWindowsImage {
if impureMode
then []
else with wfvm.layers; [
disable-autosleep disable-autolock disable-firewall
(collapseLayers [
disable-autosleep
disable-autolock
disable-firewall
])
anaconda3 msys2 msvc msvc-ide-unbreak
];

View File

@ -154,4 +154,15 @@ in
win-exec "reg add HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Personalization /v NoLockScreen /t REG_DWORD /d 1"
'';
};
# Chain together layers that are quick to run so that the VM does
# not have to be started/shutdown for each.
collapseLayers = scripts: {
name = pkgs.lib.concatMapStringsSep "-" ({ name, ... }: name) scripts;
script = builtins.concatStringsSep "\n" (
map ({ script, ... }: script) scripts
);
buildInputs =
builtins.concatMap ({ buildInputs ? [], ... }: buildInputs) scripts;
};
}