4 ms·
nix overlays are one of the killer features of nix[os] trivial to make a minor tweak or even used a forked repo without changing anything else in the system in
by jeppesen-io 5y ago
nix overlays are one of the killer features of nix[os]
trivial to make a minor tweak or even used a forked repo without changing anything else in the system in regards to installing packages,upgrading or maintaining. Completely transparent
I don't really understand the Monoid part of this post though
- whateveracct 5y agoMonoid is just a binary associative "mappend" function + an identity "mempty" to that function such that "mappend whatever mempty = whatever" It's a very common structure across programming domains. The identity overlay is "self: super: {}" Overlay combination is associative. If you have N overlays, it doesn't matter the order to apply them left-to-right. In fact, I believe overlays are also commutative. Which makes sense - it would be silly if you wrote an overlay in isolation and how it worked depended on where it landed in your overlays list.
- Gabriel439 5y agoThe order in which you combine overlays can sometimes matter. In other words, overlays are monoids, but not commutative monoids. That said, most of the time overlay order does not matter
- whateveracct 5y agoAh that's true thinking about it. If I have two overlays that both set some value to X..one's gotta win!
- cmm 5y ago> In fact, I believe overlays are also commutative. No. But "nice" overlays probably should have this property, since commutativity means orthogonality.