nixos-build-vms: move to pkgs/by-name

This commit is contained in:
K900 2024-09-19 20:07:14 +03:00
parent 1bf0ffb22e
commit 8353a681b5
5 changed files with 29 additions and 10 deletions

View File

@ -17,12 +17,7 @@ let
''; '';
}); });
nixos-build-vms = makeProg { inherit (pkgs) nixos-build-vms;
name = "nixos-build-vms";
src = ./nixos-build-vms/nixos-build-vms.sh;
inherit (pkgs) runtimeShell;
manPage = ./manpages/nixos-build-vms.8;
};
nixos-install = makeProg { nixos-install = makeProg {
name = "nixos-install"; name = "nixos-install";

View File

@ -1,5 +1,6 @@
{ system ? builtins.currentSystem { system ? builtins.currentSystem
, config ? {} , config ? {}
, nixpkgs
, networkExpr , networkExpr
}: }:
@ -9,9 +10,9 @@ let
imports = [ module ]; imports = [ module ];
}) (import networkExpr); }) (import networkExpr);
pkgs = import ../../../../.. { inherit system config; }; pkgs = import nixpkgs { inherit system config; };
testing = import ../../../../lib/testing-python.nix { testing = import "${pkgs.path}/nixos/lib/testing-python.nix" {
inherit system pkgs; inherit system pkgs;
}; };

View File

@ -49,5 +49,6 @@ then
fi fi
# Build a network of VMs # Build a network of VMs
nix-build '<nixpkgs/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix>' \ nix-build @buildVms@ \
--argstr networkExpr "$networkExpr" "${nixBuildArgs[@]}" --argstr networkExpr "$networkExpr" "${nixBuildArgs[@]}" \
--arg nixpkgs "<nixpkgs>"

View File

@ -0,0 +1,22 @@
{
substituteAll,
runtimeShell,
installShellFiles,
}:
substituteAll {
name = "nixos-build-vms";
src = ./nixos-build-vms.sh;
inherit runtimeShell;
buildVms = ./build-vms.nix;
dir = "bin";
isExecutable = true;
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installManPage ${./nixos-build-vms.8}
'';
meta.mainProgram = "nixos-build-vms";
}