Fix the way source code is fetched for matrix-media-repo

This commit is contained in:
Charlotte 🦝 Delenk 2022-06-12 14:50:04 +01:00
parent 2c044834ca
commit 5353ee4314
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
3 changed files with 15 additions and 1 deletions

View file

@ -5,7 +5,7 @@ in {
matrix-media-repo = buildGoApplication rec {
pname = "matrix-media-repo";
version = inputs.matrix-media-repo.lastModifiedDate;
src = inputs.matrix-media-repo;
src = pkgs.callPackage ./source.nix {};
patches = [
./async-media.patch
];

View file

@ -0,0 +1,6 @@
{fetchgit}:
fetchgit {
url = "https://github.com/turt2live/matrix-media-repo";
revision = "3184dbc7720fc103aaf4704be894eac69535e887";
sha256 = "1j6y7alr60mmj5h014qmpz9a5qjv8cm61andwdacb0dqjjbvsm0z";
}

View file

@ -18,5 +18,13 @@ JSON=$(nix-prefetch-git --url "$URL" --rev "$REVISION" 2> $WORK_DIR/nix-prefetc
SHA=$(echo $JSON | jq -r .sha256)
SOURCE_DIR=$(grep '^path is' $WORK_DIR/nix-prefetch-git.out | sed 's/^path is //')
cat > source.nix << EOF
{ fetchgit }: fetchgit {
url = "$URL";
revision = "$REVISION";
sha256 = "$SHA";
}
EOF
echo "Creating gomod2nix.toml"
nix run github:tweag/gomod2nix -- -dir $SOURCE_DIR -outdir $TARGET_DIR