nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ testers, fetchFromGitHub, ... }:
2{
3 simple = testers.invalidateFetcherByDrvHash fetchFromGitHub {
4 name = "simple-nix-source";
5 owner = "NixOS";
6 repo = "nix";
7 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
8 hash = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY=";
9 };
10
11 simple-tag = testers.invalidateFetcherByDrvHash fetchFromGitHub {
12 name = "simple-tag-nix-source";
13 owner = "NixOS";
14 repo = "nix";
15 rev = "2.3.15";
16 hash = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY=";
17 };
18
19 describe-tag = testers.invalidateFetcherByDrvHash fetchFromGitHub {
20 name = "describe-tag-nix-source";
21 owner = "NixOS";
22 repo = "nix";
23 rev = "2.3.15";
24 hash = "sha256-y7l+46lVP2pzJwGON5qEV0EoxWofRoWAym5q9VXvpc8=";
25 postCheckout = ''
26 { git -C "$out" describe || echo "git describe failed"; } | tee "$out"/describe-output.txt
27 '';
28 };
29
30 sparseCheckout = testers.invalidateFetcherByDrvHash fetchFromGitHub {
31 name = "sparse-checkout-nix-source";
32 owner = "NixOS";
33 repo = "nix";
34 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
35 sparseCheckout = [
36 "src"
37 "tests"
38 ];
39 sha256 = "sha256-g1PHGTWgAcd/+sXHo1o6AjVWCvC6HiocOfMbMh873LQ=";
40 };
41
42 sparseCheckoutNonConeMode = testers.invalidateFetcherByDrvHash fetchFromGitHub {
43 name = "sparse-checkout-non-cone-nix-source";
44 owner = "NixOS";
45 repo = "nix";
46 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
47 sparseCheckout = [
48 "src"
49 "tests"
50 ];
51 nonConeMode = true;
52 sha256 = "sha256-FknO6C/PSnMPfhUqObD4vsW4PhkwdmPa9blNzcNvJQ4=";
53 };
54
55 leave-git = testers.invalidateFetcherByDrvHash fetchFromGitHub {
56 name = "leave-git-nix-source";
57 owner = "NixOS";
58 repo = "nix";
59 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
60 sha256 = "sha256-VmQ38+lr+rNPaTnjjV41uC2XSN4fkfZAfytE2uKyLfo=";
61 leaveDotGit = true;
62 };
63
64 submodule-simple = testers.invalidateFetcherByDrvHash fetchFromGitHub {
65 name = "submodule-simple-source";
66 owner = "pineapplehunter";
67 repo = "nix-test-repo-with-submodule";
68 rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a";
69 sha256 = "sha256-rmP8PQT0wJBopdtr/hsB7Y/L1G+ZPdHC2r9LB05Qrj4=";
70 fetchSubmodules = true;
71 };
72
73 submodule-leave-git = testers.invalidateFetcherByDrvHash fetchFromGitHub {
74 name = "submodule-leave-git-source";
75 owner = "pineapplehunter";
76 repo = "nix-test-repo-with-submodule";
77 rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a";
78 sha256 = "sha256-EC2PMEEtA7f5OFdsluHn7pi4QXhCZuFML8tib4pV7Ek=";
79 leaveDotGit = true;
80 fetchSubmodules = true;
81 };
82
83 submodule-deep = testers.invalidateFetcherByDrvHash fetchFromGitHub {
84 name = "submodule-deep-source";
85 owner = "pineapplehunter";
86 repo = "nix-test-repo-with-submodule";
87 rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a";
88 sha256 = "sha256-3zWogs6EZBnzUfz6gBnigETTKGYl9KFKFgsy6Bl4DME=";
89 deepClone = true;
90 fetchSubmodules = true;
91 # deepClone implies leaveDotGit, so delete the .git directory after
92 # fetching to distinguish from the submodule-leave-git-deep test.
93 postFetch = "rm -r $out/.git";
94 };
95
96 submodule-leave-git-deep = testers.invalidateFetcherByDrvHash fetchFromGitHub {
97 name = "submodule-leave-git-deep-source";
98 owner = "pineapplehunter";
99 repo = "nix-test-repo-with-submodule";
100 rev = "26473335b84ead88ee0a3b649b1c7fa4a91cfd4a";
101 sha256 = "sha256-ieYn9I/0RgeSwQkSqwKaU3RgjKFlRqMg7zw0Nvu3azA=";
102 deepClone = true;
103 leaveDotGit = true;
104 fetchSubmodules = true;
105 };
106
107 dumb-http-signed-tag = testers.invalidateFetcherByDrvHash fetchFromGitHub {
108 name = "dumb-http-signed-tag-source";
109 owner = "NixOS";
110 repo = "nix";
111 tag = "2.9.2";
112 sha256 = "sha256-uZCaBo9rdWRO/AlQMvVVjpAwzYijB2H5KKQqde6eHkg=";
113 };
114
115 fetchTags = testers.invalidateFetcherByDrvHash fetchFromGitHub {
116 name = "fetchFromGitHub-fetch-tags-test";
117 owner = "NixOS";
118 repo = "nix";
119 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
120 fetchTags = true;
121 leaveDotGit = true;
122 sha256 = "sha256-y7l+46lVP2pzJwGON5qEV0EoxWofRoWAym5q9VXvpc8=";
123 postFetch = ''
124 cd $out && git describe --tags --always > describe-output.txt 2>&1 || echo "git describe failed" > describe-output.txt
125 # See https://github.com/NixOS/nixpkgs/issues/412967#issuecomment-2927452118
126 rm -rf .git
127 '';
128 };
129
130 rootDir = testers.invalidateFetcherByDrvHash fetchFromGitHub {
131 name = "fetchFromGitHub-with-rootdir";
132 owner = "NixOS";
133 repo = "nix";
134 rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
135 rootDir = "misc/systemd";
136 hash = "sha256-UhxHk4SrXYq7ZDMtXLig5SigpbITrVgkpFTmryuvpcM=";
137 };
138}