Nominatim is a powerful open-source geocoding tool that allows you to convert addresses into geographic coordinates, and vice versa. Here’s a step-by-step guide on how to install it on nixOS Latest.
Before we begin, you will need:
sudo nix-channel --update
sudo nixos-rebuild switch
sudo nix-env -i postgresql postgis osm2pgsql constantinople git cmake gcc postgresqlLibraries autoconf automake libtool make bzip2 libxml2 libxml2-utils libxslt libgcrypt with-gmp with-pcre with-zlib
git clone https://github.com/openstreetmap/Nominatim.git
cd Nominatim
mkdir build && cd build
cmake .. -DENABLE_HTTP:BOOL=OFF -DENABLE_UNACCENT:BOOL=ON
make
sudo make install
sudo -u postgres createuser --createdb nominatim
sudo -u postgres psql
ALTER USER nominatim WITH PASSWORD 'yourpassword';
\q
sudo su nominatim
cd Nominatim
./utils/setup.php --osm-file <path to your .osm.pbf file> --all --threads <number of threads>
sudo cp /usr/local/src/Nominatim/build/tpl/nginx.conf /etc/nginx/sites-available/nominatim
sudo ln -s /etc/nginx/sites-available/nominatim /etc/nginx/sites-enabled/nominatim
sudo systemctl reload nginx
sudo systemctl restart postgresql
Congratulations! You have successfully installed Nominatim on nixOS Latest. You can now use it to geocode addresses and perform other geographic data analysis tasks.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!