Nix Overrides That Expire Themselves
27 points by DerGuteMoritz
27 points by DerGuteMoritz
Yes! I also do this to remind myself to remember (and acknowledge) the manual upgrade procedures for certain services, like Forgejo:
assertions = [
{
assertion = config.services.forgejo.package.version == "15.0.5";
message = "forgejo upgrades require manual intervention, see https://forgejo.org/docs/latest/admin/upgrade/ and then change the version assertion in ${toString ./forgejo.nix} to ${config.services.forgejo.package.version}";
}
];
That's a useful pattern. Another exemple: https://github.com/NixOS/nixpkgs/pull/545424#issuecomment-5162528549
Seems like a nice generic pattern, something like "notify when an external change requires local maintenance"
I've done this with Ruby Monkey Patches for years, especially when we're backporting something or waiting for a method to land upstream in a PR. Check if the method exists, the version has gone higher and then warn (or depending on how conflicty it is - raise error) loudly the monkey patch needs updating or deleting.
I normally do this with just an assert, since it's easy enough and I don't generally need to preserve the ability to actually continue the build if the assert trips (as it's my local config).
The most common way this shows up for me is when I'm adding something to a package set in an overlay I'll assert that it doesn't already exist in the set, so that way I can find out if it ever gets added upstream to nixpkgs.