commit df527ac7854452cc7e5588c4297964630544fa6e Author: Melorise <0d00@0721.hk> Date: Thu Aug 27 11:08:32 2026 +0800 init diff --git a/.github/workflows/mirror-nixpkgs.yml b/.github/workflows/mirror-nixpkgs.yml new file mode 100644 index 000000000..44e2f2930 --- /dev/null +++ b/.github/workflows/mirror-nixpkgs.yml @@ -0,0 +1,29 @@ +name: Mirror Nixpkgs Branches + +on: + schedule: + - cron: "0 0 * * 2" + workflow_dispatch: + +permissions: + contents: write + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Mirror upstream branches + env: + NIX_BRANCH_TOKEN: ${{ secrets.NIX_BRANCH_TOKEN }} + TARGET_REPOSITORY: ${{ github.repository }} + run: | + set -euo pipefail + : "${NIX_BRANCH_TOKEN:?Set the NIX_BRANCH_TOKEN repository secret.}" + + for branch in nixos-26.05 nixos-unstable; do + git clone --depth=1 --branch "$branch" \ + "https://github.com/NixOS/nixpkgs.git" "$branch" + git -C "$branch" remote set-url origin \ + "https://x-access-token:${NIX_BRANCH_TOKEN}@github.com/${TARGET_REPOSITORY}.git" + git -C "$branch" push --force origin "HEAD:refs/heads/$branch" + done