0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

nixos/image: add image.repart.package option

Allow giving a custom package containing the `systemd-repart` binary.
Defaults to `pkgs.systemd`. This option opens up the possibility to use
a different package for the image builder and the system configuration.

For example, someone could use this option to build an image with a
patched systemd while still using the upstream nixpkgs systemd package
(i.e., `pkgs.systemd`) for the system configuration installed to the
created image.
This commit is contained in:
Vincent Haupert 2023-08-04 13:32:45 +02:00
parent bf4d2e6c1e
commit f652755434

View file

@ -88,6 +88,13 @@ in
'';
};
package = lib.mkPackageOption pkgs "systemd-repart" {
default = "systemd";
example = lib.literalExpression ''
pkgs.systemdMinimal.override { withCryptsetup = true; }
'';
};
partitions = lib.mkOption {
type = with lib.types; attrsOf (submodule partitionOptions);
default = { };
@ -178,9 +185,9 @@ in
in
pkgs.runCommand cfg.name
{
nativeBuildInputs = with pkgs; [
fakeroot
systemd
nativeBuildInputs = [
cfg.package
pkgs.fakeroot
] ++ fileSystemTools;
} ''
amendedRepartDefinitions=$(${amendRepartDefinitions} ${partitions} ${definitionsDirectory})