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