New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Nix Flake #1093
Refactor Nix Flake #1093
Conversation
Signed-off-by: seth <getchoo@tuta.io>
Signed-off-by: seth <getchoo@tuta.io>
Signed-off-by: seth <getchoo@tuta.io>
Signed-off-by: seth <getchoo@tuta.io>
I wonder if it might be time to just override the packages from nixpkgs. We only really need to replace |
since we like to keep both packages in sync, i think that would actually be a great idea! i would only be concerned over desynchronizations, where our locked version of nixpkgs is behind a recent change. this doesn't seem like a major deal though, as with renovate updating inputs we would only be out of sync for a week at most. plus, the user always has the option to use their own version of nixpkgs; so if we document that in NIX.md, i wouldn't really see any issue |
i tried to also add the new unwrapped packages with the following diff, but it seems the qt5 wrapped packages attempts to build against the qt6 unwrapped package with this (with or without the index a460723a..4c1081a6 100644
--- a/nix/distribution.nix
+++ b/nix/distribution.nix
@@ -5,13 +5,13 @@
}: {
perSystem = {pkgs, ...}: {
packages = {
- inherit (pkgs) prismlauncher prismlauncher-qt5;
+ inherit (pkgs) prismlauncher prismlauncher-qt5 prismlauncher-unwrapped prismlauncher-qt5-unwrapped;
default = pkgs.prismlauncher;
};
};
flake = {
- overlays.default = _: prev: let
+ overlays.default = final: prev: let
# Helper function to create overrides from multiple versions of prism.
mkPrism = prism:
prism.overrideAttrs (_: {
@@ -20,7 +20,9 @@
});
in {
prismlauncher = mkPrism prev.prismlauncher;
- prismlauncher-qt5 = mkPrism prev.prismlauncher-qt5;
+ prismlauncher-qt5 = mkPrism (prev.prismlauncher-qt5.override {prismlauncher-unwrapped = final.prismlauncher-qt5-unwrapped;});
+ prismlauncher-unwrapped = mkPrism prev.prismlauncher-unwrapped;
+ prismlauncher-qt5-unwrapped = mkPrism prev.prismlauncher-qt5-unwrapped;
};
};
} |
Okay this won't work as well as I thought. We have some slight cmakeFlags changes in 7.0 as well, and it's kinda annoying overriding those without duplicating a lot of code. Let's just keep our own packages instead. |
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
913733d
to
0f0cbd4
Compare
Signed-off-by: seth <getchoo@tuta.io>
I don't know enough about nix to really say yay or nay on this... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see anything wrong and it has scrumps approval so... 👍
You are one of the maintainers of all time! :P |
this makes a few opinionated changes to the flake, mainly moving from flake-utils to flake-parts. i think this is a good fit for the project as we already had other functions separated into the
nix/
folder, and flake-parts allows us to do this in a much more efficient way.other notable changes include using the overlay from
self
to create thepackages
attrset (since there's not much point in fully evaluating a package function twice), adding nil as a pre-commit hook, and officially setting the formatter to alejandra after 9dff1bai have also enabled nix lockfile maintenance for renovate, which should help us make sure we're able to consistently build against latest unstable :)