1
0
Fork 0
dotfiles/programs/scripts/calculate-nix-path
2022-01-05 11:34:31 +01:00

8 lines
305 B
Bash
Executable file

#!/bin/sh
mkdir -p "$HOME/.cache/fish"
nix flake metadata "$HOME/.config/nixpkgs" --json 2>/dev/null | \
jq -r '.locks.nodes.nixpkgs.locked | "\(.type):\(.owner)/\(.repo)/\(.rev)"' | \
xargs -I {} nix flake metadata {} --json | \
jq -r '. | "nixpkgs=\(.path)"' >"$HOME/.cache/fish/nix_path_value"