diff --git a/chandelorean/__init__.py b/chandelorean/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/setup.py b/setup.py deleted file mode 100644 index 7c64415..0000000 --- a/setup.py +++ /dev/null @@ -1,22 +0,0 @@ -from setuptools import setup - -requires = [ - 'aiohttp', - 'aiofiles', - 'aiodns' -] - -setup( - name='chandelorean', - version='0.0.1', - description="Imageboard style forum that lets you time travel. Meant to be an archive.", - classifiers=[ - "Programming Language :: Python", - "Topic :: Internet :: WWW/HTTP", - ], - author='Zer0-', - author_email='paul_cockshott@protonmail.com', - packages=['chandelorean'], - include_package_data=True, - install_requires=requires, -) diff --git a/shell.nix b/shell.nix index 3f2ad45..8617927 100644 --- a/shell.nix +++ b/shell.nix @@ -1,15 +1,34 @@ -{ pkgs ? import {} }: - +{ nixpkgs ? import {}, compiler ? "default", doBenchmark ? false }: let - shell = pkgs.mkShell { - buildInputs = with pkgs; - [ - python3 - postgresql - #python3Packages.regex - ]; - }; + + inherit (nixpkgs) pkgs; + + f = { mkDerivation, base, stdenv, cabal-install, + aeson + }: + mkDerivation { + pname = "chan-delorean"; + version = "0.0.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + base safe-exceptions aeson + ]; + testHaskellDepends = [ cabal-install ]; + license = "unknown"; + }; + + haskellPackages = if compiler == "default" + then pkgs.haskellPackages + else pkgs.haskell.packages.${compiler}; + + variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; + + drv = variant (haskellPackages.callPackage f { + req = req; + }); in - shell + if pkgs.lib.inNixShell then drv.env else drv