АБ
Size: a a a
АБ
AN
АБ
АБ
nix-shell -p nixFlakes
должно хватить для того, чтобы оно работалоАБ
АБ
AN
АБ
AN
AN
АБ
АЕ
АЕ
АЕ
АЕ
АБ
АЕ
АБ
#!/usr/bin/env nix-shell
#!nix-shell -p jq -i bash
# Usage: niv2flake.sh [sources.json file
set -euo pipefail
if [[ ! -z ${1:-} ]]; then
NIV="$1"
shift
else
if [[ -t 0 ]]; then
NIV=nix/sources.json
else
NIV=/proc/self/fd/0
fi
fi
jq '.[] |= if .type == "git"
then { type: "git", url: .url }
else if .type == "file"
then { type: "file", url: .url }
else if .type == "tarball" then
if .owner != null
then { url: ("github:" + .owner + "/" + .repo + "/" + .branch) }
else { type: "file", url: .url } end
else . end end end' "$NIV" | nix eval --impure --expr "(builtins.fromJSON (builtins.readFile /proc/self/fd/0))" | nixfmt
АЕ
АБ
nix/sources.json
и вставь вывод в поле inputs
твоего flake.nix