Switch impure mode to parameter

This commit is contained in:
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
```shell
nix-build
nix-build build.nix
ls -la ./result
```
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
win = (import ./default.nix { inherit pkgs; });
@ -25,7 +28,7 @@ win.makeWindowsImage {
};
# Build install script & skip building iso
impureMode = false;
inherit impureMode;
# impureShellCommands = [
# "powershell.exe echo Hello"

View File

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