summaryrefslogtreecommitdiff
path: root/Biz/Bild
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2021-06-14 16:53:19 -0400
committerBen Sima <ben@bsima.me>2021-11-26 13:47:36 -0500
commitfdc7f3650a5ec6293c52c800d0fafcb2609e78a5 (patch)
treeefb59c5198a271a6fe5e5ecae7a12ca7b606679d /Biz/Bild
parent6cefe23cd9ceab4f4f6b957ff64bc7da5f4ec83a (diff)
Cleanup nix overlays a bit
Diffstat (limited to 'Biz/Bild')
-rw-r--r--Biz/Bild/Deps.nix4
-rw-r--r--Biz/Bild/Nixpkgs.nix28
2 files changed, 15 insertions, 17 deletions
diff --git a/Biz/Bild/Deps.nix b/Biz/Bild/Deps.nix
index 3511d5b..790011c 100644
--- a/Biz/Bild/Deps.nix
+++ b/Biz/Bild/Deps.nix
@@ -2,9 +2,9 @@ self: super:
let
buildCabal = sel: name:
- sel.callCabal2nix name super.sources.${name} {};
+ sel.callCabal2nix name super.sources.${name} {};
buildCabalSubdir = sel: {name, src ? super.sources.${name}, subdir ? name}:
- sel.callCabal2nix name (src + "/${subdir}") {};
+ sel.callCabal2nix name (src + "/${subdir}") {};
ghc = "ghc884";
in rec
{
diff --git a/Biz/Bild/Nixpkgs.nix b/Biz/Bild/Nixpkgs.nix
index 6b442a0..d29519c 100644
--- a/Biz/Bild/Nixpkgs.nix
+++ b/Biz/Bild/Nixpkgs.nix
@@ -5,25 +5,23 @@ import sources.nixpkgs {
system = __currentSystem;
overlays = [
(_: _: { inherit sources; })
- (_: pkgs: rec {
- pinnedDeps = builtins.attrNames
- (builtins.removeAttrs pkgs.sources ["__functor"]);
-
- overridePinnedDeps = builder: pkgs.lib.genAttrs pinnedDeps builder;
-
+ (_: pkgs: {
+ overridePinnedDeps = builder:
+ pkgs.lib.genAttrs (builtins.attrNames pkgs.sources) builder;
+ })
+ (_: pkgs: {
# Modifies a derivation with our source and version, keeping old build
# rules. This will fail if build steps have changed, or if no build
- # rules are available upstream..
+ # rules are available upstream.
overrideSource = depName:
- if pkgs ? depName then
- pkgs.${depName}.overrideAttrs (old: old // rec {
- name = "${depName}-${version}";
- version = pkgs.sources.${depName}.version or pkgs.sources.${depName}.rev;
- src = pkgs.sources.${depName};
- })
- else abort "pkg ${depName} not available";
+ pkgs.${depName}.overrideAttrs (old: old // rec {
+ version = pkgs.sources.${depName}.version or pkgs.sources.${depName}.rev;
+ src = pkgs.sources.${depName};
+ });
})
- (_: pkgs: pkgs.overridePinnedDeps pkgs.overrideSource)
+ (_: pkgs:
+ # override pinned deps with our sources
+ pkgs.overridePinnedDeps pkgs.overrideSource)
(import ./Deps.nix)
(_: pkgs: { niv = import pkgs.sources.niv {}; })
];