From 9164dbadad60ca5594c9dbc4fabebe62e7c9a123 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 3 Nov 2014 23:56:37 +0100 Subject: add default.nix and env.nix --- default.nix | 22 ++++++++++++++++++++++ env.nix | 25 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 default.nix create mode 100644 env.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..68be292 --- /dev/null +++ b/default.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {}, devel ? false }: + +with pkgs.haskellPackages; + +cabal.mkDerivation (self: { + pname = "cgroup-server"; + version = "0.1.0.0"; + src = if devel then ./. else pkgs.fetchgit { + url = http://viljetic.de/~tv/git/cgroup-server; + sha256 = "e48d52730d5c6eb190c9dd38b853c81441e3aae87b3ffbfeaa97cca28b94d8ce"; + rev = "d0129ff4d13cedbc6d1b85cadddc724783c8002a"; + }; + isLibrary = false; + isExecutable = true; + buildDepends = [ + aeson attoparsec filepath httpTypes ioStreams safe text wai warp + ]; + meta = { + license = self.stdenv.lib.licenses.bsd3; + platforms = self.ghc.meta.platforms; + }; +}) diff --git a/env.nix b/env.nix new file mode 100644 index 0000000..2b6aae1 --- /dev/null +++ b/env.nix @@ -0,0 +1,25 @@ +let + name = "cgroup-server"; + version = "1"; + buildInputs = with pkgs; [ + hsEnv + ]; + extraCmds = with pkgs; '' + export HISTFILE="\$HOME/.history/env-${name}" + $(grep export ${hsEnv.outPath}/bin/ghc) + ''; + pkgs = import {} // (with pkgs; { + }); + hsEnv = pkgs + .haskellPackages_ghc783_profiling + .ghcWithPackages (hsPkgs: with hsPkgs; + let + in + (callPackage ./. { devel = true; }).nativeBuildInputs ++ [ + cabalInstall + ]); +in pkgs.myEnvFun { + name = "${name}-${version}"; + inherit buildInputs extraCmds; +} +# vim: set fdm=marker : -- cgit v1.2.3