diff options
Diffstat (limited to 'default.nix')
-rw-r--r-- | default.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a828aa9 --- /dev/null +++ b/default.nix @@ -0,0 +1,45 @@ +{ pkgs ? import <nixpkgs> {} }: +with pkgs.python313Packages; + +let + sources = import ./npins; + pywikiapi = buildPythonPackage rec { + pname = "pywikiapi"; + version = "pinned"; + src = sources.pywikiapi; + + dependencies = [ + requests + ]; + }; + logformat = import "${sources.logformat}" {}; +in +buildPythonApplication rec { + pname = "osm-proposals"; + version = "git"; + src = ./.; + pyproject = true; + + build-system = [ + hatchling + ]; + + dependencies = [ + requests + mwparserfromhell + pywikiapi + logformat + ]; + + # smoke test + preCheck = "$out/bin/osm-proposals --help >/dev/null"; + + postInstall = '' + mkdir -p $out/share/osm-proposals + cp -r ${./static}/. $out/share/osm-proposals/ + ''; + + nativeCheckInputs = [ + pytestCheckHook + ]; +} |