mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
make-disk-image: Add additionalPaths argument
Add an argument which makes it possible to add additional paths to the image's nix store.
This commit is contained in:
parent
398a73ac98
commit
87d8eec069
1 changed files with 13 additions and 1 deletions
|
@ -70,6 +70,9 @@
|
|||
# utils, but changes the hash of the image when the sources are
|
||||
# updated.
|
||||
copyChannel ? true
|
||||
|
||||
, # Additional store paths to copy to the image's store.
|
||||
additionalPaths ? []
|
||||
}:
|
||||
|
||||
assert partitionTableType == "legacy" || partitionTableType == "legacy+gpt" || partitionTableType == "efi" || partitionTableType == "hybrid" || partitionTableType == "none";
|
||||
|
@ -172,8 +175,13 @@ let format' = format; in let
|
|||
users = map (x: x.user or "''") contents;
|
||||
groups = map (x: x.group or "''") contents;
|
||||
|
||||
basePaths = [ config.system.build.toplevel ]
|
||||
++ lib.optional copyChannel channelSources;
|
||||
|
||||
additionalPaths' = subtractLists basePaths additionalPaths;
|
||||
|
||||
closureInfo = pkgs.closureInfo {
|
||||
rootPaths = [ config.system.build.toplevel ] ++ (lib.optional copyChannel channelSources);
|
||||
rootPaths = basePaths ++ additionalPaths';
|
||||
};
|
||||
|
||||
blockSize = toString (4 * 1024); # ext4fs block size (not block device sector size)
|
||||
|
@ -266,6 +274,10 @@ let format' = format; in let
|
|||
${if copyChannel then "--channel ${channelSources}" else "--no-channel-copy"} \
|
||||
--substituters ""
|
||||
|
||||
${optionalString (additionalPaths' != []) ''
|
||||
nix copy --to $root --no-check-sigs ${concatStringsSep " " additionalPaths'}
|
||||
''}
|
||||
|
||||
diskImage=nixos.raw
|
||||
|
||||
${if diskSize == "auto" then ''
|
||||
|
|
Loading…
Reference in a new issue