-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ inputs | ||
, nyxUtils | ||
, prev | ||
, final | ||
, ... | ||
}: | ||
let | ||
src = builtins.fromJSON (builtins.readFile ./src.json); | ||
zig-wayland = final.fetchFromGitHub { | ||
owner = "ifreund"; | ||
repo = "zig-wayland"; | ||
inherit (src.zig-wayland) rev hash; | ||
}; | ||
zig-pixman = final.fetchFromGitHub { | ||
owner = "ifreund"; | ||
repo = "zig-pixman"; | ||
inherit (src.zig-pixman) rev hash; | ||
}; | ||
zig-xkbcommon = final.fetchFromGitHub { | ||
owner = "ifreund"; | ||
repo = "zig-xkbcommon"; | ||
inherit (src.zig-xkbcommon) rev hash; | ||
}; | ||
zig-wlroots = final.fetchFromGitHub { | ||
owner = "swaywm"; | ||
repo = "zig-wlroots"; | ||
inherit (src.zig-wlroots) rev hash; | ||
}; | ||
in | ||
prev.river.overrideAttrs (prevAttrs: rec { | ||
version = nyxUtils.gitToVersion src; | ||
src = inputs.river-git-src; | ||
postUnpack = '' | ||
cp -R --no-preserve=mode,ownership ${zig-wayland}/* source/deps/zig-wayland | ||
cp -R --no-preserve=mode,ownership ${zig-pixman}/* source/deps/zig-pixman | ||
cp -R --no-preserve=mode,ownership ${zig-xkbcommon}/* source/deps/zig-xkbcommon | ||
cp -R --no-preserve=mode,ownership ${zig-wlroots}/* source/deps/zig-wlroots | ||
patchShebangs source | ||
''; | ||
passthru.updateScript = ./update.sh; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"zig-wayland": { | ||
"rev": "d507189f623507981f4f5b6a0f8b21b12b9c07e4", | ||
"hash": "sha256-IAbZj4WwFE37f2kpnS4aMfpfN4OA34LCciF1MGPDZdk=" | ||
}, | ||
"zig-pixman": { | ||
"rev": "4a49ba13eb9ebb0c0f991de924328e3d615bf283", | ||
"hash": "sha256-2iuK2DVu5w29eDHnlVyWt4d6as6gjVqhg+1/TxRmkZ8=" | ||
}, | ||
"zig-xkbcommon": { | ||
"rev": "bfd1f97c277c32fddb77dee45979d2f472595d19", | ||
"hash": "sha256-2fEMbN86alYN6JLRVL/0dbgp/Qo5M3uXKc5RGIUGGC4=" | ||
}, | ||
"zig-wlroots": { | ||
"rev": "d6c070a9efa600d313eacd784689faaeb1165422", | ||
"hash": "sha256-IfS7m4PQBMobzvUNf1dJ6qu4qFDtrBi8C5tk0EP5CV8=" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p busybox curl jq moreutils nix-prefetch-git | ||
set -eo pipefail | ||
|
||
# Define the file path | ||
json_file=./src.json | ||
|
||
# Define the repository information | ||
repositories=( | ||
"ifreund/zig-wayland" | ||
"ifreund/zig-pixman" | ||
"ifreund/zig-xkbcommon" | ||
"swaywm/zig-wlroots" | ||
) | ||
|
||
# Loop through repositories | ||
for repo_info in "${repositories[@]}"; do | ||
# Split repository information into name and URL | ||
IFS='/' read -ra repo <<< "$repo_info" | ||
repo_name=${repo[1]} | ||
|
||
# Fetch repository information | ||
repo_data=$(nix-prefetch-git https://github.com/$repo_info --quiet) | ||
repo_rev=$(jq -r '.rev' <<< "$repo_data") | ||
repo_hash=$(nix-hash --type sha256 --to-sri $(jq -r '.sha256' <<< "$repo_data")) | ||
|
||
# Update JSON file using jq | ||
jq --arg name "$repo_name" --arg rev "$repo_rev" --arg hash "$repo_hash" \ | ||
'.[$name] = { "rev": $rev, "hash": $hash }' "$json_file" | sponge "$json_file" | ||
done |