summaryrefslogtreecommitdiff
path: root/ymir/mlmmj-expose.nix
diff options
context:
space:
mode:
Diffstat (limited to 'ymir/mlmmj-expose.nix')
-rw-r--r--ymir/mlmmj-expose.nix39
1 files changed, 20 insertions, 19 deletions
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 @@
1{ config, pkgs, ... }: 1{ config, pkgs, ... }:
2 2
3let 3let
4 haskellEnv = pkgs.haskellPackages.ghcWithPackages dependencies;
5 dependencies = pkgs: with pkgs; [ filepath 4 dependencies = pkgs: with pkgs; [ filepath
6 directory 5 directory
7 cryptonite 6 cryptonite
@@ -10,24 +9,26 @@ let
10 aeson 9 aeson
11 aeson-pretty 10 aeson-pretty
12 ]; 11 ];
13 mlmmj-exposed = pkgs.stdenv.mkDerivation { 12
14 name = "mlmmj-expose";
15 src = pkgs.substituteAll {
16 src = ./mlmmj-expose.hs;
17 inherit (pkgs) mlmmj;
18 };
19 buildCommand = ''
20 mkdir -p $out/bin
21 #cp $src $out/bin/.mlmmj-exposed
22 ${haskellEnv}/bin/ghc -o $out/bin/.mlmmj-expose -odir . -hidir . $src
23 for f in mlmmj-exposed mlmmj-expose mlmmj-get-exposed mlmmj-serve-exposed; do
24 ln -s .mlmmj-expose $out/bin/$f
25 done
26 '';
27 };
28in rec { 13in rec {
29 nixpkgs.config.packageOverrides = pkgs: rec { 14 nixpkgs.config.overlays = [(self: super: {
30 inherit mlmmj-exposed; 15 mlmmj-exposed = super.stdenv.mkDerivation {
31 }; 16 name = "mlmmj-expose";
17 src = super.substituteAll {
18 src = ./mlmmj-expose.hs;
19 inherit (pkgs) mlmmj;
20 };
21 buildCommand = let
22 haskellEnv = self.haskellPackages.ghcWithPackages dependencies;
23 in ''
24 mkdir -p $out/bin
25 #cp $src $out/bin/.mlmmj-exposed
26 ${haskellEnv}/bin/ghc -o $out/bin/.mlmmj-expose -odir . -hidir . $src
27 for f in mlmmj-exposed mlmmj-expose mlmmj-get-exposed mlmmj-serve-exposed; do
28 ln -s .mlmmj-expose $out/bin/$f
29 done
30 '';
31 };
32 })];
32 environment.systemPackages = [ mlmmj-exposed ]; 33 environment.systemPackages = [ mlmmj-exposed ];
33} 34}