Skip to content

Commit e6d5a03

Browse files
azuwisMic92
authored andcommitted
Generate index db for nixpkgs stable branch
1 parent 41cef1c commit e6d5a03

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/update.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ jobs:
5959
x86_64-darwin-small-hash: ${{ steps.hashes.outputs.x86_64-darwin-small }}
6060
aarch64-linux-small-hash: ${{ steps.hashes.outputs.aarch64-linux-small }}
6161
aarch64-darwin-small-hash: ${{ steps.hashes.outputs.aarch64-darwin-small }}
62+
x86_64-linux-stable-hash: ${{ steps.hashes.outputs.x86_64-linux-stable }}
63+
x86_64-darwin-stable-hash: ${{ steps.hashes.outputs.x86_64-darwin-stable }}
64+
aarch64-linux-stable-hash: ${{ steps.hashes.outputs.aarch64-linux-stable }}
65+
aarch64-darwin-stable-hash: ${{ steps.hashes.outputs.aarch64-darwin-stable }}
66+
x86_64-linux-stable-small-hash: ${{ steps.hashes.outputs.x86_64-linux-stable-small }}
67+
x86_64-darwin-stable-small-hash: ${{ steps.hashes.outputs.x86_64-darwin-stable-small }}
68+
aarch64-linux-stable-small-hash: ${{ steps.hashes.outputs.aarch64-linux-stable-small }}
69+
aarch64-darwin-stable-small-hash: ${{ steps.hashes.outputs.aarch64-darwin-stable-small }}
6270
steps:
6371
- uses: actions/checkout@v6
6472
- name: Swap space report before modification
@@ -107,18 +115,30 @@ jobs:
107115
run: |
108116
nix shell --inputs-from .# nixpkgs#nix-index -c nix-index --db ./${{ matrix.system }}-index-small --system ${{matrix.system}} --filter-prefix '/bin/' 2>&1 | grep -v '+ generating index:'
109117
mv ./${{ matrix.system }}-index-small/files ./index-${{ matrix.system }}-small
118+
- name: generate stable full nix-index database
119+
run: |
120+
nix shell --inputs-from .# nixpkgs#nix-index -c nix-index --db ./${{ matrix.system }}-index-stable --system ${{matrix.system}} --nixpkgs 'https://github.com/NixOS/nixpkgs/archive/${{ endsWith(matrix.system, '-darwin') && 'nixpkgs-25.05-darwin' || 'nixos-25.05' }}.tar.gz' 2>&1 | grep -v '+ generating index:'
121+
mv ./${{ matrix.system }}-index-stable/files ./index-${{ matrix.system }}-stable
122+
- name: generate stable small nix-index database
123+
run: |
124+
nix shell --inputs-from .# nixpkgs#nix-index -c nix-index --db ./${{ matrix.system }}-index-stable-small --system ${{matrix.system}} --nixpkgs 'https://github.com/NixOS/nixpkgs/archive/${{ endsWith(matrix.system, '-darwin') && 'nixpkgs-25.05-darwin' || 'nixos-25.05' }}.tar.gz' --filter-prefix '/bin/' 2>&1 | grep -v '+ generating index:'
125+
mv ./${{ matrix.system }}-index-stable-small/files ./index-${{ matrix.system }}-stable-small
110126
- name: hash index
111127
id: hashes
112128
run: |
113129
echo "${{ matrix.system }}=$(nix store prefetch-file "file://$PWD/index-${{ matrix.system }}" --json | jq -r .hash)" >> "$GITHUB_OUTPUT"
114130
echo "${{ matrix.system }}-small=$(nix store prefetch-file "file://$PWD/index-${{ matrix.system }}-small" --json | jq -r .hash)" >> "$GITHUB_OUTPUT"
131+
echo "${{ matrix.system }}-stable=$(nix store prefetch-file "file://$PWD/index-${{ matrix.system }}-stable" --json | jq -r .hash)" >> "$GITHUB_OUTPUT"
132+
echo "${{ matrix.system }}-stable-small=$(nix store prefetch-file "file://$PWD/index-${{ matrix.system }}-stable-small" --json | jq -r .hash)" >> "$GITHUB_OUTPUT"
115133
- name: add to release
116134
uses: softprops/action-gh-release@v2
117135
with:
118136
tag_name: ${{ needs.create-release.outputs.release_name }}
119137
files: |
120138
index-${{ matrix.system }}-small
121139
index-${{ matrix.system }}
140+
index-${{ matrix.system }}-stable
141+
index-${{ matrix.system }}-stable-small
122142
123143
124144
update-generated:
@@ -146,6 +166,14 @@ jobs:
146166
aarch64-linux-small = "${{ needs.index.outputs.aarch64-linux-small-hash }}";
147167
x86_64-darwin-small = "${{ needs.index.outputs.x86_64-darwin-small-hash }}";
148168
aarch64-darwin-small = "${{ needs.index.outputs.aarch64-darwin-small-hash }}";
169+
x86_64-linux-stable = "${{ needs.index.outputs.x86_64-linux-stable-hash }}";
170+
aarch64-linux-stable = "${{ needs.index.outputs.aarch64-linux-stable-hash }}";
171+
x86_64-darwin-stable = "${{ needs.index.outputs.x86_64-darwin-stable-hash }}";
172+
aarch64-darwin-stable = "${{ needs.index.outputs.aarch64-darwin-stable-hash }}";
173+
x86_64-linux-stable-small = "${{ needs.index.outputs.x86_64-linux-stable-small-hash }}";
174+
aarch64-linux-stable-small = "${{ needs.index.outputs.aarch64-linux-stable-small-hash }}";
175+
x86_64-darwin-stable-small = "${{ needs.index.outputs.x86_64-darwin-stable-small-hash }}";
176+
aarch64-darwin-stable-small = "${{ needs.index.outputs.aarch64-darwin-stable-small-hash }}";
149177
};
150178
}
151179
EOF

default.nix

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,47 @@ let
2121
__structuredAttrs = true;
2222
unsafeDiscardReferences.out = true;
2323
};
24+
25+
nix-index-stable-database =
26+
(pkgs.fetchurl {
27+
url = generated.url + pkgs.stdenv.system + "-stable";
28+
hash = generated.hashes."${pkgs.stdenv.system}-stable";
29+
}).overrideAttrs
30+
{
31+
__structuredAttrs = true;
32+
unsafeDiscardReferences.out = true;
33+
};
34+
35+
nix-index-stable-small-database =
36+
(pkgs.fetchurl {
37+
url = generated.url + pkgs.stdenv.system + "-stable-small";
38+
hash = generated.hashes."${pkgs.stdenv.system}-stable-small";
39+
}).overrideAttrs
40+
{
41+
__structuredAttrs = true;
42+
unsafeDiscardReferences.out = true;
43+
};
2444
in
2545
{
26-
inherit nix-index-database nix-index-small-database;
46+
inherit
47+
nix-index-database
48+
nix-index-small-database
49+
nix-index-stable-database
50+
nix-index-stable-small-database
51+
;
2752

2853
nix-index-with-db = pkgs.callPackage ./nix-index-wrapper.nix { inherit nix-index-database; };
2954
nix-index-with-small-db = pkgs.callPackage ./nix-index-wrapper.nix {
3055
nix-index-database = nix-index-small-database;
3156
db-type = "small";
3257
};
58+
nix-index-with-stable-db = pkgs.callPackage ./nix-index-wrapper.nix {
59+
nix-index-database = nix-index-stable-database;
60+
};
61+
nix-index-with-stable-small-db = pkgs.callPackage ./nix-index-wrapper.nix {
62+
nix-index-database = nix-index-stable-small-database;
63+
db-type = "small";
64+
};
3365
comma-with-db = pkgs.callPackage ./comma-wrapper.nix {
3466
nix-index-database = nix-index-small-database;
3567
};

0 commit comments

Comments
 (0)