Hi there
While I was writing nix functions to generate a derivation with a s6-rc directory from a definition, I encountered a weird bug when moving a function to a different file:
{ pkgs, ... }:
with pkgs.lib;
{
func = services:
something (otherFunc services);
otherFunc = //...
}
(see real code & error message here - run via nix build .#svcDir
)
I then played around until I figured out a weird way to fix it:
{ pkgs, ... }:
with pkgs.lib;
let
func = services:
something (otherFunc services);
otherFunc = //...
in {
inherit func;
}
(see real code & diff here)
I don’t care about the specific issue, but I’d like to understand what nix concepts I need to learn to understand this? (scopes?)