fix(report): use nix eval to list the components #29

Merged
jalil merged 1 commit from push-skpxwssykmzw into main 2025-07-13 18:48:45 +02:00
Owner

This is less error prone than parsing the information from nix flake show.

This is less error prone than parsing the information from `nix flake show`.
jalil self-assigned this 2025-07-13 18:42:07 +02:00
jalil added 1 commit 2025-07-13 18:42:07 +02:00
fix(report): use nix eval to list the components
Some checks failed
/ report-size-pr (pull_request) Failing after 2s
/ report-download-check-pr (pull_request) Has been skipped
/ check (treefmt) (push) Successful in 4s
/ report-size (push) Successful in 2s
/ report-download-check (push) Failing after 0s
138da40caf
This is less error prone than parsing the information from `nix flake
show`.
jalil force-pushed push-skpxwssykmzw from 138da40caf to f6ba3c1516 2025-07-13 18:46:03 +02:00 Compare

Flake output sizes

Definitions
  • Name: the name of the package/configuration.
  • 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/Home-Manager 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 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.

Packages

Name Size Size Change NAR Size NAR Size Change
hello 32MiB 0B 268KiB 0B
<!-- AUTOGENERATED by nix-flake-outputs-size action --> ## Flake output sizes <details><summary><b>Definitions</b></summary> - `Name`: the name of the package/configuration. - `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. </details> <details><summary><b>Tips on reading this data</b></summary> - For NixOS/Home-Manager 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 `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. </details> ## Packages | Name | Size | Size Change | NAR Size | NAR Size Change | |------|-----:|------------:|---------:|----------------:| | `hello` | 32MiB | 0B | 268KiB | 0B |
jalil force-pushed push-skpxwssykmzw from f6ba3c1516 to 7e108cf08b 2025-07-13 18:47:28 +02:00 Compare
jalil force-pushed push-skpxwssykmzw from 7e108cf08b to e5d1a0751a 2025-07-13 18:48:17 +02:00 Compare
jalil merged commit e5d1a0751a into main 2025-07-13 18:48:45 +02:00
jalil deleted branch push-skpxwssykmzw 2025-07-13 18:48:45 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jalil/nix-flake-outputs-size#29
No description provided.