{ config, pkgs, ... }: let dependencies = pkgs: with pkgs; [ filepath directory cryptonite bytestring uuid aeson aeson-pretty ]; in rec { 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 = with pkgs; [ mlmmj-exposed ]; }