pixelfed-from-lock #23
Loading…
Reference in a new issue
No description provided.
Delete branch "pixelfed-from-lock"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This takes the package from the nixpkgs input instead of whatever pkgs is. This way the module can be imported into NixOS stable and still use the same package.
Haven't done the other services; still testing...
@ -23,0 +45,4 @@
./vm/pixelfed-vm.nix
self.nixosModules.fediversity
];
};
Can you explain what makes this organization better than the one we currently have? I don't have an intuition either way so I'd like to understand the motivation for the change.
I implemented a variation on your changes here
d910dfe788
. Let me know what you think.46385f6174
to1fc83f6980
I prefer to avoid overlays, and I think we should decide the package version for our users, because that's essential for being able to control quality.
I did make a mistake coding this up (during a meeting fwiw), so what I really intended was to also have
46385f6174..1fc83f6980
So it makes the modules actually use the packages from the nixpkgs that we're locking and testing in this repo.
Alternatively, we could take them from
self.packages
instead.Oh wait no actually that
pkgs
it referenced wasinputs.nixpkgs.legacyPackages
anyway, but I got confused for a sec. Anyway, it's more flexible now, and if you import it into anaarch64-linux
NixOS, at least you'll get an error early.I am now quite convinced with deciding the package version for our users. I fail to see the link with overlays; what's wrong with them?
It's a mechanism for modifying the package set; not purely extending them. This makes them less modular than other mechanisms, because if any two overlays touch the same attribute, we now have to reason about their effect and keep track of the order in which those overlays are applied.
We're also using the module system, which - while it has mechanisms to handle this ordering - they aren't capable enough, and nobody should have to even think about such an unnecessary complexity.
In other words, they're a form of "global" state, not unlike
/usr
on a traditional distribution.The insidious things is that it works fine most of the time, until you get yourself into a mess with a project that doesn't just add its own unique attribute.
When writing reusable modules, we are not the arbiter of the
nixpkgs.overlays
option anymore. That's up to the user of the module. We'd have to inform them which attributes we change in their Nixpkgs, and they'd have to be ok with those changes.That's not how it works in practice. The process is just trial and error.
While the error part in trial and error tends to be rare, we didn't come here to maybe replicate the issues of
/usr
.So the question becomes, what mechanisms do we have?
From this we can infer their purpose:
So to answer the question, the only thing wrong with overlays is their usage in adding new and independent packages. They are ok for making changes to existing packages, because in that use case we've already accepted the fundamental issues with "global state" and with overriding. However, we don't need that.
That's not to say that we mustn't ever use overlays.
We may get into a situation where we need to override a deep dependency, and overlays are the best mechanism for that. However, that doesn't mean that we have to force overlays on the module's users. Instead we can apply the overlay to our local
pkgs
in this flake, so that it has the overrides (and only the overrides we want), and then we can refer to thatpkgs
instead of the NixOS globalpkgs
module argument that is controlled by our user.Ah, I didn't realise this was still tracking
pixelfed-on-metal
and had not shifted to targettingmain
. I fear you might have to open a new PR.I just wasted hours on a project that defined
sources
in an overlay for convenient access to the pins. Isn't a package, so should be fine? Nope. It affects allcallPackage
calls where the function has a default forsources
, including a dependency ofgitlab
.Completely unrelated error of course, and I was lucky to find it as soon as I did - basically unsolvable unless you're already aware of these risks.