mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
* nix-pack-closure: store the top-level store paths in the closure.
* nix-unpack-closure: extract the top-level paths from the closure and print them on stdout. This allows them to be installed, e.g., "nix-env -i $(nix-unpack-closure)". (NIX-64)
This commit is contained in:
parent
f25f900045
commit
afe23b5f38
5 changed files with 39 additions and 1 deletions
|
@ -21,6 +21,7 @@ mkdir "$tmpDir/contents", 0777 or die;
|
|||
mkdir "$tmpDir/references", 0777 or die;
|
||||
mkdir "$tmpDir/derivers", 0777 or die;
|
||||
|
||||
open TOPLEVEL, ">$tmpDir/top-level" or die;
|
||||
|
||||
|
||||
my %storePaths;
|
||||
|
@ -29,6 +30,12 @@ my %storePaths;
|
|||
while (@ARGV) {
|
||||
my $storePath = shift @ARGV;
|
||||
|
||||
# $storePath might be a symlink to the store, so resolve it.
|
||||
$storePath = (`$binDir/nix-store --query --resolve '$storePath'`
|
||||
or die "cannot resolve `$storePath'");
|
||||
chomp $storePath;
|
||||
print TOPLEVEL $storePath, "\n";
|
||||
|
||||
# Get the closure of this path.
|
||||
my $pid = open(READ,
|
||||
"$binDir/nix-store --query --requisites '$storePath'|") or die;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue