From 4c4634bbcb299248efe300b37d1624649fd59477 Mon Sep 17 00:00:00 2001 From: matthewcroughan Date: Thu, 14 Dec 2023 13:51:55 +0000 Subject: [PATCH] make-disk-image: allow extra dependencies to be passed into image builder --- lib/make-disk-image.nix | 2 +- module.nix | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index 39827e3..572a9ef 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -27,7 +27,7 @@ let systemdMinimal nix util-linux - ]; + ] ++ nixosConfig.config.disko.extraDependencies; preVM = '' ${lib.concatMapStringsSep "\n" (disk: "truncate -s ${disk.imageSize} ${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)} ''; diff --git a/module.nix b/module.nix index 2abe922..0c52892 100644 --- a/module.nix +++ b/module.nix @@ -29,6 +29,13 @@ in default = { }; description = "The devices to set up"; }; + extraDependencies = lib.mkOption { + type = lib.types.listOf lib.types.package; + description = '' + list of extra packages to make available in the make-disk-image.nix VM builder, an example might be f2fs-tools + ''; + default = []; + }; rootMountPoint = lib.mkOption { type = lib.types.str; default = "/mnt";