Skip to content

Commit

Permalink
flake: fix usage of prev in overlays
Browse files Browse the repository at this point in the history
flake: use overlays in pkgsFor
  • Loading branch information
spikespaz authored and fufexan committed May 2, 2023
1 parent c0e2339 commit bc7d9c7
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,33 @@
"aarch64-linux"
"x86_64-linux"
];
pkgsFor = nixpkgs.legacyPackages;
pkgsFor = genSystems (system:
import nixpkgs {
inherit system;
overlays = [
self.overlays.default
inputs.hyprland-protocols.overlays.default
];
});
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
in {
overlays.default = _: prev: rec {
xdg-desktop-portal-hyprland = prev.callPackage ./nix/default.nix {
stdenv = prev.gcc12Stdenv;
inherit (inputs.hyprland-protocols.packages.${prev.hostPlatform.system}) hyprland-protocols;
inherit hyprland-share-picker version;
overlays.default = final: prev: {
xdg-desktop-portal-hyprland = final.callPackage ./nix/default.nix {
stdenv = final.gcc12Stdenv;
inherit (final) hyprland-protocols hyprland-share-picker;
inherit version;
};

hyprland-share-picker = prev.libsForQt5.callPackage ./nix/hyprland-share-picker.nix {inherit version;};
hyprland-share-picker = final.libsForQt5.callPackage ./nix/hyprland-share-picker.nix {inherit version;};
};

packages = genSystems (system:
(self.overlays.default null pkgsFor.${system})
(self.overlays.default pkgsFor.${system} pkgsFor.${system})
// {default = self.packages.${system}.xdg-desktop-portal-hyprland;});

formatter = genSystems (system: pkgsFor.${system}.alejandra);
Expand Down

0 comments on commit bc7d9c7

Please sign in to comment.