|
3 | 3 | This directory implements a program to check the [validity](#validity-checks) of the [`pkgs/by-name` Nixpkgs directory](https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name). |
4 | 4 | This is part of the implementation of [RFC 140](https://github.com/NixOS/rfcs/pull/140). |
5 | 5 |
|
6 | | -This code in this repository was originally [part of Nixpkgs](https://github.com/NixOS/nixpkgs/commits/55bf02190ee57fcf83490fd7b6bf7834e28c9c86/pkgs/test/nixpkgs-check-by-name), but has since been [moved into this separate repository](https://github.com/NixOS/nixpkgs/issues/286559). |
| 6 | +See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for contributor documentation. |
| 7 | +Below is the user documentation. |
7 | 8 |
|
8 | 9 | To see how it is used in Nixpkgs, see the [`check-by-name.yml` workflow](https://github.com/NixOS/nixpkgs/blob/master/.github/workflows/check-by-name.yml). |
9 | 10 |
|
10 | | -[@infinisil](https://github.com/infinisil) is the admin and main developer of this repository, while everybody in [@NixOS/nixpkgs-check-by-name](https://github.com/orgs/NixOS/teams/nixpkgs-check-by-name) has write access. |
11 | 11 |
|
12 | 12 | ## Interface |
13 | 13 |
|
@@ -52,52 +52,3 @@ The current ratchets are: |
52 | 52 | (see [nix evaluation checks](#nix-evaluation-checks)) must not be introduced. |
53 | 53 | - New top-level packages defined using `pkgs.callPackage` must be defined with a package directory. |
54 | 54 | - Once a top-level package uses `pkgs/by-name`, it also can't be moved back out of it. |
55 | | - |
56 | | -## Development |
57 | | - |
58 | | -Enter the development environment in this directory either automatically with `direnv` or with |
59 | | -``` |
60 | | -nix-shell |
61 | | -``` |
62 | | - |
63 | | -Then use `cargo`: |
64 | | -``` |
65 | | -cargo build |
66 | | -cargo test |
67 | | -cargo fmt |
68 | | -cargo clippy |
69 | | -``` |
70 | | - |
71 | | -## Tests |
72 | | - |
73 | | -Tests are declared in [`./tests`](./tests) as subdirectories imitating Nixpkgs with these files: |
74 | | -- `default.nix`: |
75 | | - Always contains |
76 | | - ```nix |
77 | | - import <test-nixpkgs> { root = ./.; } |
78 | | - ``` |
79 | | - which makes |
80 | | - ``` |
81 | | - nix-instantiate <subdir> --eval -A <attr> --arg overlays <overlays> |
82 | | - ``` |
83 | | - work very similarly to the real Nixpkgs, just enough for the program to be able to test it. |
84 | | -- `pkgs/by-name`: |
85 | | - The `pkgs/by-name` directory to check. |
86 | | - |
87 | | -- `all-packages.nix` (optional): |
88 | | - Contains an overlay of the form |
89 | | - ```nix |
90 | | - self: super: { |
91 | | - # ... |
92 | | - } |
93 | | - ``` |
94 | | - allowing the simulation of package overrides to the real [`pkgs/top-level/all-packages.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix). |
95 | | - The default is an empty overlay. |
96 | | - |
97 | | -- `base` (optional): |
98 | | - Contains another subdirectory imitating Nixpkgs with potentially any of the above structures. |
99 | | - This is used for [ratchet checks](#ratchet-checks). |
100 | | - |
101 | | -- `expected` (optional): |
102 | | - A file containing the expected standard output. |
103 | | - The default is expecting an empty standard output. |
0 commit comments