Normally you would make those paths a parameter to the function, so it can be overriden in nixpkgs config or nixos config.