From bda581585185b167192d10148caea21448514204 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Sat, 22 Jul 2017 21:14:52 +0100 Subject: [PATCH] hyper-haskell: init at 0.1.0.2 --- .../tools/haskell/hyper-haskell/default.nix | 50 +++++++++++++++++++ .../tools/haskell/hyper-haskell/server.nix | 21 ++++++++ pkgs/top-level/all-packages.nix | 14 ++++++ 3 files changed, 85 insertions(+) create mode 100644 pkgs/development/tools/haskell/hyper-haskell/default.nix create mode 100644 pkgs/development/tools/haskell/hyper-haskell/server.nix diff --git a/pkgs/development/tools/haskell/hyper-haskell/default.nix b/pkgs/development/tools/haskell/hyper-haskell/default.nix new file mode 100644 index 000000000000..31697750a702 --- /dev/null +++ b/pkgs/development/tools/haskell/hyper-haskell/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchFromGitHub, writeText, jshon, electron, hyper-haskell-server, extra-packages ? [] }: + +let + binPath = stdenv.lib.makeBinPath ([ hyper-haskell-server ] ++ extra-packages); + +in stdenv.mkDerivation rec { + name = "hyper-haskell-${version}"; + version = "0.1.0.2"; + + src = fetchFromGitHub { + owner = "HeinrichApfelmus"; + repo = "hyper-haskell"; + rev = "v${version}"; + sha256 = "1k38h7qx12z7463z8466pji0nwfkp4qkg7q83kns2mzmwmw5jnmb"; + }; + + propagatedBuildInputs = extra-packages; + + buildCommand = '' + mkdir -p $out/bin $out/share/hyper-haskell/worksheets $out/share/applications $out/share/icons/hicolor/scalable/apps $out/share/mime/packages + + # Electron app + cp -R $src/app $out + + # Desktop Launcher + cp $src/resources/hyper-haskell.desktop $out/share/applications/hyper-haskell.desktop + cp $src/resources/icons/icon.svg $out/share/icons/hicolor/scalable/apps/hyper-haskell.svg + cp $src/resources/shared-mime-info.xml $out/share/mime/packages/hyper-haskell.xml + + # install example worksheets with backend set to nix + for worksheet in "$src/worksheets/"*.hhs; do + ${jshon}/bin/jshon -e settings -s nix -i packageTool -p < $worksheet > $out/share/hyper-haskell/worksheets/`basename $worksheet` + done + + # install electron wrapper script + cat > $out/bin/hyper-haskell <