about summary refs log tree commit diff
path: root/pkgs/wywozik-todo/default.nix
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-10-09 11:36:00 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-10-09 11:36:00 +0200
commitba20aa6ab704519a2259b425c207f38d48f07f8f (patch)
tree1f73c5f1f2cfabee4164049af17afc5ef589af25 /pkgs/wywozik-todo/default.nix
parent1af1f9dd345ebb116e2a7002e9445583136b0464 (diff)
downloadpnpkgs-ba20aa6ab704519a2259b425c207f38d48f07f8f.tar.gz
pnpkgs-ba20aa6ab704519a2259b425c207f38d48f07f8f.zip
Add wywozik-todo
Diffstat (limited to 'pkgs/wywozik-todo/default.nix')
-rw-r--r--pkgs/wywozik-todo/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/wywozik-todo/default.nix b/pkgs/wywozik-todo/default.nix
new file mode 100644
index 0000000..37fccfb
--- /dev/null
+++ b/pkgs/wywozik-todo/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, runCommand, fetchgit, python3,
+configFile ? ''
+  CITY = "Poznań"
+  STREET = "ul. Święty Marcin"
+  NUMBER = "1"
+  HOUSING = "zamieszkana"
+  TOKEN = "token"
+''
+}:
+with stdenv.lib;
+
+let
+  packages = p: with p; [
+    requests
+  ];
+  py = python3.withPackages packages;
+in
+stdenv.mkDerivation {
+  name = "wywozik-todo";
+
+  src = fetchgit {
+    url = "https://github.com/pniedzwiedzinski/wywozik-todo";
+    rev = "d214fda2a4c9900086f2d0678a2d6f96ce7a69df";
+    sha256 = "1lsmgh07dz0iqw3kd6yq7m2rpss7jx8721jmh2vyvnbybb1cna37";
+  };
+
+  buildInputs = [ py ];
+
+  buildPhase = ''
+      sed -i '1s:^:#!${py}/bin/python\n:' main.py
+      chmod +x main.py
+  '';
+
+  installPhase = ''
+      mkdir -p $out/bin
+      cp main.py $out/bin/wywozik-todo
+      echo '${configFile}' > $out/bin/config.py
+  '';
+
+  meta = {
+    homepage = "https://github.com/pniedzwiedzinski/wywozik-todo";
+  };
+}