2021-06-24 20:13:39 +03:00
|
|
|
rec {
|
|
|
|
# source: https://nixos.org/guides/nix-pills/override-design-pattern.html
|
|
|
|
# but with the ability to change the name of the override method
|
|
|
|
makeOverridable = kind: f:
|
2022-10-28 21:29:30 +03:00
|
|
|
let
|
|
|
|
inner = oldArgs:
|
|
|
|
(f oldArgs) // {
|
|
|
|
${kind} = newArgs: inner (oldArgs // newArgs);
|
|
|
|
};
|
|
|
|
in inner;
|
2021-06-24 20:13:39 +03:00
|
|
|
|
|
|
|
# create a flake with overridable options. useful because we can't pass
|
|
|
|
# fine-grained overrides to flakes otherwise, we can only change inputs
|
|
|
|
# (therefore, this can't change inputs per default, and that should also be unnecessary)
|
|
|
|
mkOvrOptsFlake = flakefn: makeOverridable "overrideOptions" flakefn { };
|
|
|
|
}
|