How to show the effect of toggling configuration value in overlay using nix repl?

I wanted to figure out what happens when I toggle a value in an expression inside an overlay.

So I loaded the following in nix repl:

nixpkgs = import <nixpkgs> { overlays = [ (self: super: { haskell = self.lib.recursiveUpdate super.haskell { compiler.ghc8104 = (super.haskell.compiler.ghc8104.override { enableRelocatedStaticLibs = true; enableIntegerSimple = true; enableShared = false; }).overrideAttrs (old: { preConfigure = '' ${old.preConfigure or ""} echo "GhcLibHcOpts += -fPIC -fexternal-dynamic-refs" >> mk/build.mk echo "GhcRtsHcOpts += -fPIC -fexternal-dynamic-refs" >> mk/build.mk ''; }); }; }) ]; }

When in nix repl I do

 nixpkgs.haskell.compiler.ghc8104.override.__functionArgs

as expected I get (relevant parts for want to demonstrate:

{ (…) enableIntegerSimple = true; (…) }

When I toggle enableIntegerSimple in the first expression above to be enableIntegerSimple = false;

 nixpkgs.haskell.compiler.ghc8104.override.__functionArgs

still shows me

{ (…) enableIntegerSimple = true; (…) }

Why is that ?

To answer myself drvAttrs would be the right value here meaning nixpkgs.haskell.compiler.ghc8104.drvAttrs would show the ghc8104 derivation that would be built using my overlay above:

nix-repl> nixpkgs.haskell.compiler.ghc8104.drvAttrs
{ NIX_HARDENING_ENABLE = [ ... ]; __ignoreNulls = true; args = [ ... ]; buildInputs = [ ... ]; builder = "/nix/store/b45zavallnsvqwjs9wg9xw167jcs0935-bash-4.4-p23/bin/bash"; checkTarget = "test"; configureFlags = [ ... ]; configurePlatforms = [ ... ]; depsBuildBuild = [ ... ]; depsBuildBuildPropagated = [ ... ]; depsBuildTarget = [ ... ]; depsBuildTargetPropagated = [ ... ]; depsHostHost = [ ... ]; depsHostHostPropagated = [ ... ]; depsTargetTarget = [ ... ]; depsTargetTargetPropagated = [ ... ]; doCheck = false; doInstallCheck = false; dontAddExtraLibs = true; enableParallelBuilding = true; enableParallelChecking = true; hardeningDisable = [ ... ]; name = "ghc-8.10.4"; nativeBuildInputs = [ ... ]; outputs = [ ... ]; patches = [ ... ]; postInstall = "# Install the bash completion file.\ninstall -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc\n\n# Patch scripts to include \"readelf\" and \"cat\" in $PATH.\nfor i in \"$out/bin/\"*; do\n  test ! -h $i || continue\n  egrep --quiet '^#!' <(head -n 1 $i) || continue\n  sed -i -e '2i export PATH=\"$PATH:/nix/store/7sjz9m88abiqqg9h6cvk7cg0va9p0ylv-binutils-wrapper-2.35.1/bin:/nix/store/nvlnl2swxmk50x25mzn71rhc0gzpylfr-coreutils-8.32/bin\"' $i\ndone\n"; postPatch = "patchShebangs ."; preConfigure = "for env in $(env | grep '^TARGET_' | sed -E 's|\\+?=.*||'); do\n  export \"${env#TARGET_}=${!env}\"\ndone\n# GHC is a bit confused on its cross terminology, as these would normally be\n# the *host* tools.\nexport CC=\"/nix/store/q65l6lvzgbrv64p5iib8jvpj5zc2mans-gcc-wrapper-10.3.0/bin/cc\"\nexport CXX=\"/nix/store/q65l6lvzgbrv64p5iib8jvpj5zc2mans-gcc-wrapper-10.3.0/bin/cxx\"\n# Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177\nexport LD=\"/nix/store/7sjz9m88abiqqg9h6cvk7cg0va9p0ylv-binutils-wrapper-2.35.1/bin/ld.gold\"\nexport AS=\"/nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/as\"\nexport AR=\"/nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/ar\"\nexport NM=\"/nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/nm\"\nexport RANLIB=\"/nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/ranlib\"\nexport READELF=\"/nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/readelf\"\nexport STRIP=\"/nix/store/fh9f7pr9kxfwvs8lm4479lvhrkzmmkdw-binutils-2.35.1/bin/strip\"\n\necho -n \"BuildFlavour = \nifneq \\\"\\$(BuildFlavour)\\\" \\\"\\\"\ninclude mk/flavours/\\$(BuildFlavour).mk\nendif\nBUILD_SPHINX_HTML = YES\nBUILD_SPHINX_PDF = NO\nHADDOCK_DOCS = YES\nDYNAMIC_GHC_PROGRAMS = NO\nINTEGER_LIBRARY = integer-gmp\nGhcLibHcOpts += -fPIC\nGhcRtsHcOpts += -fPIC\n\" > mk/build.mk\nsed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure\nexport NIX_LDFLAGS+=\" -rpath $out/lib/ghc-8.10.4\"\n echo \"GhcLibHcOpts += -fPIC -fexternal-dynamic-refs\" >> mk/build.mk echo \"GhcRtsHcOpts += -fPIC -fexternal-dynamic-refs\" >> mk/build.mk "; propagatedBuildInputs = [ ... ]; propagatedNativeBuildInputs = [ ... ]; src = «derivation /nix/store/8mgwalbpvq335zmshw5dikykha53cw7m-ghc-8.10.4-src.tar.xz.drv»; stdenv = «derivation /nix/store/42xskgypv940ynixcg88kz6inwl1r20z-stdenv-linux.drv»; strictDeps = true; stripDebugFlags = [ ... ]; system = "x86_64-linux"; userHook = null; version = "8.10.4"; }

See the overlay settings in this case applied to section preConfigure = "...";