summaryrefslogtreecommitdiff
path: root/Biz/Bild
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-02-03 09:30:11 -0500
committerBen Sima <ben@bsima.me>2021-02-03 09:30:11 -0500
commit7417b1c2c29dcf2b48ecdd6b283c506e9ec23230 (patch)
treed8a3acbcd2f4b65770416da10cc3796f8eeb5a1b /Biz/Bild
parente7d5f889524447dfc74e727b2a2ff7dd27e6914d (diff)
Refactor some nix code for readability
Diffstat (limited to 'Biz/Bild')
-rw-r--r--Biz/Bild/Deps.nix24
-rw-r--r--Biz/Bild/Nixpkgs.nix2
2 files changed, 13 insertions, 13 deletions
diff --git a/Biz/Bild/Deps.nix b/Biz/Bild/Deps.nix
index bc27b18..dd1ed45 100644
--- a/Biz/Bild/Deps.nix
+++ b/Biz/Bild/Deps.nix
@@ -1,23 +1,20 @@
_: pkgs:
let
- simpleCabalBuilder = self: name:
+ buildCabal = self: name:
self.callCabal2nix name pkgs.sources.${name} {};
- buildCabal = self: name: subdir:
- if isNull subdir then
- self.callCabal2nix name pkgs.sources.${name} {}
- else
- self.callCabal2nix name (pkgs.sources.${name} + "/${subdir}") {};
+ buildCabalSubdir = self: {name, src ? pkgs.sources.${name}, subdir ? name}:
+ self.callCabal2nix name (src + "/${subdir}") {};
in rec
{
haskell = pkgs.haskell // {
packages = pkgs.haskell.packages // {
ghc865 = pkgs.haskell.packages.ghc865.override (old: {
overrides = with pkgs.pkgs.haskell.lib; self: super:
- pkgs.overridePinnedDeps (simpleCabalBuilder self) // {
+ pkgs.overridePinnedDeps (buildCabal self) // {
acid-state = dontCheck super.acid-state; # mac: "too many open files"
ghcjs-base = null; # otherwise ghc tries to build this via overridePinnedDeps
- servant-auth = buildCabal self "servant-auth" "servant-auth";
+ servant-auth = buildCabalSubdir self {name = "servant-auth";};
servant-server = doJailbreak super.servant-server;
stripe-haskell = dontCheck super.stripe-haskell;
stripe-http-client = dontCheck super.stripe-http-client;
@@ -27,20 +24,23 @@ in rec
});
ghcjs86 = pkgs.haskell.packages.ghcjs86.override (old: {
overrides = with pkgs.haskell.lib; self: super:
- pkgs.overridePinnedDeps (simpleCabalBuilder self) // {
+ pkgs.overridePinnedDeps (buildCabal self) // {
Glob = dontCheck super.Glob;
QuickCheck = dontCheck super.QuickCheck;
aeson = dontCheck super.aeson;
base-compat-batteries = dontCheck super.base-compat-batteries;
clay = dontCheck super.clay;
comonad = dontCheck super.comonad;
- ghcjs-base = dontCheck (simpleCabalBuilder self "ghcjs-base");
- jsaddle-warp = dontCheck (self.callCabal2nix "jsaddle-warp" "${pkgs.sources.jsaddle}/jsaddle-warp" {});
+ ghcjs-base = dontCheck (buildCabal self "ghcjs-base");
+ jsaddle-warp = dontCheck (buildCabalSubdir self {
+ name = "jsaddle-warp";
+ src = pkgs.sources.jsaddle;
+ });
http-types = dontCheck super.http-types;
network-uri= dontCheck super.network-uri;
scientific = dontCheck super.scientific; # takes forever
servant = dontCheck super.servant;
- servant-auth = buildCabal self "servant-auth" "servant-auth";
+ servant-auth = buildCabalSubdir self "servant-auth";
tasty-quickcheck = dontCheck super.tasty-quickcheck;
temporary = dontCheck super.temporary;
time-compat = dontCheck super.time-compat;
diff --git a/Biz/Bild/Nixpkgs.nix b/Biz/Bild/Nixpkgs.nix
index ffafe3f..659443c 100644
--- a/Biz/Bild/Nixpkgs.nix
+++ b/Biz/Bild/Nixpkgs.nix
@@ -21,7 +21,7 @@ import sources.nixpkgs {
version = pkgs.sources.${depName}.version or pkgs.sources.${depName}.rev;
src = pkgs.sources.${depName};
})
- else null;
+ else abort "pkg ${depName} not available";
})
(_: pkgs: pkgs.overridePinnedDeps pkgs.overrideSource)
(import ./Deps.nix)