diff options
Diffstat (limited to 'src/nix-addroot')
-rwxr-xr-x | src/nix-addroot | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nix-addroot b/src/nix-addroot new file mode 100755 index 000000000000..3ab9e8a252f8 --- /dev/null +++ b/src/nix-addroot @@ -0,0 +1,18 @@ +#! /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 |