Nix/src/nix-addroot

19 lines
291 B
Bash
Executable File

#! /bin/sh
ROOTLIST=~/.nixroots
if ! test -f $ROOTLIST; then
touch $ROOTLIST
fi
for i in $*; do
if nix ensure $i > /dev/null; then
if grep -q $i $ROOTLIST; then
echo $i already is a root
else
echo adding root $i
echo $i >> $ROOTLIST
fi
fi
done