Skip to content

Commit

Permalink
do not create a fresh instance of nixpkgs
Browse files Browse the repository at this point in the history
Reuse the passed instance of nixpkgs instead of re-evaluating
and creating a new instance. See zimbatm's "1000 instances of
nixpkgs" for backround info.
  • Loading branch information
wamserma committed Apr 26, 2024
1 parent 9cd784f commit b49c9e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
# provide db-package for all archs, but scaper/test only for most common
(utils.lib.eachSystem utils.lib.allSystems (system:
let
pkgs = import nixpkgs { inherit system; };
pkgs = nixpkgs.legacyPackages.${system};
in
nixpkgs.lib.recursiveUpdate
(nixpkgs.lib.optionalAttrs (builtins.elem system utils.lib.defaultSystems) rec {
packages.updater = pkgs.callPackage ./updater.nix {};
apps.updater = { type = "app"; program = "${packages.updater}/bin/updater";};
devShell = with pkgs; mkShell {
devShells.default = with pkgs; mkShell {
buildInputs = [ nim nimble-unwrapped nimlsp ];
};
checks.vmtest = import ./test.nix { inherit pkgs; flake = self; }; # nixpkgs must be set to a revision present in the JSON file
Expand All @@ -33,4 +33,4 @@
{
nixosModules.programs-sqlite = pass@{ pkgs, ... }: (import ./module.nix { programs-sqlite = (getDB pkgs); }) pass;
};
}
}

0 comments on commit b49c9e6

Please sign in to comment.