diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /scripts/update_flake | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'scripts/update_flake')
-rwxr-xr-x | scripts/update_flake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/update_flake b/scripts/update_flake new file mode 100755 index 0000000..3a9cd17 --- /dev/null +++ b/scripts/update_flake | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | searched_file="$1" | ||
4 | |||
5 | get_inputs() { | ||
6 | flake=$1 | ||
7 | name=$2 | ||
8 | cat "$flake" | jq -r --arg name "$name" '.nodes|to_entries[]|select(.value.original.path != null and (.value.original.path|test("(../)+" + $name)))|.key' | ||
9 | } | ||
10 | |||
11 | find flakes -name "flake.lock" | while read flake; do | ||
12 | for input in $(get_inputs "$flake" "$searched_file"); do | ||
13 | echo "updating $input in $(dirname "$flake")" | ||
14 | pushd "$(dirname "$flake")" >/dev/null 2>/dev/null | ||
15 | nix flake update --update-input "$input" | ||
16 | popd >/dev/null 2>/dev/null | ||
17 | done | ||
18 | done | ||