summaryrefslogtreecommitdiff
path: root/Biz/Bild/Nixpkgs.nix
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-11-24 12:08:13 -0500
committerBen Sima <ben@bsima.me>2020-11-24 12:08:13 -0500
commit1a47cf6ff0cbe6cc80e3497a68343b8ecb9228c1 (patch)
treea29ea5743893fe2ec356da9cc198cb8957fe6d5e /Biz/Bild/Nixpkgs.nix
parent8e256e46bca4b3f04c6379a8ff98d3c5cb7a3683 (diff)
Add inspekt3d to guile deps, and reorganize
I reorganized in order to debug a problem with the nix overlays. I think having small, focused overlayes is more understandable than one overlay that references itself via `rec`. Also the error traces are easier to follow with smaller overlays.
Diffstat (limited to 'Biz/Bild/Nixpkgs.nix')
-rw-r--r--Biz/Bild/Nixpkgs.nix43
1 files changed, 30 insertions, 13 deletions
diff --git a/Biz/Bild/Nixpkgs.nix b/Biz/Bild/Nixpkgs.nix
index 88cf6ca..ffafe3f 100644
--- a/Biz/Bild/Nixpkgs.nix
+++ b/Biz/Bild/Nixpkgs.nix
@@ -1,16 +1,33 @@
let
sources = import ./Sources.nix;
- nixpkgs = import sources.nixpkgs {
- system = __currentSystem;
- overlays = [
- (_: _: { inherit sources; })
- (import ./Overlay.nix)
- (_: pkgs: pkgs.overridePinnedDeps pkgs.overrideSource)
- (_: _: { niv = import sources.niv {}; })
- (_: pkgs: { wemux = pkgs.callPackage ./Wemux.nix {}; })
- ];
- config = {
- allowBroken = true;
- };
+in
+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;
+
+ # 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..
+ 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 null;
+ })
+ (_: pkgs: pkgs.overridePinnedDeps pkgs.overrideSource)
+ (import ./Deps.nix)
+ (_: pkgs: { niv = import pkgs.sources.niv {}; })
+ ];
+ config = {
+ allowBroken = true;
};
-in nixpkgs
+}