So I run into this a lot. I will be writing some script and find a really useful function defined in the “let” section of another package or module; but really the only way to use it is to copy and paste the whole thing into my file.
Is there a cleaner way to call on those functions that I’m unaware of?
Otherwise it might be worthwhile to move several of those functions into “lib” style files for this purpose. Customizing documentation code was specifically what got me thinking about this, but I find that It’s a common occurrence.
Ex: Lets say I want to borrow an arbitrary function foo
.
{config, lib, pkgs, ... }:
let
foo = x: { ... loads of useful code ... };
in mkDerivation { ... }