From 448046fd26c4f04cecde5b7496eaff746981ec67 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 2 Aug 2016 20:56:44 +0200 Subject: Framework --- Setup.hs | 2 ++ default.nix | 8 ++++++++ shell.nix | 19 +++++++++++++++++++ src/Main.hs | 4 ++++ trivstream.cabal | 21 +++++++++++++++++++++ trivstream.nix | 11 +++++++++++ 6 files changed, 65 insertions(+) create mode 100644 Setup.hs create mode 100644 default.nix create mode 100644 shell.nix create mode 100644 src/Main.hs create mode 100644 trivstream.cabal create mode 100644 trivstream.nix diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..26a2c3b --- /dev/null +++ b/default.nix @@ -0,0 +1,8 @@ +{ pkgs ? (import {}) +, compilerName ? "ghc801" +}: + +rec { + haskellPackages = pkgs.haskell.packages."${compilerName}"; + trivstream = haskellPackages.callPackage ./trivstream.nix {}; +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..6ed4ca8 --- /dev/null +++ b/shell.nix @@ -0,0 +1,19 @@ +{ pkgs ? (import {}) +, haskellPackages ? (import ./default.nix {}).haskellPackages +}: + +let + trivstreamPackages = builtins.attrValues (import ./default.nix {}); + ghc = haskellPackages.ghcWithPackages + (ps: trivstreamPackages ++ utilities ps ++ testDeps ps); + utilities = (ps: with ps; [ hlint cabal2nix ]); + testDeps = (ps: with ps; [ ]); +in +pkgs.stdenv.mkDerivation rec { + name = "trivstream-env"; + buildInputs = [ ghc ]; + shellHook = '' + eval $(egrep ^export ${ghc}/bin/ghc) + export PROMPT_INFO="${name}" + ''; +} diff --git a/src/Main.hs b/src/Main.hs new file mode 100644 index 0000000..c2e4af9 --- /dev/null +++ b/src/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = undefined diff --git a/trivstream.cabal b/trivstream.cabal new file mode 100644 index 0000000..7b257c8 --- /dev/null +++ b/trivstream.cabal @@ -0,0 +1,21 @@ +name: trivstream +version: 0.0.0 +synopsis: A trivial client & server for streaming audio over udp between pulseaudio & jack +-- description: +license: GPL-3 +license-file: LICENSE +author: Gregor Kleen +maintainer: aethoago@141.li +-- copyright: +category: Sound +build-type: Simple +extra-source-files: ChangeLog.md +cabal-version: >=1.10 + +executable trivstream + main-is: Main.hs + -- other-modules: + -- other-extensions: + build-depends: base >=4.9 && <5 + hs-source-dirs: src + default-language: Haskell2010 diff --git a/trivstream.nix b/trivstream.nix new file mode 100644 index 0000000..2521a88 --- /dev/null +++ b/trivstream.nix @@ -0,0 +1,11 @@ +{ mkDerivation, base, stdenv }: +mkDerivation { + pname = "trivstream"; + version = "0.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ base ]; + description = "A trivial client & server for streaming audio over udp between pulseaudio & jack"; + license = stdenv.lib.licenses.gpl3; +} -- cgit v1.2.3