OB2MOPJ6NQDCF2OLLNHUR2JC4NQFNSNBRVFQJSF2USEI7ZMEX7HAC
h We can also just run the executable directly
x nix run "$(dirname "${BASH_SOURCE[0]}")"
h If we want to do development, we also get that \'for free\':
f type gcc
x nix develop --command "$(dirname "${BASH_SOURCE[0]}")/demo-inside-nix-develop.sh"
#!/usr/bin/env bash
# shellcheck disable=SC1010
set -Eeuo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/../bash/libdemo.sh"
h Now we do have gcc!
x type gcc
h But Nix does all sorts of clever things such as wrapping the compiler
x file "$(command -v gcc)"
h So that required libraries etc. are available
# shellcheck disable=SC2016
x eval 'echo "${NIX_LDFLAGS}"' \| grep -o --color=never -e \'\[^ \]*curl\[^ \]*\'
h And we can in fact do
x gcc -o "$(dirname "${BASH_SOURCE[0]}")/wttr-delft" -lcurl "$(dirname "${BASH_SOURCE[0]}")/../src/simple.c"
x ./wttr-delft
02-nix-build/wttr-delft