From a0027b6763b812f0c65e7a93a906ca60cb083dc8 Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Thu, 10 Mar 2016 17:09:31 -0500 Subject: [PATCH] Nix configuration --- default.nix | 22 ++++++++++++++++++++++ shell.nix | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 default.nix create mode 100644 shell.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..4cf9fee --- /dev/null +++ b/default.nix @@ -0,0 +1,22 @@ +{ mkDerivation, base, either, exceptions, ffmpeg-full, JuicyPixels +, mtl, stdenv, transformers, vector, Rasterific, time +}: +mkDerivation { + pname = "ffmpeg-light"; + version = "0.11.0"; + src = builtins.filterSource (path: type: + type != "directory" || (let bn = baseNameOf path; + in bn == "src" || bn == "demo")); + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + base either exceptions JuicyPixels mtl transformers vector + ]; + libraryPkgconfigDepends = [ ffmpeg-full ]; + executableHaskellDepends = [ + base JuicyPixels mtl transformers vector Rasterific time + ]; + homepage = "http://github.com/acowley/ffmpeg-light"; + description = "Minimal bindings to the FFmpeg library"; + license = stdenv.lib.licenses.bsd3; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..4fc5422 --- /dev/null +++ b/shell.nix @@ -0,0 +1,38 @@ +{ nixpkgs ? import {}, compiler ? "default" }: + +let + + inherit (nixpkgs) pkgs; + + f = { mkDerivation, base, either, exceptions, ffmpeg-full, JuicyPixels + , mtl, stdenv, transformers, vector, Rasterific, time + }: + mkDerivation { + pname = "ffmpeg-light"; + version = "0.11.0"; + src = builtins.filterSource (path: type: + type != "directory" || (let bn = baseNameOf path; + in bn == "src" || bn == "demo")); + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + base either exceptions JuicyPixels mtl transformers vector + ]; + libraryPkgconfigDepends = [ ffmpeg-full ]; + executableHaskellDepends = [ + base JuicyPixels mtl transformers vector Rasterific time + ]; + homepage = "http://github.com/acowley/ffmpeg-light"; + description = "Minimal bindings to the FFmpeg library"; + license = stdenv.lib.licenses.bsd3; + }; + + haskellPackages = if compiler == "default" + then pkgs.haskellPackages + else pkgs.haskell.packages.${compiler}; + + drv = pkgs.myHaskellPackages.callPackage f {}; + +in + + if pkgs.lib.inNixShell then drv.env else drv