Consume buildHaskell functions

Use the newly defined `buildHaskell` function for a few of my existing Haskell
projects. So far, it works as intended!
This commit is contained in:
William Carroll 2020-08-12 16:28:39 +01:00
parent 4ea55dd013
commit 2da4b12266
3 changed files with 45 additions and 57 deletions

View file

@ -1,26 +1,16 @@
let
pkgs = import (builtins.fetchGit {
url = "https://github.com/NixOS/nixpkgs-channels";
ref = "nixos-20.03";
rev = "afa9ca61924f05aacfe495a7ad0fd84709d236cc";
}) {};
ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
optparse-applicative
unordered-containers
split
]);
in pkgs.stdenv.mkDerivation {
briefcase = import /home/wpcarro/briefcase {};
in briefcase.buildHaskell.program {
name = "transform-keyboard";
buildInputs = [];
src = builtins.path {
srcs = builtins.path {
path = ./.;
name = "transform-keyboard-src";
};
buildPhase = ''
${ghc}/bin/ghc ./Main.hs
'';
installPhase = ''
mkdir -p $out && mv Main $out/transform-keyboard
'';
deps = hpkgs: with hpkgs; [
optparse-applicative
unordered-containers
split
rio
];
ghcExtensions = [];
}