Tweak --gcroots
[?]
Apr 3, 2023, 7:44 PM
U6EHWR7YKTWFC3OLM42N22EP6WUNLFJD5O62JSVWWIF4AUY7FNXACDependencies
- [2]
ZSVCCJBXFixes for CI - [3]
4A2DSMIMClean up nix-container-demo-helper.sh - [4]
HCY72TQRImprove linting - [5]
AG72J7RHAdd .gitlab-ci.yml - [6]
52F4Q6CJUpdate README - [7]
EINBKIWAUpdate README - [8]
W2G433QURefactor libdemo and flakeref for nix run commands - [9]
WNFTZY3MOptionally prevent relevant nix store paths from being GC'ed - [*]
M5U5PAX7Add wrapper script, improve libdemo - [*]
7AUC4NKIInitial commit
Change contents
- replacement in demo-full.sh at line 34
echo " -g|--gcroots: create Nix garbage collector roots for nix build/run/develop outputs"echo " -g|--gcroots <create|delete|recreate|print>: (re)create, delete, or print Nix garbage collector roots for nix build/run/develop outputs" - replacement in demo-full.sh at line 40
do_nix_make_gcroots=0nix_gcroots_action= - replacement in demo-full.sh at line 49
do_nix_make_gcroots=1if [ "${2:-}" = create ] || [ "${2:-}" = delete ] || [ "${2:-}" = recreate ] || [ "${2:-}" = print ]; thennix_gcroots_action=$2elseecho "Unknown or missing --gcroots option '$2'"exit 1fi - edit in demo-full.sh at line 56
shift - edit in demo-full.sh at line 80
do_nix_make_gcroots=0if [ "${nix_gcroots_action}" = delete ]; then__nix_clean_gcrootsexit 0elif [ "${nix_gcroots_action}" = print ]; then__nix_print_gcrootsexit 0elif [ "${nix_gcroots_action}" = recreate ]; then__nix_clean_gcrootsdo_nix_make_gcroots=1elif [ "${nix_gcroots_action}" = create ]; thendo_nix_make_gcroots=1fi - edit in demo-full.sh at line 94
if [ "${nix_gcroots_action}" = create ] || [ "${nix_gcroots_action}" = recreate ]; then__nix_print_gcrootsfi - edit in bash/nix-container-demo-helper.sh at line 32
__nix_gcroot_dir="/nix/var/nix/gcroots/per-user/${USER}"__nix_gcroot_prefix=nix-container-demo - replacement in bash/nix-container-demo-helper.sh at line 39
local -r gcroot="/nix/var/nix/gcroots/per-user/${USER}/nix-container-demo-$(basename "${storepath}")"local -r gcroot="${__nix_gcroot_dir}/${__nix_gcroot_prefix}-$(basename "${storepath}")" - edit in bash/nix-container-demo-helper.sh at line 42
}__nix_print_gcroots() {echo "Printing existing GC roots"find "${__nix_gcroot_dir}" -name "${__nix_gcroot_prefix}-*" -print | sed "s|${__nix_gcroot_dir}/||"}__nix_clean_gcroots() {echo "Removing existing GC roots"__nix_print_gcrootsfind "${__nix_gcroot_dir}" -name "${__nix_gcroot_prefix}-*" -delete - replacement in README.md at line 55
-g|--gcroots: create Nix garbage collector roots for nix build/run/develop outputs"-g|--gcroots <create|delete|recreate|print>: (re)create, delete, or print Nix garbage collector roots for nix build/run/develop outputs" - replacement in .gitlab-ci.yml at line 13[3.3074]→[2.451:522](∅→∅),[2.522]→[3.3146:3201](∅→∅),[3.3146]→[3.3146:3201](∅→∅),[3.3201]→[2.523:631](∅→∅)
- rm -f /nix/var/nix/gcroots/per-user/${USER}/nix-container-demo-*- CLICOLOR_FORCE=1 ./demo-full.sh --auto --gcroots- for f in $(ls -1dtr /nix/var/nix/gcroots/per-user/${USER}/nix-container-demo-*); do basename $f; done- CLICOLOR_FORCE=1 ./demo-full.sh --auto --gcroots recreate