Skip to content

Instantly share code, notes, and snippets.

@unclechu
Last active July 20, 2020 01:59
Show Gist options
  • Save unclechu/240a7e35a810e7d9095efc4a15b1305d to your computer and use it in GitHub Desktop.
Save unclechu/240a7e35a810e7d9095efc4a15b1305d to your computer and use it in GitHub Desktop.
Safe nix-shell Haskell script (with sha1sum validation of nixpkgs pick)
#! /usr/bin/env nix-shell
#! nix-shell --pure -i runhaskell
#! nix-shell -E "with import (fetchTarball { url = \"https://github.com/NixOS/nixpkgs/archive/db31e48c5c8d99dcaf4e5883a96181f6ac4ad6f6.tar.gz\"; sha256 = \"1j5j7vbnq2i5zyl8498xrf490jca488iw6hylna3lfwji6rlcaqr\"; }) {}; mkShell { buildInputs = [(haskellPackages.ghcWithPackages (p: [p.servant p.servant-server]))]; }"
{-# LANGUAGE UnicodeSyntax #-}
import Servant
main ∷ IO ()
main = putStrLn "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment