albatros/hcl/nixcache/pin.sh
2023-03-24 17:04:19 +01:00

9 lines
235 B
Bash

#!/usr/bin/env bash
set -euxo pipefail
set -f # disable globbing
mkdir -p /nix/var/nix/gcroots/albatros
DRV_NAME=$(echo $DRV_PATH | cut -d '/' -f 4)
GCROOT=/nix/var/nix/gcroots/albatros/$DRV_NAME
rm -f $GCROOT
ln -s $DRV_PATH $GCROOT