Merge pull request #191 from foo-dogsquared/nixosGenerate-add-lib-parameter

This commit is contained in:
Lassulus 2022-11-21 22:14:40 +01:00 committed by GitHub
commit 50aeec40f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,12 +26,13 @@
# format = "vmware";
# };
# }
nixosGenerate = { pkgs ? null, format, system ? null, specialArgs ? { }, modules ? [ ] }:
nixosGenerate = { pkgs ? null, lib ? nixpkgs.lib, format, system ? null, specialArgs ? { }, modules ? [ ] }:
let
formatModule = builtins.getAttr format nixosModules;
image = nixpkgs.lib.nixosSystem {
inherit pkgs specialArgs;
system = if system != null then system else pkgs.system;
lib = if lib != null then lib else pkgs.lib;
modules = [
formatModule
] ++ modules;