Skip to content

Instantly share code, notes, and snippets.

@rvl

rvl/Main.hs Secret

Created September 8, 2020 02:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rvl/fc06de95a9d99c144d82ec8f8b62f401 to your computer and use it in GitHub Desktop.
Save rvl/fc06de95a9d99c144d82ec8f8b62f401 to your computer and use it in GitHub Desktop.
cabal-version: >=1.10
name: cabal-test-nix-shell
version: 0.1.0.0
author: Rodney Lorrimar
maintainer: dev@rodney.id.au
build-type: Simple
executable cabal-test-nix-shell
main-is: Main.hs
build-depends: base >=4.12 && <4.15
, bytestring
, zlib
default-language: Haskell2010
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Codec.Compression.GZip
import qualified Data.ByteString.Lazy.Char8 as L8
main :: IO ()
main = L8.putStrLn $ decompress "\US\139\b\NUL\NUL\NUL\NUL\NUL\NUL\ETX\243H\205\201\201\215Q\240H,\206\ACK\178\DC4\SOH\204\178\139\v\SI\NUL\NUL\NUL"
import Distribution.Simple
main = defaultMain
{ pkgs ? import <nixpkgs> {} }:
let
ghc = pkgs.haskell.compiler.ghc865;
# ghc = haskell.compiler.ghc8102; # becomes warning: [-Wmissed-extra-shared-lib]
in
pkgs.mkShell {
buildInputs = with pkgs; [
cabal-install
ghc
pkgconfig
zlib.dev
];
shellHook = ''
eval $(egrep ^export ${ghc}/bin/ghc)
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment