add update script

This commit is contained in:
Chuang Zhu 2023-06-09 22:23:44 +08:00
parent e0bfebee1f
commit 9dbb724612
2 changed files with 19 additions and 0 deletions

1
default.nix Normal file
View file

@ -0,0 +1 @@
import <nixpkgs> { overlays = [ (import ./overlay.nix) ]; }

18
update.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils common-updater-scripts git
tmpdir="$(mktemp -d)"
git clone --bare --depth=1 --branch=mobile-shell https://gitlab.gnome.org/verdre/gnome-shell.git "$tmpdir"
pushd "$tmpdir"
new_version="unstable-$(git show -s --pretty='format:%cs')"
commit_sha="$(git show -s --pretty='format:%H')"
popd
update-source-version "gnome.gnome-shell" --file=overlay.nix "$new_version" --rev="$commit_sha"
tmpdir="$(mktemp -d)"
git clone --bare --depth=1 --branch=mobile-shell https://gitlab.gnome.org/verdre/mutter.git "$tmpdir"
pushd "$tmpdir"
new_version="unstable-$(git show -s --pretty='format:%cs')"
commit_sha="$(git show -s --pretty='format:%H')"
popd
update-source-version "gnome.mutter" --file=overlay.nix "$new_version" --rev="$commit_sha"