-configuration_file: { pkgs ? import <nixpkgs> {}, system ? builtins.currentSystem, myEnv, ... }:
+configuration_file: { pkgs, myEnv, nixpkgs, environment, pkgs-no-overlay, ... }:
let
- config = (import <nixpkgs/nixos/lib/eval-config.nix> {
- inherit system;
+ config = (import (nixpkgs + "/nixos/lib/eval-config.nix") {
+ inherit (pkgs) system;
modules = [ {
+ _module.args.environment = environment;
myEnv = myEnv;
- imports = [ configuration_file ];
+ imports = [
+ (nixpkgs + "/nixos/modules/profiles/qemu-guest.nix")
+ configuration_file
+ ];
# We want our template image to be as small as possible, but the deployed image should be able to be
# of any size. Hence we resize on the first boot.
};
} ];
}).config;
-in pkgs.vmTools.runInLinuxVM (
+in pkgs-no-overlay.vmTools.runInLinuxVM (
pkgs.runCommand "nixos-base-image"
{
memSize = 768;
''
mkdir $out
diskImage=image.qcow2
- ${pkgs.vmTools.qemu}/bin/qemu-img create -f qcow2 $diskImage 2G
+ ${pkgs-no-overlay.vmTools.qemu}/bin/qemu-img create -f qcow2 $diskImage 2G
mv closure xchg/
'';
postVM =
''
echo compressing VM image...
- ${pkgs.vmTools.qemu}/bin/qemu-img convert -c $diskImage -O qcow2 $out/nixos.qcow2
+ ${pkgs-no-overlay.vmTools.qemu}/bin/qemu-img convert -c $diskImage -O qcow2 $out/nixos.qcow2
'';
buildInputs = [ pkgs.utillinux pkgs.perl pkgs.parted pkgs.e2fsprogs ];
exportReferencesGraph =