From f37ff63678f8b8d6f554bc694f5d8faf2fb9ee25 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 21 Apr 2018 16:32:38 +0200 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ymir/mlmmj-expose.nix | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'ymir') diff --git a/ymir/mlmmj-expose.nix b/ymir/mlmmj-expose.nix index b3f7499c..40645b93 100644 --- a/ymir/mlmmj-expose.nix +++ b/ymir/mlmmj-expose.nix @@ -1,7 +1,6 @@ { config, pkgs, ... }: let - haskellEnv = pkgs.haskellPackages.ghcWithPackages dependencies; dependencies = pkgs: with pkgs; [ filepath directory cryptonite @@ -10,24 +9,26 @@ let aeson aeson-pretty ]; - mlmmj-exposed = pkgs.stdenv.mkDerivation { - name = "mlmmj-expose"; - src = pkgs.substituteAll { - src = ./mlmmj-expose.hs; - inherit (pkgs) mlmmj; - }; - buildCommand = '' - mkdir -p $out/bin - #cp $src $out/bin/.mlmmj-exposed - ${haskellEnv}/bin/ghc -o $out/bin/.mlmmj-expose -odir . -hidir . $src - for f in mlmmj-exposed mlmmj-expose mlmmj-get-exposed mlmmj-serve-exposed; do - ln -s .mlmmj-expose $out/bin/$f - done - ''; - }; + in rec { - nixpkgs.config.packageOverrides = pkgs: rec { - inherit mlmmj-exposed; - }; + nixpkgs.config.overlays = [(self: super: { + mlmmj-exposed = super.stdenv.mkDerivation { + name = "mlmmj-expose"; + src = super.substituteAll { + src = ./mlmmj-expose.hs; + inherit (pkgs) mlmmj; + }; + buildCommand = let + haskellEnv = self.haskellPackages.ghcWithPackages dependencies; + in '' + mkdir -p $out/bin + #cp $src $out/bin/.mlmmj-exposed + ${haskellEnv}/bin/ghc -o $out/bin/.mlmmj-expose -odir . -hidir . $src + for f in mlmmj-exposed mlmmj-expose mlmmj-get-exposed mlmmj-serve-exposed; do + ln -s .mlmmj-expose $out/bin/$f + done + ''; + }; + })]; environment.systemPackages = [ mlmmj-exposed ]; } -- cgit v1.2.3