Skip to content

Commit

Permalink
Don't create a new nixpkgs instance when not required, fix overlay attr.
Browse files Browse the repository at this point in the history
  • Loading branch information
r-vdp committed Aug 9, 2023
1 parent 2da4073 commit a3df510
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = { self, nixpkgs, flake-utils }:
let
mkPackage = pkgs: pkgs.callPackage ./default.nix {
#version = self.shortRev or "dirty";
date = self.lastModifiedDate;
commit = self.shortRev or "dirty";
};
in
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays."${system}".default ];
};
in {
packages = { inherit (pkgs) process-compose; };
{
packages.process-compose = mkPackage nixpkgs.legacyPackages.${system};
defaultPackage = self.packages."${system}".process-compose;
apps.process-compose = flake-utils.lib.mkApp {
drv = self.packages."${system}".process-compose;
Expand All @@ -23,11 +25,7 @@
})
) // {
overlays.default = final: prev: {
process-compose = final.callPackage ./default.nix {
#version = self.shortRev or "dirty";
date = self.lastModifiedDate;
commit = self.shortRev or "dirty";
};
process-compose = mkPackage final;
};
}
;
Expand Down

0 comments on commit a3df510

Please sign in to comment.