Browse Source

layers: add collapseLayers

pull/10/head
Astro 8 months ago
parent
commit
4771cee64b
  1. 6
      wfvm/demo-image.nix
  2. 11
      wfvm/layers/default.nix

6
wfvm/demo-image.nix

@ -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
];

11
wfvm/layers/default.nix

@ -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;
};
}

Loading…
Cancel
Save