about summary refs log tree commit diff
path: root/third_party/nixpkgs/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nixpkgs/default.nix')
-rw-r--r--third_party/nixpkgs/default.nix26
1 files changed, 12 insertions, 14 deletions
diff --git a/third_party/nixpkgs/default.nix b/third_party/nixpkgs/default.nix
index dc3a59d435..b79a963e5c 100644
--- a/third_party/nixpkgs/default.nix
+++ b/third_party/nixpkgs/default.nix
@@ -11,7 +11,11 @@
 { depot ? { }
 , externalArgs ? { }
 , depotOverlays ? true
-, localSystem ? builtins.currentSystem
+, localSystem ? externalArgs.localSystem or builtins.currentSystem
+, crossSystem ? externalArgs.crossSystem or localSystem
+  # additional overlays to be applied.
+  # Useful when calling this file in a view exported from depot.
+, additionalOverlays ? [ ]
 , ...
 }:
 
@@ -24,10 +28,14 @@ let
       (if externalArgs ? nixpkgsConfig then externalArgs.nixpkgsConfig else { })
       // {
         allowUnfree = true;
+        allowUnfreeRedistributable = true;
         allowBroken = true;
+        # Forbids our meta.ci attribute
+        # https://github.com/NixOS/nixpkgs/pull/191171#issuecomment-1260650771
+        checkMeta = false;
       };
 
-    inherit localSystem;
+    inherit localSystem crossSystem;
   };
 
   # import the nixos-unstable package set, or optionally use the
@@ -44,16 +52,7 @@ let
   # Overlay for packages that should come from the stable channel
   # instead (e.g. because something is broken in unstable).
   # Use `stableNixpkgs` from above.
-  stableOverlay = _unstableSelf: _unstableSuper: {
-    inherit (stableNixpkgs)
-      # bat syntaxes changed with syntect 5.0, but cheddar is still on 4.x
-      # TODO(tazjin): upgrade cheddar to syntect 5.0
-      bat
-
-      # ntfy does not build on unstable as of 2022-08-02
-      ntfy
-      ;
-  };
+  stableOverlay = _unstableSelf: unstableSuper: { };
 
   # Overlay to expose the nixpkgs commits we are using to other Nix code.
   commitsOverlay = _: _: {
@@ -69,10 +68,9 @@ import nixpkgsSrc (commonNixpkgsArgs // {
     stableOverlay
   ] ++ (if depotOverlays then [
     depot.third_party.overlays.haskell
-    depot.third_party.overlays.emacs
     depot.third_party.overlays.tvl
     depot.third_party.overlays.ecl-static
     depot.third_party.overlays.dhall
     (import depot.third_party.sources.rust-overlay)
-  ] else [ ]);
+  ] else [ ] ++ additionalOverlays);
 })