dotfiles/nixos/update-nixpkgs

22 lines
523 B
Plaintext
Raw Normal View History

2020-12-29 18:20:02 +01:00
#!/usr/bin/env bash
inputs=("nixpkgs" "nixpkgs-unstable" "nixpkgs-master")
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
cd "${SCRIPTPATH}"
inputs="$(for input in "${inputs[@]}"; do echo --update-input ${input} ; done)"
#nix flake update ${inputs}
2020-12-29 18:20:02 +01:00
bfs . -name "flake.nix" -print0 | perl -e 'print sort {$a=~s!/!/! <=> $b=~s!/!/!} <>' | while IFS= read -r -d '' flake
2020-12-29 18:20:02 +01:00
do
(
FLAKE_DIR="$(dirname "${flake}")"
echo "Updating ${FLAKE_DIR}"
2020-12-29 18:20:02 +01:00
cd "${FLAKE_DIR}"
nix flake update ${inputs}
2020-12-29 18:20:02 +01:00
)
done