shell.nix

This commit is contained in:
Yann Esposito (Yogsototh) 2018-08-29 23:15:58 +02:00
parent 4076802e8f
commit a78c2c7a1c
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
2 changed files with 14 additions and 8 deletions

9
gpm.hs
View file

@ -4,7 +4,7 @@
#! nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/16d475334409f7fa632929b2838421b4ffe34927.tar.gz" #! nix-shell -I nixpkgs="https://github.com/NixOS/nixpkgs/archive/16d475334409f7fa632929b2838421b4ffe34927.tar.gz"
{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
import Protolude hiding (stdout) import Protolude hiding (stdout,(%))
import Turtle import Turtle
main :: IO () main :: IO ()
@ -23,13 +23,6 @@ mkNewEmptyBranch br = do
echo "cleanup the branch" echo "cleanup the branch"
debug "git rm --cached -r ." debug "git rm --cached -r ."
mkNewEmptyBranch :: Text -> IO ()
mkNewEmptyBranch br = do
echo "create a new branch "<> br <> " (be sure the branch " <> br <> " doesn't already exists)"
debug $ "git checkout --orphan " <> br
echo "cleanup the branch"
debug "git rm --cached -r ."
debug :: Text -> IO () debug :: Text -> IO ()
debug cmd = do debug cmd = do
putText cmd putText cmd

13
shell.nix Normal file
View file

@ -0,0 +1,13 @@
let
rev = "16d475334409f7fa632929b2838421b4ffe34927";
_nixpkgs = import <nixpkgs> { };
pkgs = import ( fetchTarball "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz" ) { };
ghc = pkgs.haskellPackages;
ghcPackages = ghc.ghcWithPackages (ps: [ ps.protolude ps.turtle ]);
in with pkgs;
stdenv.mkDerivation {
name = "gpm";
buildInputs = [ ghcPackages ];
buildDepends = [ libiconv ];
}