Geospatial NIX provides weekly updated geospatial packages and tools built on top of the latest stable Nixpkgs branch for creating isolated and reproducible geospatial environments.
Check out the user interface at https://geospatial-nix.today/ .
- Install Nix (learn more about this installer)
curl --proto '=https' --tlsv1.2 -sSf \
-L https://install.determinate.systems/nix \
| sh -s -- install
- Show Geospatial NIX content
nix flake show github:imincik/geospatial-nix
- Launch the latest stable QGIS version
nix run github:imincik/geospatial-nix#qgis
- Launch QGIS LTR version
nix run github:imincik/geospatial-nix#qgis-ltr
- Initialize new environment
mkdir my-project
cd my-project
git init
nix run github:imincik/geospatial-nix#geonixcli -- init
git add *
-
Edit
geonix.nix
file according to your project requirements (check out examples for example configurations) -
Launch shell environment
nix run .#geonixcli -- shell
- Build single package
nix build .#<PACKAGE>
- Build all packages
nix build .#all-packages
- Build a single package and push it to the Geonix binary cache
nix build --json .#<PACKAGE> | jq -r '.[].outputs | to_entries[].value' | cachix push geonix
- Build all packages and push them to the Geonix binary cache
nix build --json .#all-packages | jq -r '.[].outputs | to_entries[].value' | cachix push geonix
- Run package passthru tests
nix build -L .#<PACKAGE>.tests.<TEST-NAME>
To an re-build already built package or to re-run already succeeded tests, use the
--rebuild
switch.
- Explore derivation
nix show-derivation .#<PACKAGE>
- Explore package store path content
nix path-info -rsSh .#<PACKAGE> | sort -nk3
- Explain package dependencies
nix why-depends .#<PACKAGE> .#<DEPENDENCY>
-
Monday (1 AM): automatic update of base packages from latest stable Nixpkgs branch (nix flake update)
-
Monday - Thursday: development and updates of geospatial packages in Nixpkgs master
-
Thursday - Friday: pull from Nixpkgs master to Geospatial NIX master, integration, testing
-
Monday (1 AM): automatic release of new version
- Create a
pkgs-weekly-update
branch to collect all package updates in this branch and create PR (Monday)
git checkout -b pkgs-weekly-update-$(date "+%Y-%V")
git push --set-upstream origin pkgs-weekly-update-$(date "+%Y-%V")
-
Merge automatically created flake update PR (
flake-update-action-pr
branch) in topkgs-weekly-update
branch -
Submit
pkgs-weekly-update
PR
git pull
gh pr create --title "pkgs: weekly update $(date "+%Y-%V")"
- Pull from the latest Nixpkgs master (Thursday - Friday)
utils/pull-nixpkgs.sh <NIXPKGS-DIR>
-
Review changes, identify related PRs in Nixpkgs, split changes to separate commits (link to Nixpks PR in commit message)
-
Optional: generate a reverse patch for changes which are not desired
git diff -R <CHANGED-FILE> > pkgs/<PACKAGE>/nixpkgs/<PATCH-NAME>.patch
- Build and test all packages
nix build --json .#all-packages | jq -r '.[].outputs | to_entries[].value' | cachix push geonix
nix flake check
nix build --json .\#test-qgis.x86_64-linux | jq -r '.[].outputs | to_entries[].value' | cachix push geonix
nix build --json .\#test-qgis-ltr.x86_64-linux | jq -r '.[].outputs | to_entries[].value' | cachix push geonix
- Merge
pkgs-weekly-update
PR (Friday, Saturday)