diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'nix')
-rw-r--r-- | nix/README.md | 2 | ||||
-rw-r--r-- | nix/sources.json | 209 | ||||
-rw-r--r-- | nix/sources.nix | 135 |
3 files changed, 0 insertions, 346 deletions
diff --git a/nix/README.md b/nix/README.md deleted file mode 100644 index 7bf996c..0000000 --- a/nix/README.md +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | This directory is handled by niv, but it prefers to have a directory | ||
2 | named "nix" | ||
diff --git a/nix/sources.json b/nix/sources.json deleted file mode 100644 index 1a1cf5a..0000000 --- a/nix/sources.json +++ /dev/null | |||
@@ -1,209 +0,0 @@ | |||
1 | { | ||
2 | "buildbot-cours-deps": { | ||
3 | "ref": "master", | ||
4 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/Cours", | ||
5 | "rev": "33f139f2e2ea0a16b8ed813c5436e5a5bb506f6d", | ||
6 | "type": "git" | ||
7 | }, | ||
8 | "buildbot-cours-nixpkgs": { | ||
9 | "branch": "nixos-unstable", | ||
10 | "description": "Frozen nixpkgs snapshot for texlive", | ||
11 | "homepage": "https://github.com/NixOS/nixpkgs", | ||
12 | "owner": "NixOS", | ||
13 | "repo": "nixpkgs-channels", | ||
14 | "rev": "fce7562cf46727fdaf801b232116bc9ce0512049", | ||
15 | "sha256": "14rvi69ji61x3z88vbn17rg5vxrnw2wbnanxb7y0qzyqrj7spapx", | ||
16 | "type": "tarball", | ||
17 | "url": "https://github.com/NixOS/nixpkgs-channels/archive/fce7562cf46727fdaf801b232116bc9ce0512049.tar.gz", | ||
18 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
19 | }, | ||
20 | "buildbot-denise-aventuriers-nixpkgs": { | ||
21 | "branch": "nixos-unstable", | ||
22 | "description": "Frozen nixpkgs snapshot for texlive", | ||
23 | "homepage": "https://github.com/NixOS/nixpkgs", | ||
24 | "owner": "NixOS", | ||
25 | "repo": "nixpkgs-channels", | ||
26 | "rev": "8e2b14aceb1d40c7e8b84c03a7c78955359872bb", | ||
27 | "sha256": "0zzjpd9smr7rxzrdf6raw9kbj42fbvafxb5bz36lcxgv290pgsm8", | ||
28 | "type": "tarball", | ||
29 | "url": "https://github.com/NixOS/nixpkgs-channels/archive/8e2b14aceb1d40c7e8b84c03a7c78955359872bb.tar.gz", | ||
30 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
31 | }, | ||
32 | "buildbot-history-deps": { | ||
33 | "ref": "master", | ||
34 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/History", | ||
35 | "rev": "5f2aae4f9c92107accfc6fb6db6cb3c1f97ed9dc", | ||
36 | "type": "git" | ||
37 | }, | ||
38 | "buildbot-normalesup-deps": { | ||
39 | "ref": "master", | ||
40 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Projets/Sites/Normalesup", | ||
41 | "rev": "de294da4027e80a7b8bf7ec8c393ca0b60218575", | ||
42 | "type": "git" | ||
43 | }, | ||
44 | "buildbot-normalesup-nixpkgs": { | ||
45 | "description": "Frozen nixpkgs snapshot for texlive", | ||
46 | "revision": "173017.85f820d6e41", | ||
47 | "sha256": "0fs390gvz8d3n7v4zj538gf3n1b14sikbf0ijrxgxib5i0704mdb", | ||
48 | "type": "tarball", | ||
49 | "url": "https://releases.nixos.org/nixos/19.03/nixos-19.03.173017.85f820d6e41/nixexprs.tar.xz", | ||
50 | "url_template": "https://releases.nixos.org/nixos/<version>/nixos-<version>.<revision>/nixexprs.tar.xz", | ||
51 | "version": "19.03" | ||
52 | }, | ||
53 | "buildbot-plugin-buildslist": { | ||
54 | "ref": "master", | ||
55 | "repo": "https://git.immae.eu/perso/Immae/Projets/Buildbot/buildslist", | ||
56 | "rev": "fb8641f2badcec9f232cc5f727009911fc1c89b0", | ||
57 | "type": "git", | ||
58 | "version": "f1d42ba-master" | ||
59 | }, | ||
60 | "home-manager": { | ||
61 | "branch": "master", | ||
62 | "description": "Manage a user environment using Nix", | ||
63 | "homepage": "https://rycee.gitlab.io/home-manager/", | ||
64 | "owner": "rycee", | ||
65 | "repo": "home-manager", | ||
66 | "rev": "6cf6b587b575493e7718bf08b209013d7dcf4d58", | ||
67 | "sha256": "0666ayxazbphjn5xcrczv8m7k2q62k224fvf0kz1lx9qjn93wkvr", | ||
68 | "type": "tarball", | ||
69 | "url": "https://github.com/rycee/home-manager/archive/6cf6b587b575493e7718bf08b209013d7dcf4d58.tar.gz", | ||
70 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
71 | }, | ||
72 | "niv": { | ||
73 | "branch": "master", | ||
74 | "description": "Easy dependency management for Nix projects", | ||
75 | "homepage": "https://github.com/nmattia/niv", | ||
76 | "owner": "nmattia", | ||
77 | "repo": "niv", | ||
78 | "rev": "372f96bff217a7a019de27667d04118cffa9841b", | ||
79 | "sha256": "1l0z6162zw60pdcdj03aq64qgf1vyzmf24i9pxca64i4sprl1b7p", | ||
80 | "type": "tarball", | ||
81 | "url": "https://github.com/nmattia/niv/archive/372f96bff217a7a019de27667d04118cffa9841b.tar.gz", | ||
82 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
83 | }, | ||
84 | "nixpkgs": { | ||
85 | "branch": "nixos-unstable", | ||
86 | "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", | ||
87 | "homepage": "https://github.com/NixOS/nixpkgs", | ||
88 | "owner": "NixOS", | ||
89 | "repo": "nixpkgs-channels", | ||
90 | "rev": "fce7562cf46727fdaf801b232116bc9ce0512049", | ||
91 | "sha256": "14rvi69ji61x3z88vbn17rg5vxrnw2wbnanxb7y0qzyqrj7spapx", | ||
92 | "type": "tarball", | ||
93 | "url": "https://github.com/NixOS/nixpkgs-channels/archive/fce7562cf46727fdaf801b232116bc9ce0512049.tar.gz", | ||
94 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
95 | }, | ||
96 | "nixpkgs-home-manager": { | ||
97 | "branch": "nixos-unstable", | ||
98 | "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", | ||
99 | "homepage": "https://github.com/NixOS/nixpkgs", | ||
100 | "owner": "NixOS", | ||
101 | "repo": "nixpkgs-channels", | ||
102 | "rev": "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38", | ||
103 | "sha256": "1ak7jqx94fjhc68xh1lh35kh3w3ndbadprrb762qgvcfb8351x8v", | ||
104 | "type": "tarball", | ||
105 | "url": "https://github.com/NixOS/nixpkgs-channels/archive/c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38.tar.gz", | ||
106 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
107 | }, | ||
108 | "nixpkgs-nix": { | ||
109 | "branch": "nixos-unstable", | ||
110 | "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", | ||
111 | "homepage": "https://github.com/NixOS/nixpkgs", | ||
112 | "owner": "NixOS", | ||
113 | "repo": "nixpkgs", | ||
114 | "rev": "891f607d5301d6730cb1f9dcf3618bcb1ab7f10e", | ||
115 | "sha256": "1cr39f0sbr0h5d83dv1q34mcpwnkwwbdk5fqlyqp2mnxghzwssng", | ||
116 | "type": "tarball", | ||
117 | "url": "https://github.com/NixOS/nixpkgs/archive/891f607d5301d6730cb1f9dcf3618bcb1ab7f10e.tar.gz", | ||
118 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
119 | }, | ||
120 | "nixpkgs-nixops": { | ||
121 | "branch": "nixos-unstable", | ||
122 | "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", | ||
123 | "homepage": "https://github.com/NixOS/nixpkgs", | ||
124 | "owner": "NixOS", | ||
125 | "repo": "nixpkgs-channels", | ||
126 | "rev": "840c782d507d60aaa49aa9e3f6d0b0e780912742", | ||
127 | "sha256": "14q3kvnmgz19pgwyq52gxx0cs90ddf24pnplmq33pdddbb6c51zn", | ||
128 | "type": "tarball", | ||
129 | "url": "https://github.com/NixOS/nixpkgs-channels/archive/840c782d507d60aaa49aa9e3f6d0b0e780912742.tar.gz", | ||
130 | "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" | ||
131 | }, | ||
132 | "webapps-landing": { | ||
133 | "ref": "gitolite_local/local_changes", | ||
134 | "repo": "https://git.immae.eu/github/bastienwirtz/homer.git", | ||
135 | "rev": "bb60c5b869931f305f15c5bfa9cdb3f68702f01f", | ||
136 | "type": "git", | ||
137 | "version": "e0a72b7-local" | ||
138 | }, | ||
139 | "webapps-surfer": { | ||
140 | "ref": "master", | ||
141 | "repo": "https://git.immae.eu/perso/Immae/Projets/Nodejs/Surfer.git", | ||
142 | "rev": "476177380452c9c7c5b1624805feedc824c5995e", | ||
143 | "type": "git", | ||
144 | "version": "4761773-master" | ||
145 | }, | ||
146 | "webapps-ttrss": { | ||
147 | "ref": "master", | ||
148 | "repo": "https://git.tt-rss.org/fox/tt-rss.git", | ||
149 | "rev": "986ca251f995f7754a0470d3e0c44538a545081f", | ||
150 | "type": "git", | ||
151 | "version": "986ca25-master" | ||
152 | }, | ||
153 | "websites-chloe-app": { | ||
154 | "ref": "master", | ||
155 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/Chloe", | ||
156 | "rev": "882f166999a59081ad896f26318e6a04db9f9f43", | ||
157 | "type": "git", | ||
158 | "version": "882f166-master" | ||
159 | }, | ||
160 | "websites-connexionswing-app": { | ||
161 | "ref": "master", | ||
162 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Projets/Connexionswing", | ||
163 | "rev": "ed5874396d35766e0810a6d4e78e1a8f6b170835", | ||
164 | "type": "git", | ||
165 | "version": "ed58743-master" | ||
166 | }, | ||
167 | "websites-florian-app": { | ||
168 | "ref": "master", | ||
169 | "repo": "ssh://gitolite@git.immae.eu/perso/florian_telles/stabilo", | ||
170 | "rev": "1793d5c7912d1b20ad1df1ac59be9d7f1220e919", | ||
171 | "type": "git", | ||
172 | "version": "1793d5c-master" | ||
173 | }, | ||
174 | "websites-isabelle-aten": { | ||
175 | "ref": "master", | ||
176 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/Aten", | ||
177 | "rev": "b99537fdad41291afb4f1bb8b2e2aa4081c71fae", | ||
178 | "type": "git", | ||
179 | "version": "b99537f-master" | ||
180 | }, | ||
181 | "websites-isabelle-iridologie": { | ||
182 | "ref": "master", | ||
183 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/Iridologie", | ||
184 | "rev": "2f2ec6b003f4de97e9f8651db540c9114ac877c2", | ||
185 | "type": "git", | ||
186 | "version": "2f2ec6b-master" | ||
187 | }, | ||
188 | "websites-ludivine-app": { | ||
189 | "ref": "master", | ||
190 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/Ludivine", | ||
191 | "rev": "eae633b7c5e92184b24141ebf267d51dbc5d2acc", | ||
192 | "type": "git", | ||
193 | "version": "0dacc32-master" | ||
194 | }, | ||
195 | "websites-piedsjaloux-app": { | ||
196 | "ref": "master", | ||
197 | "repo": "ssh://gitolite@git.immae.eu/Pieds_jaloux/NewSite", | ||
198 | "rev": "2b67b9897180af3d34f87648362337dbf3981158", | ||
199 | "type": "git", | ||
200 | "version": "2b67b98-master" | ||
201 | }, | ||
202 | "websites-richie-app": { | ||
203 | "ref": "master", | ||
204 | "repo": "ssh://gitolite@git.immae.eu/perso/Immae/Sites/Richie", | ||
205 | "rev": "2a09e29dd9fc4f6abc5add82744bedf1978a35d5", | ||
206 | "type": "git", | ||
207 | "version": "2a09e29-master" | ||
208 | } | ||
209 | } | ||
diff --git a/nix/sources.nix b/nix/sources.nix deleted file mode 100644 index 45c97d1..0000000 --- a/nix/sources.nix +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | # This file has been generated by Niv. | ||
2 | |||
3 | let | ||
4 | |||
5 | # | ||
6 | # The fetchers. fetch_<type> fetches specs of type <type>. | ||
7 | # | ||
8 | |||
9 | fetch_file = pkgs: spec: | ||
10 | if spec.builtin or true then | ||
11 | builtins_fetchurl { inherit (spec) url sha256; } | ||
12 | else | ||
13 | pkgs.fetchurl { inherit (spec) url sha256; }; | ||
14 | |||
15 | fetch_tarball = pkgs: name: spec: | ||
16 | let | ||
17 | ok = str: ! builtins.isNull (builtins.match "[a-zA-Z0-9+-._?=]" str); | ||
18 | # sanitize the name, though nix will still fail if name starts with period | ||
19 | name' = stringAsChars (x: if ! ok x then "-" else x) "${name}-src"; | ||
20 | in | ||
21 | if spec.builtin or true then | ||
22 | builtins_fetchTarball { name = name'; inherit (spec) url sha256; } | ||
23 | else | ||
24 | pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; | ||
25 | |||
26 | fetch_git = spec: | ||
27 | builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; }; | ||
28 | |||
29 | fetch_builtin-tarball = name: throw | ||
30 | ''[${name}] The niv type "builtin-tarball" is deprecated. You should instead use `builtin = true`. | ||
31 | $ niv modify ${name} -a type=tarball -a builtin=true''; | ||
32 | |||
33 | fetch_builtin-url = name: throw | ||
34 | ''[${name}] The niv type "builtin-url" will soon be deprecated. You should instead use `builtin = true`. | ||
35 | $ niv modify ${name} -a type=file -a builtin=true''; | ||
36 | |||
37 | # | ||
38 | # Various helpers | ||
39 | # | ||
40 | |||
41 | # The set of packages used when specs are fetched using non-builtins. | ||
42 | mkPkgs = sources: | ||
43 | let | ||
44 | sourcesNixpkgs = | ||
45 | import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {}; | ||
46 | hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; | ||
47 | hasThisAsNixpkgsPath = <nixpkgs> == ./.; | ||
48 | in | ||
49 | if builtins.hasAttr "nixpkgs" sources | ||
50 | then sourcesNixpkgs | ||
51 | else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then | ||
52 | import <nixpkgs> {} | ||
53 | else | ||
54 | abort | ||
55 | '' | ||
56 | Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or | ||
57 | add a package called "nixpkgs" to your sources.json. | ||
58 | ''; | ||
59 | |||
60 | # The actual fetching function. | ||
61 | fetch = pkgs: name: spec: | ||
62 | |||
63 | if ! builtins.hasAttr "type" spec then | ||
64 | abort "ERROR: niv spec ${name} does not have a 'type' attribute" | ||
65 | else if spec.type == "file" then fetch_file pkgs spec | ||
66 | else if spec.type == "tarball" then fetch_tarball pkgs name spec | ||
67 | else if spec.type == "git" then fetch_git spec | ||
68 | else if spec.type == "builtin-tarball" then fetch_builtin-tarball name | ||
69 | else if spec.type == "builtin-url" then fetch_builtin-url name | ||
70 | else | ||
71 | abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}"; | ||
72 | |||
73 | # Ports of functions for older nix versions | ||
74 | |||
75 | # a Nix version of mapAttrs if the built-in doesn't exist | ||
76 | mapAttrs = builtins.mapAttrs or ( | ||
77 | f: set: with builtins; | ||
78 | listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)) | ||
79 | ); | ||
80 | |||
81 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 | ||
82 | range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); | ||
83 | |||
84 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 | ||
85 | stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); | ||
86 | |||
87 | # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L269 | ||
88 | stringAsChars = f: s: concatStrings (map f (stringToCharacters s)); | ||
89 | concatStrings = builtins.concatStringsSep ""; | ||
90 | |||
91 | # fetchTarball version that is compatible between all the versions of Nix | ||
92 | builtins_fetchTarball = { url, name, sha256 }@attrs: | ||
93 | let | ||
94 | inherit (builtins) lessThan nixVersion fetchTarball; | ||
95 | in | ||
96 | if lessThan nixVersion "1.12" then | ||
97 | fetchTarball { inherit name url; } | ||
98 | else | ||
99 | fetchTarball attrs; | ||
100 | |||
101 | # fetchurl version that is compatible between all the versions of Nix | ||
102 | builtins_fetchurl = { url, sha256 }@attrs: | ||
103 | let | ||
104 | inherit (builtins) lessThan nixVersion fetchurl; | ||
105 | in | ||
106 | if lessThan nixVersion "1.12" then | ||
107 | fetchurl { inherit url; } | ||
108 | else | ||
109 | fetchurl attrs; | ||
110 | |||
111 | # Create the final "sources" from the config | ||
112 | mkSources = config: | ||
113 | mapAttrs ( | ||
114 | name: spec: | ||
115 | if builtins.hasAttr "outPath" spec | ||
116 | then abort | ||
117 | "The values in sources.json should not have an 'outPath' attribute" | ||
118 | else | ||
119 | spec // { outPath = fetch config.pkgs name spec; } | ||
120 | ) config.sources; | ||
121 | |||
122 | # The "config" used by the fetchers | ||
123 | mkConfig = | ||
124 | { sourcesFile ? ./sources.json | ||
125 | , sources ? builtins.fromJSON (builtins.readFile sourcesFile) | ||
126 | , pkgs ? mkPkgs sources | ||
127 | }: rec { | ||
128 | # The sources, i.e. the attribute set of spec name to spec | ||
129 | inherit sources; | ||
130 | |||
131 | # The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers | ||
132 | inherit pkgs; | ||
133 | }; | ||
134 | in | ||
135 | mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } | ||