-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from SupercedeTech/add-better-nix-infratstruc…
…ture Add better nix infrastructure that doesn't need to be kept up to date with cabal file
- Loading branch information
Showing
8 changed files
with
43 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ pkgs ? import ./nix/pkgs.nix, ... }: | ||
let | ||
ignore = import (builtins.fetchGit { | ||
url = "https://github.com/hercules-ci/gitignore.nix"; | ||
rev = "bff2832ec341cf30acb3a4d3e2e7f1f7b590116a"; | ||
}) { inherit (pkgs) lib; }; | ||
in | ||
pkgs.haskellPackages.callCabal2nix "keter" (ignore.gitignoreSource ./.) { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import (builtins.fetchGit { | ||
# Descriptive name to make the store path easier to identify | ||
name = "nixos-pin-2022.03.02"; | ||
name = "nixos-pin-2022.05.13"; | ||
url = "https://github.com/nixos/nixpkgs/"; | ||
rev = "5d5de3be19855371eecbea5fd500818925ec109d"; | ||
rev = "6925d06dd1e2039835ffe749cda11660431ffefa"; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import ./pin.nix { | ||
config = { | ||
|
||
packageOverrides = pkgs: { | ||
|
||
haskell = pkgs.lib.recursiveUpdate pkgs.haskell { | ||
packageOverrides = hpNew: hpOld: { | ||
keter = hpNew.callPackage ../default.nix {}; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,15 @@ | ||
{ nixpkgs ? import ./nix/pin.nix {}, compiler ? "default", doBenchmark ? false }: | ||
|
||
let | ||
|
||
inherit (nixpkgs) pkgs; | ||
|
||
f = { mkDerivation, aeson, array, async, attoparsec, base | ||
, blaze-builder, bytestring, case-insensitive, conduit | ||
, conduit-extra, containers, data-default, directory, filepath | ||
, fsnotify, hspec, http-client, http-conduit, http-reverse-proxy | ||
, http-types, HUnit, indexed-traversable, lib, lifted-base, mtl | ||
, network, optparse-applicative, process, random, regex-tdfa, stm | ||
, tar, template-haskell, text, time, tls, tls-session-manager | ||
, transformers, unix, unix-compat, unordered-containers, vector | ||
, wai, wai-app-static, wai-extra, warp, warp-tls, yaml, zlib | ||
, cabal-install, yesod, stm-lifted, yesod-websockets | ||
}: | ||
mkDerivation { | ||
pname = "keter"; | ||
version = "1.5"; | ||
src = ./.; | ||
isLibrary = true; | ||
isExecutable = true; | ||
libraryToolDepends = [ cabal-install ]; | ||
libraryHaskellDepends = [ | ||
aeson array async attoparsec base blaze-builder bytestring | ||
case-insensitive conduit conduit-extra containers data-default | ||
directory filepath fsnotify http-client http-conduit | ||
http-reverse-proxy http-types indexed-traversable lifted-base mtl | ||
network optparse-applicative process random regex-tdfa stm tar | ||
template-haskell text time tls tls-session-manager transformers | ||
unix unix-compat unordered-containers vector wai wai-app-static | ||
wai-extra warp warp-tls yaml zlib yesod stm-lifted yesod-websockets | ||
{ pkgs ? import ./nix/pkgs.nix, ... }: | ||
pkgs.haskellPackages.shellFor { | ||
packages = ps : [ ps.keter ]; | ||
# this is to build the examples from incoming | ||
extraDependencies = ps: { | ||
libraryHaskellDepends = [ | ||
ps.yesod-websockets | ||
ps.yesod-core | ||
ps.stm-lifted | ||
]; | ||
}; | ||
buildInputs = [ | ||
pkgs.cabal-install | ||
]; | ||
executableHaskellDepends = [ base data-default filepath ]; | ||
testHaskellDepends = [ | ||
base bytestring conduit hspec HUnit transformers unix | ||
]; | ||
homepage = "http://www.yesodweb.com/"; | ||
description = "Web application deployment manager, focusing on Haskell web frameworks"; | ||
license = lib.licenses.mit; | ||
}; | ||
|
||
haskellPackages = if compiler == "default" | ||
then pkgs.haskellPackages | ||
else pkgs.haskell.packages.${compiler}; | ||
|
||
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; | ||
|
||
drv = variant (haskellPackages.callPackage f {}); | ||
|
||
in | ||
|
||
if pkgs.lib.inNixShell then drv.env else drv | ||
} |