diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2023-10-31 13:35:51 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2023-12-10 13:25:24 +0100 |
commit | 78f5ed053aba713ea2fc1226ec8193d298c221fc (patch) | |
tree | 79ec99b760ddfd0c33d18690c9d977b28bec26c1 /lib | |
parent | bb7921d1d6a0df8ebdc36b8ee745fe704b93b846 (diff) | |
download | nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.tar nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.tar.gz nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.tar.bz2 nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.tar.lz nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.tar.xz nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.tar.zst nixlib-78f5ed053aba713ea2fc1226ec8193d298c221fc.zip |
lib/trivial: drop `rec` in favor of `lib` fixpoint
That way each expression uses the final version of other lib.trivial declarations. For instance, when replacing `versionSuffix` with the string `"fnord"` in a lib overlay, `trivial.version` uses `"fnord"` as suffix now rather than `pre-git`.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/trivial.nix | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix index caff77190fde..b3fb54a7add4 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -1,6 +1,18 @@ { lib }: -rec { +let + inherit (lib.trivial) + isFunction + isInt + functionArgs + pathExists + release + setFunctionArgs + toBaseDigits + version + versionSuffix + warn; +in { ## Simple (higher order) functions @@ -439,7 +451,7 @@ rec { */ functionArgs = f: if f ? __functor - then f.__functionArgs or (lib.functionArgs (f.__functor f)) + then f.__functionArgs or (functionArgs (f.__functor f)) else builtins.functionArgs f; /* Check whether something is a function or something |