diff options
Diffstat (limited to 'src/nix-activate')
-rwxr-xr-x | src/nix-activate | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nix-activate b/src/nix-activate new file mode 100755 index 000000000000..9fe6466866df --- /dev/null +++ b/src/nix-activate @@ -0,0 +1,22 @@ +#! /usr/bin/perl -w + +use strict; + +my $pkglist = "/home/eelco/.nixactivations"; + +if (!-f $pkglist) { + system "touch $pkglist"; +} + +my $hash; +foreach $hash (@ARGV) { + system "grep -q $hash $pkglist"; + if ($?) { + print STDERR "activating $hash\n"; + system "nix getpkg $hash > /dev/null"; + if ($?) { die "`nix getpkg' failed"; } + system "echo $hash >> $pkglist"; + } +} + +system "nix-populate"; |