prepare miifox-net for lfs
This commit is contained in:
parent
46032395d7
commit
02bd202b37
4 changed files with 47 additions and 2 deletions
|
@ -57,6 +57,14 @@ steps:
|
|||
- (cd python && bash ./update.sh)
|
||||
depends_on:
|
||||
- Update flake
|
||||
- name: Update miifox
|
||||
image: nixery.dev/shell/nix-prefetch-git/jq/gnugrep
|
||||
commands:
|
||||
- (cd web && bash ./update.sh)
|
||||
environment:
|
||||
USER: nobody
|
||||
depends_on:
|
||||
- Update flake
|
||||
- name: Format nix
|
||||
image: nixery.dev/shell/alejandra
|
||||
commands:
|
||||
|
@ -68,6 +76,7 @@ steps:
|
|||
- Update mautrix-whatsapp
|
||||
- Update art
|
||||
- Update pypi
|
||||
- Update miifox
|
||||
- name: Push git
|
||||
image: nixery.dev/shell/gitfull/git-lfs/shadow
|
||||
commands:
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}: rec {
|
||||
miifox-net-source = pkgs.callPackage ./miifox-source.nix {};
|
||||
miifox-net = pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "miifox.net";
|
||||
version = inputs.miifox-net.lastModifiedDate;
|
||||
srcs = inputs.miifox-net;
|
||||
srcs = miifox-net-source;
|
||||
nativeBuildInputs = with pkgs; [
|
||||
python3Packages.chevron
|
||||
xorg.lndir
|
||||
|
|
7
web/miifox-source.nix
Normal file
7
web/miifox-source.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{fetchgit}:
|
||||
fetchgit {
|
||||
url = "https://git.chir.rs/CarolineHusky/MiiFox.net";
|
||||
rev = "7826b9a3bec5dddd4b8a879c3396a1406fc37370";
|
||||
sha256 = "1yhg1b7mbdxrv344zgd7c04izz9b7khlhjr2rvbpcrb30v0qz89q";
|
||||
fetchLFS = true;
|
||||
}
|
28
web/update.sh
Executable file
28
web/update.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p nix-prefetch-git jq git git-lfs
|
||||
|
||||
WORK_DIR=$(mktemp -d)
|
||||
URL=https://git.chir.rs/CarolineHusky/MiiFox.net
|
||||
REVISION=$(jq -r '.nodes."miifox-net".locked.rev' ../flake.lock)
|
||||
TARGET_DIR="$PWD"
|
||||
|
||||
function cleanup {
|
||||
grep "fatal" $WORK_DIR/nix-prefetch-git.out >/dev/stderr || true
|
||||
rm -rf "$WORK_DIR"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "Fetching source code $REVISION from $URL"
|
||||
JSON=$(nix-prefetch-git --url "$URL" --rev "$REVISION" --fetch-lfs 2> $WORK_DIR/nix-prefetch-git.out | grep -v " Git" | grep -v "Git ")
|
||||
REVISION=$(echo "$JSON" | jq -r .rev)
|
||||
SHA=$(echo "$JSON" | jq -r .sha256)
|
||||
|
||||
cat > miifox-source.nix << EOF
|
||||
{fetchgit}:
|
||||
fetchgit {
|
||||
url = "$URL";
|
||||
rev = "$REVISION";
|
||||
sha256 = "$SHA";
|
||||
fetchLFS = true;
|
||||
}
|
||||
EOF
|
Reference in a new issue