Refactor libdemo and flakeref for nix run commands
[?]
Mar 23, 2023, 9:12 PM
W2G433QU3JDG72JL6GYR6E5HMAHFP3OF2DLFB3O42245XTE6VGZQCDependencies
- [2]
55PCHITPClean up libdemo - [3]
VT7F3Q7QClean up libdemo - [4]
VUARRVTIClean up strings - [5]
YWKMJUZSAdd 06-windows-wine - [6]
Z6QMMUR5Use nix run for pygments - [7]
X3HISPCSAdd 05-static-container - [8]
JGZ7GBCLAdd linting - [9]
NYO63G7WUse demonote - [10]
5LP7FPFXFix CI - [11]
HCY72TQRImprove linting - [12]
VMUKZQZRWork on 02-nix-build - [13]
PO6SMI7OReduce dependency of libdemo on Nix - [14]
P34QQPLUPin shellcheck / pygmentize - [15]
7QIEZSZIAdd tiv - [16]
EGQ4SEV5Add demo for 04 - [17]
M5U5PAX7Add wrapper script, improve libdemo - [18]
VXZ5QMIEFix CI - [19]
OB2MOPJ6Update 02 - [20]
TEQJC3HXAdd 03-nix-container - [21]
7AUC4NKIInitial commit - [22]
Q6IC7LVGTweak libdemo - [23]
SNO57YN4Move libdemo and fix linting - [24]
WK2OO4YYTweak 04 - [25]
ZFMPQAFVFix and extend cross compilation with static builds
Change contents
- edit in libdemo/libdemo.sh at line 206[7.465]→[7.2333:2359](∅→∅),[7.2359]→[2.1221:1259](∅→∅),[2.1259]→[7.7:120](∅→∅),[7.2387]→[7.7:120](∅→∅),[7.120]→[6.5:126](∅→∅),[6.126]→[7.253:303](∅→∅),[7.191]→[7.253:303](∅→∅),[7.253]→[7.253:303](∅→∅),[7.303]→[2.1260:1313](∅→∅),[2.1313]→[7.335:444](∅→∅),[7.335]→[7.335:444](∅→∅),[7.444]→[7.2584:2597](∅→∅),[7.2584]→[7.2584:2597](∅→∅),[7.2597]→[7.271:345](∅→∅),[7.345]→[7.2597:2618](∅→∅),[7.2597]→[7.2597:2618](∅→∅),[7.2618]→[7.346:357](∅→∅)
}pygmentize() {if __libdemo_use_colour; thenif type nix >/dev/null; then# Hack around missing mainProgram attribute in pygmentsCOLORTERM="" TERM="" nix run github:sfrijters/nixpkgs/pygments-mainprogram#python3Packages.pygments "$@"elif type pygmentize >/dev/null; thenCOLORTERM="" TERM="" pygmentize "$@"elseecho "pygmentize command not found"return 1fielsewhile [ $# -gt 1 ]; doshiftdonecat "$@"fi - edit in libdemo/libdemo.sh at line 207[7.3605]→[7.4:17](∅→∅),[7.17]→[2.1314:1352](∅→∅),[2.1352]→[7.45:334](∅→∅),[7.45]→[7.45:334](∅→∅),[7.334]→[3.224:306](∅→∅),[3.306]→[7.334:351](∅→∅),[7.334]→[7.334:351](∅→∅)
tiv() {if __libdemo_use_colour; thenif type nix > /dev/null; thennix run github:sfrijters/nixpkgs/tiv-add-wrapper#tiv -- "$@"elif type tiv >/dev/null; thentiv "$@"elseecho "tiv command not found"return 1fielseecho "no colour output available, use your imagination!"fi} - replacement in demo-full.sh at line 5
source "$(dirname "${BASH_SOURCE[0]}")/libdemo/libdemo.sh"source "$(dirname "${BASH_SOURCE[0]}")/bash/nix-container-demo-helper.sh" - replacement in demo-full.sh at line 8
local -r shellcheck_cmd="nix run github:nixos/nixpkgs/008ce261a7e3c532e792cb8e39482f2cc1b192f5#shellcheck -- -S style -x"local -r shellcheck_cmd="nix run ${NIXPKGS_FLAKEREF}#shellcheck -- -S style -x" - replacement in demo-full.sh at line 11
echo "$(dirname "${BASH_SOURCE[0]}")/libdemo/libdemo.sh"${shellcheck_cmd} "$(dirname "${BASH_SOURCE[0]}")/libdemo/libdemo.sh" || return 1echo "$(dirname "${BASH_SOURCE[0]}")/bash/nix-container-demo-helper.sh"${shellcheck_cmd} "$(dirname "${BASH_SOURCE[0]}")/bash/nix-container-demo-helper.sh" || return 1 - file addition: bash[7.2]
- file addition: nix-container-demo-helper.sh[0.350]
# -*- sh-shell: bash -*-# shellcheck shell=bashif [ -z ${_NIX_CONTAINER_DEMO_HELPER_INC+x} ]; then_NIX_CONTAINER_DEMO_HELPER_INC=truesource "$(dirname "${BASH_SOURCE[0]}")/../libdemo/libdemo.sh"export NIXPKGS_FLAKEREF=github:nixos/nixpkgs/008ce261a7e3c532e792cb8e39482f2cc1b192f5pygmentize() {if __libdemo_use_colour; thenif type nix >/dev/null; then# Hack around missing mainProgram attribute in pygments# TODO: use nixpkgs_flakeref when this fix is mergedCOLORTERM="" TERM="" nix run github:sfrijters/nixpkgs/pygments-mainprogram#python3Packages.pygments -- "$@"elif type pygmentize >/dev/null; thenCOLORTERM="" TERM="" pygmentize "$@"elseecho "pygmentize command not found"return 1fielsewhile [ $# -gt 1 ]; doshiftdonecat "$@"fi}tiv() {if __libdemo_use_colour; thenif type nix > /dev/null; then# Hack around missing imagemagick# TODO: use nixpkgs_flakeref when this fix is mergednix run github:sfrijters/nixpkgs/tiv-add-wrapper#tiv -- "$@"elif type tiv >/dev/null; thentiv "$@"elseecho "tiv command not found"return 1fielseecho "no colour output available, use your imagination!"fi}file() {if type nix > /dev/null; thennix run "${NIXPKGS_FLAKEREF}#file" -- "$@"elif type file >/dev/null; thenfile "$@"elseecho "file command not found"return 1fi}fi - replacement in 06-windows-wine/demo.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - edit in 06-windows-wine/demo.sh at line 9
file_cmd="nix run github:nixos/nixpkgs/008ce261a7e3c532e792cb8e39482f2cc1b192f5#file" - replacement in 06-windows-wine/demo.sh at line 22
x nix build "${dir}#mingwW64" -Lx nix build "${dir}#mingwW64" - replacement in 06-windows-wine/demo.sh at line 25
x "${file_cmd}" ./result/bin/wttr-delft.exex file ./result/bin/wttr-delft.exe - replacement in 06-windows-wine/demo.sh at line 28
x "WINEPREFIX=$(readlink -f "${dir}/wttr-delft") nix run github:nixos/nixpkgs/008ce261a7e3c532e792cb8e39482f2cc1b192f5#wine64 -- ./result/bin/wttr-delft.exe"[5.414475]x "WINEPREFIX=$(readlink -f "${dir}/wttr-delft") nix run ${NIXPKGS_FLAKEREF}#wine64 -- ./result/bin/wttr-delft.exe" - replacement in 05-static-container/demo.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 05-static-container/demo-inside-nix-develop.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - edit in 04-cmake-and-cross/demo.sh at line 6
source "${dir}/../libdemo/libdemo.sh" - replacement in 04-cmake-and-cross/demo.sh at line 7
file_cmd="nix run github:nixos/nixpkgs/008ce261a7e3c532e792cb8e39482f2cc1b192f5#file"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 04-cmake-and-cross/demo.sh at line 26
x "${file_cmd}" ./result/bin/wttr-delftx file ./result/bin/wttr-delft - replacement in 04-cmake-and-cross/demo.sh at line 36
x "${file_cmd}" ./result/bin/wttr-delftx file ./result/bin/wttr-delft - replacement in 04-cmake-and-cross/demo.sh at line 42
x "${file_cmd}" ./result/bin/wttr-delftx file ./result/bin/wttr-delft - replacement in 04-cmake-and-cross/demo.sh at line 48
x "${file_cmd}" ./result/bin/wttr-delftx file ./result/bin/wttr-delft - replacement in 04-cmake-and-cross/demo.sh at line 59
x "${file_cmd}" ./result/bin/wttr-delftx file ./result/bin/wttr-delft - replacement in 03-nix-container/demo.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 03-nix-container/demo-inside-nix-develop.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 02-nix-build/demo.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 02-nix-build/demo-inside-nix-develop.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 01-nix-run/demo.sh at line 7
source "${dir}/../libdemo/libdemo.sh"source "${dir}/../bash/nix-container-demo-helper.sh" - replacement in 01-nix-run/demo.sh at line 12
i nix run nixpkgs#curl -- wttr.in/Delfti "nix run nixpkgs#curl -- wttr.in/Delft" - replacement in 01-nix-run/demo.sh at line 17
x type curlx "type curl" - replacement in 01-nix-run/demo.sh at line 20
f type cowsayx nix run github:nixos/nixpkgs/008ce261a7e3c532e792cb8e39482f2cc1b192f5#cowsay -- -f tux hellof "type cowsay"x "nix run ${NIXPKGS_FLAKEREF}#cowsay -- -f tux hello"