Switch impure mode to parameter

wfvm
adisbladis 2020-04-22 09:35:05 +01:00 committed by Stephan Maka
parent 895359eade
commit 34404ddf6b
3 changed files with 7 additions and 6 deletions

View File

@ -14,7 +14,7 @@ Results in a file called c.img
If in pure mode If in pure mode
```shell ```shell
nix-build nix-build build.nix
ls -la ./result ls -la ./result
``` ```
Results in a symlink to the image in the nix store Results in a symlink to the image in the nix store

View File

@ -1,4 +1,7 @@
{ pkgs ? import <nixpkgs> {} }: {
pkgs ? import <nixpkgs> {}
, impureMode ? false
}:
let let
win = (import ./default.nix { inherit pkgs; }); win = (import ./default.nix { inherit pkgs; });
@ -25,7 +28,7 @@ win.makeWindowsImage {
}; };
# Build install script & skip building iso # Build install script & skip building iso
impureMode = false; inherit impureMode;
# impureShellCommands = [ # impureShellCommands = [
# "powershell.exe echo Hello" # "powershell.exe echo Hello"

View File

@ -12,9 +12,7 @@
let let
# qemu_test is a smaller closure only building for a single system arch # qemu_test is a smaller closure only building for a single system arch
qemu = pkgs.qemu_test; qemu = pkgs.qemu_test;
libguestfs = pkgs.libguestfs-with-appliance.override { libguestfs = pkgs.libguestfs-with-appliance;
inherit qemu;
};
runQemuCommand = name: command: ( runQemuCommand = name: command: (
pkgs.runCommandNoCC name { buildInputs = [ pkgs.p7zip qemu libguestfs ]; } pkgs.runCommandNoCC name { buildInputs = [ pkgs.p7zip qemu libguestfs ]; }