about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--default.nix1
-rw-r--r--pkgs/wywozik-todo/default.nix43
2 files changed, 44 insertions, 0 deletions
diff --git a/default.nix b/default.nix
index 5f0b479..104a932 100644
--- a/default.nix
+++ b/default.nix
@@ -19,6 +19,7 @@
   dockd = pkgs.callPackage ./pkgs/dockd { };
   simple-mtpfs = pkgs.callPackage ./pkgs/simple-mtpfs { };
   task-spooler = pkgs.callPackage ./pkgs/task-spooler { };
+  wywozik-todo = pkgs.callPackage ./pkgs/wywozik-todo { };
 
   st = pkgs.callPackage ./pkgs/larbs/st { };
   dwm = pkgs.callPackage ./pkgs/larbs/dwm { };
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";
+  };
+}