Skip to content

Commit

Permalink
Add Nix support
Browse files Browse the repository at this point in the history
  • Loading branch information
np committed Oct 7, 2015
1 parent 9d3dd22 commit 5986196
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions c2n-regen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cabal2nix . > hlatex.nix
# cabal2nix cabal://X-VERSION > nix/X.nix
7 changes: 7 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7101" }:
let
callPackage = nixpkgs.pkgs.haskell.packages.${compiler}.callPackage;
in
callPackage ./hlatex.nix {
# X = callPackage ./nix/X.nix {};
}
2 changes: 2 additions & 0 deletions env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
current_nixpkgs=$HOME/hub/np/nixpkgs
[ ! -d "$current_nixpkgs" ] || export NIX_PATH=nixpkgs=$current_nixpkgs
20 changes: 20 additions & 0 deletions hlatex.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{ mkDerivation, base, base-unicode-symbols, containers, derive
, directory, filepath, frquotes, mtl, process, stdenv
, template-haskell, transformers, uniplate, utf8-string
}:
mkDerivation {
pname = "hlatex";
version = "0.3.1";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
base base-unicode-symbols containers derive directory filepath mtl
process template-haskell transformers uniplate utf8-string
];
executableHaskellDepends = [
base base-unicode-symbols containers frquotes mtl transformers
];
description = "A library to build valid LaTeX files";
license = stdenv.lib.licenses.bsd3;
}
Empty file added nix/.gitkeep
Empty file.
14 changes: 14 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc7101" }:
nixpkgs.lib.overrideDerivation
(import ./default.nix { inherit nixpkgs compiler; }).env
(old:
{ buildInputs = old.buildInputs ++
(with nixpkgs.haskell.packages.${compiler}; [
cabal-install
# ghc-make
# ghc-mod
# hlint
# stylish-haskell
# pointfree
# pointful
]);})

0 comments on commit 5986196

Please sign in to comment.