mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
23 lines
357 B
Text
23 lines
357 B
Text
|
#! /usr/bin/perl -w
|
||
|
|
||
|
my $prefix = $ENV{"NIX"} || "/nix"; # !!! use prefix
|
||
|
my $linkdir = "$prefix/var/nix/links";
|
||
|
|
||
|
my %alive;
|
||
|
|
||
|
open HASHES, "nix closure \$(cat $linkdir/*.hash) |";
|
||
|
while (<HASHES>) {
|
||
|
chomp;
|
||
|
$alive{$_} = 1;
|
||
|
}
|
||
|
close HASHES;
|
||
|
|
||
|
open HASHES, "nix listinst |";
|
||
|
while (<HASHES>) {
|
||
|
chomp;
|
||
|
if (!$alive{$_}) {
|
||
|
print "$_\n";
|
||
|
}
|
||
|
}
|
||
|
close HASHES;
|