From 2da4b12266322a3cfb7aa31cc24cfa591eb4e3d0 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 12 Aug 2020 16:28:39 +0100 Subject: Consume buildHaskell functions Use the newly defined `buildHaskell` function for a few of my existing Haskell projects. So far, it works as intended! --- scratch/brilliant/default.nix | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'scratch') diff --git a/scratch/brilliant/default.nix b/scratch/brilliant/default.nix index 5a0ece741764..5fba20d6704d 100644 --- a/scratch/brilliant/default.nix +++ b/scratch/brilliant/default.nix @@ -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 = []; } -- cgit 1.4.1