nixos/lib/qemu-flags: rename to qemu-common

The current name is misleading: it doesn't contain cli arguments,
but several constants and utility functions related to qemu.
This commit also removes the use of `with import ...` for clarity.
This commit is contained in:
rnhmjoj
2021-06-23 17:46:46 +02:00
parent b8bfc81d5b
commit b29c2f97c3
7 changed files with 29 additions and 27 deletions

View File

@@ -4,15 +4,14 @@
, # Ignored
config ? null
, # Nixpkgs, for qemu, lib and more
pkgs
pkgs, lib
, # !!! See comment about args in lib/modules.nix
specialArgs ? {}
, # NixOS configuration to add to the VMs
extraConfigurations ? []
}:
with pkgs.lib;
with import ../lib/qemu-flags.nix { inherit pkgs; };
with lib;
rec {
@@ -93,8 +92,9 @@ rec {
"${config.networking.hostName}\n"));
virtualisation.qemu.options =
flip concatMap interfacesNumbered
({ fst, snd }: qemuNICFlags snd fst m.snd);
let qemu-common = import ../lib/qemu-common.nix { inherit lib pkgs; };
in flip concatMap interfacesNumbered
({ fst, snd }: qemu-common.qemuNICFlags snd fst m.snd);
};
}
)