refactor(nix): use fixed points over rec

Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
seth 2023-09-03 18:11:23 -04:00
parent 707da5a25a
commit bbf4e3b04d
No known key found for this signature in database
GPG Key ID: D31BD0D494BBEE86

View File

@ -3,18 +3,28 @@
self, self,
... ...
}: { }: {
perSystem = {pkgs, ...}: { perSystem = {
lib,
pkgs,
...
}: {
packages = let packages = let
ourPackages = self.overlays.default pkgs null; ourPackages = lib.fix (final: self.overlays.default ({inherit (pkgs) darwin;} // final) pkgs);
in { in {
inherit (ourPackages) prismlauncher-qt5-unwrapped prismlauncher-qt5 prismlauncher-unwrapped prismlauncher; inherit
(ourPackages)
prismlauncher-qt5-unwrapped
prismlauncher-qt5
prismlauncher-unwrapped
prismlauncher
;
default = ourPackages.prismlauncher; default = ourPackages.prismlauncher;
}; };
}; };
flake = { flake = {
overlays.default = final: _: let overlays.default = final: prev: let
version = builtins.substring 0 8 self.lastModifiedDate; version = builtins.substring 0 8 self.lastModifiedDate or "dirty";
# common args for prismlauncher evaluations # common args for prismlauncher evaluations
unwrappedArgs = { unwrappedArgs = {
@ -22,11 +32,13 @@
inherit (final.darwin.apple_sdk.frameworks) Cocoa; inherit (final.darwin.apple_sdk.frameworks) Cocoa;
inherit self version; inherit self version;
}; };
in rec { in {
prismlauncher-qt5-unwrapped = final.libsForQt5.callPackage ./pkg unwrappedArgs; prismlauncher-qt5-unwrapped = prev.libsForQt5.callPackage ./pkg unwrappedArgs;
prismlauncher-qt5 = final.libsForQt5.callPackage ./pkg/wrapper.nix {prismlauncher-unwrapped = prismlauncher-qt5-unwrapped;}; prismlauncher-qt5 = prev.libsForQt5.callPackage ./pkg/wrapper.nix {
prismlauncher-unwrapped = final.qt6Packages.callPackage ./pkg unwrappedArgs; prismlauncher-unwrapped = final.prismlauncher-qt5-unwrapped;
prismlauncher = final.qt6Packages.callPackage ./pkg/wrapper.nix {inherit prismlauncher-unwrapped;}; };
prismlauncher-unwrapped = prev.qt6Packages.callPackage ./pkg unwrappedArgs;
prismlauncher = prev.qt6Packages.callPackage ./pkg/wrapper.nix {inherit (final) prismlauncher-unwrapped;};
}; };
}; };
} }