WIP: refactor: port to JS
Some checks failed
/ check (treefmt) (push) Successful in 4s
/ report-size (push) Failing after 1s
/ report-download-check (push) Has been skipped

This should hopefully reduce the complexity of the action
This commit is contained in:
Jalil David Salamé Messina 2025-07-10 22:03:45 +02:00
parent a26909cb8c
commit e1434adaa5
Signed by: jalil
GPG key ID: F016B9E770737A0B
20 changed files with 215059 additions and 109 deletions

View file

@ -2,9 +2,11 @@
Use `nix path-info` to query the size of flake outputs and produce a report.
This repost can be posted to a PR (as formatted markdown) and/or uploaded as a workflow artifact.
This repost can be posted to a PR (as formatted markdown) and/or uploaded as a
workflow artifact.
Requires `nix`, `jq`, `curl`, `sed`, `gunzip`, `tar` and `coreutils` to be in the runner's path.
Requires `nix`, `jq`, `curl`, `sed`, `gunzip`, `tar` and `coreutils` to be in
the runner's path.
## Example
@ -39,26 +41,32 @@ For more details see the [action.yaml](./action.yml) file.
**Definitions:**
- `Name`: the name of the package/configuration.
- `Size`: the closure size (size on disk/NAR size + all transitive dependencies).
- `Size`: the closure size (size on disk/NAR size + all transitive
dependencies).
- `NAR Size`: the size of the build output (package without the dependencies).
- `[NAR] Size Change`: the amount changed compared to the main branch.
**Tips on reading this data:**
- For NixOS configurations you generally care only about the `Size` (closure size/size on disk).
- For NixOS configurations you generally care only about the `Size` (closure
size/size on disk).
- Reduce the `Size` by disabling unneeded services/default packages.
- For Packages you care about both the `Size` and the `NAR Size`.
- Reduce the `NAR Size` by reducing the size of the build outputs, e.g. don't copy unnecessary data to the $out dir, optimize binaries for size, etc.
- Reduce the `NAR Size` by reducing the size of the build outputs, e.g. don't
copy unnecessary data to the $out dir, optimize binaries for size, etc.
- Reduce the `Size` by reducing the dependencies (e.g. `buildInputs`).
- Don't worry too much about size, some dependencies are deduplicated, e.g. `glibc` adds ~40MiB to the `Size`, but is generally shared by ~every binary on the system, so, chances are, you are already including it from somewhere else and statically linking with e.g. `musl` is not gonna improve things.
- Don't worry too much about size, some dependencies are deduplicated, e.g.
`glibc` adds ~40MiB to the `Size`, but is generally shared by ~every binary
on the system, so, chances are, you are already including it from somewhere
else and statically linking with e.g. `musl` is not gonna improve things.
# NixOS Configurations
| Name | Size | Size Change | NAR Size | NAR Size Change |
|------|-----:|------------:|---------:|----------------:|
| `gemini` | 11Gi | -2.4Mi | 28Ki | 0 |
| `leo` | 1.6Gi | 0 | 25Ki | 0 |
| `libra` | 9.4Gi | -2.4Mi | 28Ki | 0 |
| `taurus` | 7.6Gi | 0 | 34Ki | 0 |
| Name | Size | Size Change | NAR Size | NAR Size Change |
| -------- | ----: | ----------: | -------: | --------------: |
| `gemini` | 11Gi | -2.4Mi | 28Ki | 0 |
| `leo` | 1.6Gi | 0 | 25Ki | 0 |
| `libra` | 9.4Gi | -2.4Mi | 28Ki | 0 |
| `taurus` | 7.6Gi | 0 | 34Ki | 0 |
</details>