Add .cabal file; better, hopefully purer shell.nix

This commit is contained in:
Silvan Mosberger 2019-05-06 17:44:14 +02:00
parent b5fb7e31fb
commit ca5de24eac
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7
5 changed files with 32 additions and 23 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use_nix

1
.gitignore vendored
View File

@ -1 +1,2 @@
result*
dist

23
all-hies.cabal Normal file
View File

@ -0,0 +1,23 @@
cabal-version: 2.4
name: all-hies
version: 0.1.0.0
author: Silvan Mosberger
maintainer: infinisil@icloud.com
executable update
main-is: update.hs
build-depends: base ^>=4.12.0.0
, haskeline
, process
, regex-applicative
, directory
, filepath
, stack2nix
, http-client
, http-client-tls
, time
, aeson
, mtl
, bytestring
, Cabal
default-language: Haskell2010

View File

@ -1,25 +1,9 @@
{ pkgs ? import ./nixpkgs.nix
}:
let
ghcWithPkgs = pkgs.haskellPackages.ghcWithPackages (p: with p; [
directory
filepath
process
http-client
http-client-tls
aeson
regex-applicative
haskeline
stack2nix
cabal-install
]);
in
pkgs.mkShell {
buildInputs = with pkgs; [
ghcWithPkgs
git
nix-prefetch-scripts
(pkgs.haskellPackages.callCabal2nix "all-hies" ./. {}).env.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs or [] ++ [
pkgs.nix-prefetch-scripts
pkgs.git
pkgs.haskellPackages.cabal-install
];
}
})

View File

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i runhaskell shell.nix
#!nix-shell --pure -i runhaskell shell.nix
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}