summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2025-07-07 20:36:26 +0200
committerRobert Hensing <robert@roberthensing.nl>2025-07-07 21:02:23 +0200
commitb78a8c9109b481e559c7b350695e671b3fbc37db (patch)
treecc845c39064ef309e2fc027adaa71a0d5a31bc87 /flake.nix
parentpkgs/impure-overlays.nix: Factor out from impure.nix (diff)
downloadnixpkgs-b78a8c9109b481e559c7b350695e671b3fbc37db.tar.gz
flake.nix: Construct legacyPackages in one go
This saves the construction of an unused `pkgs` attrset and all that is required to reach that, which is not a lot, but still significant. Benchmark 1: nix eval .?ref=42608bc8e65c5bf596d6155ad2f0ded6253b1e69#hello.outPath --no-eval-cache Time (mean ± σ): 1.062 s ± 0.011 s [User: 0.674 s, System: 0.226 s] Range (min … max): 1.040 s … 1.080 s 10 runs Benchmark 2: nix eval .?ref=8a7e18b270cb2256a0526b9cda1d9e410aacd440#hello.outPath --no-eval-cache Time (mean ± σ): 1.317 s ± 0.033 s [User: 0.835 s, System: 0.270 s] Range (min … max): 1.282 s … 1.371 s 10 runs Summary nix eval .?ref=42608bc8e65c5bf596d6155ad2f0ded6253b1e69#hello.outPath --no-eval-cache ran 1.24 ± 0.03 times faster than nix eval .?ref=8a7e18b270cb2256a0526b9cda1d9e410aacd440#hello.outPath --no-eval-cache (where 42608bc had the same tree as this commit)
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/flake.nix b/flake.nix
index 3bd0a48a5cce..3d01030806fb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -209,11 +209,14 @@
*/
legacyPackages = forAllSystems (
system:
- (import ./. { inherit system; }).extend (
- final: prev: {
- lib = prev.lib.extend libVersionInfoOverlay;
- }
- )
+ (import ./. {
+ inherit system;
+ overlays = import ./pkgs/top-level/impure-overlays.nix ++ [
+ (final: prev: {
+ lib = prev.lib.extend libVersionInfoOverlay;
+ })
+ ];
+ })
);
/**