aboutsummaryrefslogtreecommitdiff
path: root/scripts/update_flake
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 01:35:06 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2023-10-04 02:11:48 +0200
commit1a64deeb894dc95e2645a75771732c6cc53a79ad (patch)
tree1b9df4838f894577a09b9b260151756272efeb53 /scripts/update_flake
parentfa25ffd4583cc362075cd5e1b4130f33306103f0 (diff)
downloadNix-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-xscripts/update_flake18
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
3searched_file="$1"
4
5get_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
11find 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
18done