nix 2.16.1+dfsg-3 fails to build from source:
```
...
g++ -o src/libstore/tests/libnixstore-tests -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -lgtest_main -lgtest src/libstore/tests/libnixstore-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/tests/libnixutil-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid
g++ -o src/libexpr/tests/libnixexpr-tests -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -Wl,-z,relro -Wl,-z,now src/libexpr/tests/derived-path.o src/libexpr/tests/error_traces.o src/libexpr/tests/json.o src/libexpr/tests/primops.o src/libexpr/tests/trivial.o src/libexpr/tests/value/context.o -lgtest_main -lgtest -lgmock src/libstore/tests/libnixstore-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/tests/libnixutil-tests.a -lrapidcheck -lgtest_main -lgtest src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libexpr/libnixexpr.a -lboost_context -pthread -ldl src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libfetchers/libnixfetchers.a -pthread src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid -lgc -lpthread -ldl src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libfetchers/libnixfetchers.a -pthread src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid src/libstore/libnixstore.a -lsqlite3 -lm -lz -lcurl -lnghttp2 -lidn2 -lrtmp -lssh -lssh -lpsl -lnettle -lgnutls -lgssapi_krb5 -llber -lldap -llber -lzstd -lbrotlidec -lz -lsodium -pthread -pthread -ldl -lseccomp src/libutil/libnixutil.a -pthread -lcrypto -ldl -pthread -lbrotlienc -lbrotlicommon -lbrotlidec -lbrotlicommon -larchive -lnettle -lacl -llzma -lzstd -llz4 -lbz2 -lz -lxml2 -lz -L/usr/lib/x86_64-linux-gnu -lboost_context -lcpuid
/usr/bin/ld: cannot find -lssh: No such file or directory
/usr/bin/ld: cannot find -lssh: No such file or directory
/usr/bin/ld: cannot find -lssh: No such file or directory
/usr/bin/ld: cannot find -lssh: No such file or directory
collect2: error: ld returned 1 exit status
...
```
Full log: https://launchpadlibrarian.net/683922275/buildlog_ubuntu-mantic-amd64.nix_2.16.1+dfsg-3_BUILDING.txt.gz
It currently builds on Debian sid with libssh2-1-dev using -lssh, but this seems to have a different behavior on Ubuntu, which seems to require -lssh2. I could not find the right place in the source tree to make that change.
-lssh is defined in curl package config '/usr/lib/ */pkgconfig/ libcurl. pc'.
It is read via MODULES( [LIBCURL] , [libcurl], [CXXFLAGS= "$LIBCURL_ CFLAGS $CXXFLAGS"])
`# Look for libcurl, a required dependency.
PKG_CHECK_
`
in configure.ac
libcurl depends on libssh-dev where as nix does not have this dependency.
adding libssh-dev to the control file solves the failure to build.