1
0
Fork 0
dotfiles/bins/scripts/calculate-nix-path

9 lines
305 B
Plaintext
Raw Normal View History

2022-01-05 09:52:59 +00:00
#!/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"