Skip to content

Commit

Permalink
flake: be backwards-compatible for --impure
Browse files Browse the repository at this point in the history
We cannot pass `overlays = ...` to `nixpkgs` directly because by default
overlays from `~/.config/nixpkgs` are loaded in there. This doesn't
happen by default, but when using `--impure`.

Explicitly specifying that ignores these overlays. By using `pkgs.extend`
the old behavior can be kept and the new overlay can be applied.

Co-authored-by: Silvan Mosberger <contact@infinisil.com>
  • Loading branch information
Ma27 and infinisil committed Dec 10, 2023
1 parent ede5720 commit cb289a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@
# attribute it displays `omitted` instead of evaluating all packages,
# which keeps `nix flake show` on Nixpkgs reasonably fast, though less
# information rich.
legacyPackages = forAllSystems (system: import ./. {
inherit system;
overlays = [ self.overlays.setLibVersionInfo ];
});
legacyPackages = forAllSystems (system:
(import ./. { inherit system; }).extend self.overlays.setLibVersionInfo
);

nixosModules = {
notDetected = ./nixos/modules/installer/scan/not-detected.nix;
Expand Down

0 comments on commit cb289a9

Please sign in to comment.