summaryrefslogtreecommitdiffstats
path: root/spejstore/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'spejstore/default.nix')
-rw-r--r--spejstore/default.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/spejstore/default.nix b/spejstore/default.nix
new file mode 100644
index 0000000..c02da73
--- /dev/null
+++ b/spejstore/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, fetchgit, python3, python3Packages, makeWrapper, lib }:
+
+let
+ django_1_11 = pyPkgs: pyPkgs.django_1_11;
+ python = python3.override {
+ packageOverrides = self: super: {
+ django = django_1_11 super;
+ # we use some dependencies that are outside of nixpkgs
+ django-flat-responsive = self.callPackage ./python-modules/django-flat-responsive.nix { };
+ django-hstore = self.callPackage ./python-modules/django-hstore.nix { };
+ django-markdown2 = self.callPackage ./python-modules/django-markdown2.nix { };
+ django-select2 = self.callPackage ./python-modules/django-select2.nix { };
+ django-tree = self.callPackage ./python-modules/django-tree.nix { };
+ django-restframework-hstore = self.callPackage ./python-modules/django-restframework-hstore.nix { };
+ social-auth-app-django = self.callPackage ./python-modules/social-auth-app-django.nix { };
+ social-auth-core = self.callPackage ./python-modules/social-auth-core.nix { };
+ };
+ };
+in
+stdenv.mkDerivation rec {
+ name = "spejstore";
+
+ src = fetchgit {
+ url = "http://code.hackerspace.pl/ar/spejstore/";
+ rev = "6b5c97b6384c48d5b7adbe551683105d73ceb7b2";
+ sha256 = "1wgcj4fdqbrmvb2g09a1q6jriq00avxpc5cly75kxjhzc1bxxxfs";
+ };
+
+ nativeBuildInputs = [ makeWrapper ];
+
+ runtimePackages = with python.pkgs; [
+ certifi chardet django djangorestframework pillow psycopg2 requests urllib3 django_appconf setuptools
+ django-tree django-flat-responsive django-hstore django-select2 social-auth-app-django django-markdown2 django-restframework-hstore
+ ];
+
+ pythonEnv = python.withPackages (_: runtimePackages);
+ passthru = {
+ inherit python runtimePackages;
+ };
+
+ unpackPhase = ''
+ srcDir=$out/share/spejstore
+ mkdir -p $srcDir
+ cp -r --no-preserve=mode -t $srcDir $src/{manage.py,auth,spejstore,storage,static,templates}
+ '';
+
+ installPhase = ''
+ ${python.interpreter} -m compileall $srcDir
+ makeWrapper $pythonEnv/bin/python $out/bin/spejstore \
+ --add-flags $out/share/spejstore/manage.py
+
+ $out/bin/spejstore collectstatic
+ '';
+}