mkdir -p app/src lib/src ; git mv app{_slash_,/}example.cabal ; git mv app{_slash_src_slash_,/src/}Main.hs ; git mv lib{_slash_,/}lib.cabal ; git mv lib{_slash_,/}Setup.hs ; git mv lib{_slash_src_slash_,/src/}Example.cf ; git mv lib{_slash_src_slash_,/src/}lex-fixes.patch
nix-build
nix-shell
Then you can build the library and then the app separately via cd lib && cabal v1-install && cd ../app && cabal v1-build
– with or without --nix=True
(or $HOME/.cabal/config
containing nix: True
).