Remove systems and flake-parts dependencies#3
Remove systems and flake-parts dependencies#3Andrew15-5 wants to merge 1 commit intotypst:init-flakefrom
Conversation
|
I took the time to carefully check the diff of your PR. From what I can see, you essentially re-implemented what flake-parts already provides... except now it’s custom code, specific to this repository, and not documented anywhere. If I had to choose between the two options today, I would absolutely pick the one that is well documented, actively maintained, and widely used across the community. In this case, that’s flake-parts. I’m being honest here: I don’t really understand the reasoning.
The way you're phrasing this feels quite subjective which is fine, of course. But I might be misunderstanding your point. Could you elaborate on how those inputs are complicating the configuration in practice?
That part is indeed true of any framework or higher-level abstraction: you trade some freedom for structure.
This can certainly feel true depending on one’s experience. Personally, I find that the benefits of the flake-parts module system outweigh the cost of learning it, but I agree it introduces an additional layer.
I don't fully agree here. Flake-parts mainly helps structure the project; it doesn’t inherently reduce portability. The underlying flake interface remains the same.
I would say this isn’t necessarily the case. Nix allows overriding and pinning pretty much anything, whether you use flake-parts or not.
This is probably the clearest drawback. Still,
I think this mostly comes down to personal preference. Some people prioritise minimalism; others prioritise maintainability, structure, or familiarity.
Line count matters to some extent, but in my experience the real question is maintainability. Flake-parts doesn’t meaningfully increase LoC for most projects, and the benefit of bringing the Nix module system to flakes can be significant... especially in larger or more complex repositories where structure becomes important. One last thing: it looks like you're recommending adopting Alejandra, while the Nix project itself uses the official formatter ( To conclude: I do not agree with removing those two dependencies. If we start removing them in the name of minimalism, then we should logically keep the door open to even more minimalism. In that case, why stop there? Perhaps we should also consider removing flakes entirely (which is exactly what I experimented with here: drupol/infra#122), because Flake is actually nothing else than a framework (sadly, it is as of Dec 2025 still considered as experimental). Frameworks exist for a reason: to help us manage structure and complexity. |
|
The problem I faced is not being able to use It's very sad that Nixpkgs library still doesn't have a wrapper just for this. IMO, it will 100% make I now tried using a simpler And to prove the claims, just look at the flake in Nixpkgs. It uses the exact same thing, but it can only provide
Basically, it's not part of flake schema/feature, nor part of Rust in Nix is pretty wild, so I don't care which of ten different ways everything will be compiled/build. Separately building all the dependencies in hopes that you don't work on a PR that constantly changes some of them (https://github.com/typst/typst/pull/7519)...is smart, but probably only hurts if you do work on such a change. So for most stuff, it's a pretty good solution to reduce re-compilation time. But this makes For me, it's almost as if you want to use However, unlike And In other words,
This newer implementation is simple enough that there is no maintenance overhead. Technically, both have some maintenance overhead, but both are about the same and both are very negligible. I didn't really answer everything, but I think the new implementation shifts some stuff, so maybe some of that is irrelevant now.
Why? Because the point of the repository is to have a flake. No flake, no need for repository. As simple as that. Moreover, I've heard somewhere that flakes will probably forever be in the experimental state, so for years this doesn't hold any weight in not using them. Everyone uses it, if not, then some use other pinning frameworks to have a lock file with all the dependencies for reproducibility. Flakes is a native framework, so it's much more convenient and very widely used, including Nixpkgs, and many other projects (Typst, Dioxus, to name just a few).
How can you talk about minimalism, if flake already has a formatter set as a dependency from Nixpkgs? Choosing formatter doesn't change anything, other than the way of formatting. Have you read the README of the project? In short, it's much faster than the "official" one and more patch-friendly as it moves arguments on separate lines. And overall, the readability improves. And I'm not the first to say that. After I shared some code snippets in Nix / NixOS room somewhat said that I should use it, and after reading I did, because I don't see any reason not to. You still will format with |
|
Thanks for taking the time to expand on your position. I appreciate it. Let me try to address this for the very last time, as clearly as possible.
To conclude, and to be completely transparent:
These conversations tend to generate heat, not light. All I care about is:
Given all that, my stance remains unchanged from my previous comment. Thanks again for the discussion. |
| imports = [ | ||
| inputs.flake-parts.flakeModules.easyOverlay | ||
| let | ||
| systems = [ | ||
| "aarch64-darwin" | ||
| "aarch64-linux" | ||
| "x86_64-darwin" | ||
| "x86_64-linux" | ||
| ]; | ||
|
|
There was a problem hiding this comment.
It's worth noting that easyOverlay is doing something. Do we know if we can easily replace it?
As a minimalist, and after seeing how "convenient" inputs can only complicate the config, rather than simplify it, I don't like that there are
flake-partsandsystems.In short, it creates unnecessary dependencies, which in turn
flake.lock, slowing down the initial download, and increasing Internet traffic for little to no benefitFirst time I discovered this from @PartyWumpus here, and that flake config can be shorter without
flake-utils.Since then, I wrote several flakes without any of those
systems/flake-parts/flake-utilsnonsense, and also rewrote some other ones (like ejecting fromdevenv, that is also restrictive). This made my flakes minimal and more accessible to be copied partly or fully by others, without using any new tech someone doesn't like/know about.I didn't reformat everything yet, only the new part.
As you can see, it produces 34 - 62 = -28 lines total, plus removing the overhead of downloading, extracting and evaluating 3 dependencies.
This shows that it works the exact same way, transparently substituting one wrapper with another, while all the other lines stay untouched. After reformat, it won't look the same.
The unfortunate part is that I don't know if there is a more straightforward ways to transform
system.name.valuetoname.system.value. Usingnixpkgs.libwill produce the same amount of code, but part of it will beinheriting a bunch of pre-made functions, instead of using a more native way without any lib stuff.