mirror of
https://github.com/Melorise/nixpkgs.git
synced 2026-11-07 14:39:33 +00:00
add frozen branches
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
name: Mirror Nixpkgs Frozen Branches
|
||||
|
||||
on:
|
||||
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
|
||||
archive="$(mktemp)"
|
||||
checkout="$(mktemp -d)"
|
||||
|
||||
curl --fail --location --retry 3 \
|
||||
"https://codeload.github.com/NixOS/nixpkgs/tar.gz/refs/heads/$branch" \
|
||||
--output "$archive"
|
||||
tar --extract --gzip --file "$archive" --strip-components=1 --directory "$checkout"
|
||||
|
||||
git -C "$checkout" init
|
||||
git -C "$checkout" config user.name "github-actions[bot]"
|
||||
git -C "$checkout" config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git -C "$checkout" add --all
|
||||
git -C "$checkout" commit --message "Snapshot of NixOS/nixpkgs $branch"
|
||||
git -C "$checkout" remote add target \
|
||||
"https://x-access-token:${NIX_BRANCH_TOKEN}@github.com/${TARGET_REPOSITORY}.git"
|
||||
git -C "$checkout" push --force target "HEAD:refs/heads/frozen/$branch"
|
||||
|
||||
done
|
||||
@@ -2,5 +2,9 @@
|
||||
我使用NixOS主要追求的是声明式配置,不太在乎可复现性。
|
||||
由于储存涨价的大势所趋(雾),如果每个项目使用来自上游的独立的nixpkgs输入的话,可能会安装不同的版本,造成存储占用过大。
|
||||
本镜像每周会同步一次,这是我个人比较能接受的更新频率。
|
||||
## 注意:每次同步都会强制覆盖提交历史,只保留最新提交,如果追求可复现性,切勿使用本输入源!
|
||||
|
||||
## 注意:每次同步都会强制覆盖提交历史,只保留最新提交,如果追求可复现性,切勿使用本输入源!
|
||||
|
||||
# 2026.10.28更新:新增frozen系列源
|
||||
一些软件包我实在不想频繁更新, frozen/*分支的镜像更新只能手动执行,会长期冻结在某个输入,可能不定期更新一次。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user