Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 831c06c

Browse files
authored
nix: separate nixpkgs-unstable pin from nixpkgs pin for static binaries (#56959)
We want to get newer stuff in the devshell, but keep a stabler pin for the static binaries (until darwin stdenv stabilizes, most notably the big brain work over at NixOS/nixpkgs#256590) ## Test plan N/A nix stuff :clueless:
1 parent 1e25781 commit 831c06c

File tree

3 files changed

+38
-18
lines changed

3 files changed

+38
-18
lines changed

dev/nix/nodejs.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{ pkgs, fetchurl }:
2-
pkgs.nodejs-16_x.overrideAttrs (oldAttrs: {
2+
pkgs.nodejs-18_x.overrideAttrs (oldAttrs: {
33
# don't override version here, as it won't be in binary cache
44
# and building is super expensive
55
# version = "16.19.0";
@@ -13,12 +13,12 @@ pkgs.nodejs-16_x.overrideAttrs (oldAttrs: {
1313
sha512 = "sha512-wRS8ap/SPxBqbUMzcUNkoA0suLqk9BqMlvi8dM2FRuhwUDgqVGYLc5jQ6Ww3uqVc+84zJvN2GYmTWCubaoWPtQ==";
1414
};
1515
};
16-
typescript = oldAttrs.passthru.pkgs.typescript.override rec {
17-
version = "4.9.5";
16+
typescript = oldAttrs.passthru.pkgs.typescript.overrideAttrs (oldAttrs: rec {
17+
version = "5.2.2";
1818
src = fetchurl {
1919
url = "https://registry.npmjs.org/typescript/-/typescript-${version}.tgz";
20-
sha512 = "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==";
20+
sha512 = "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==";
2121
};
22-
};
22+
});
2323
};
2424
})

flake.lock

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,39 @@
22
description = "The Sourcegraph developer environment & packages Nix Flake";
33

44
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/e78d25df6f1036b3fa76750ed4603dd9d5fe90fc";
5+
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
6+
# separate nixpkgs pin for more stable changes to binaries we build
7+
nixpkgs-stable.url = "github:NixOS/nixpkgs/e78d25df6f1036b3fa76750ed4603dd9d5fe90fc";
68
flake-utils.url = "github:numtide/flake-utils";
79
};
810

9-
outputs = { self, nixpkgs, flake-utils }:
11+
outputs = { self, nixpkgs, nixpkgs-stable, flake-utils }:
1012
let
11-
xcompileTargets = with nixpkgs.lib.systems.examples; {
12-
"aarch64-darwin" = nixpkgs.legacyPackages.aarch64-darwin.pkgsx86_64Darwin;
13-
"x86_64-darwin" = import nixpkgs { system = "x86_64-darwin"; crossSystem = aarch64-darwin; };
13+
xcompileTargets = with nixpkgs-stable.lib.systems.examples; {
14+
"aarch64-darwin" = nixpkgs-stable.legacyPackages.aarch64-darwin.pkgsx86_64Darwin;
15+
"x86_64-darwin" = import nixpkgs-stable { system = "x86_64-darwin"; crossSystem = aarch64-darwin; };
1416
};
1517
inherit (import ./dev/nix/util.nix { inherit (nixpkgs) lib; }) xcompilify;
1618
in
1719
flake-utils.lib.eachDefaultSystem
1820
(system:
1921
let
2022
pkgs = nixpkgs.legacyPackages.${system};
23+
pkgsBins = nixpkgs-stable.legacyPackages.${system};
2124
pkgs' = import nixpkgs { inherit system; overlays = builtins.attrValues self.overlays; };
2225
pkgsX = xcompileTargets.${system} or null;
2326
in
2427
{
2528
legacyPackages = pkgs';
2629

27-
packages = xcompilify { inherit pkgs pkgsX; }
28-
(pkgs: {
29-
ctags = pkgs.callPackage ./dev/nix/ctags.nix { };
30-
comby = pkgs.callPackage ./dev/nix/comby.nix { };
31-
p4-fusion = pkgs.callPackage ./dev/nix/p4-fusion.nix { };
30+
packages = xcompilify { inherit pkgsX; pkgs = pkgsBins; }
31+
(p: {
32+
ctags = p.callPackage ./dev/nix/ctags.nix { };
33+
comby = p.callPackage ./dev/nix/comby.nix { };
34+
p4-fusion = p.callPackage ./dev/nix/p4-fusion.nix { };
3235
}) // {
33-
nodejs-16_x = pkgs.callPackage ./dev/nix/nodejs.nix { };
36+
# doesnt need the same stability as those above
37+
nodejs-18_x = pkgs.callPackage ./dev/nix/nodejs.nix { };
3438
};
3539

3640
# We use pkgs (not pkgs') intentionally to avoid doing extra work of
@@ -43,7 +47,7 @@
4347
overlays = {
4448
ctags = final: prev: { universal-ctags = self.packages.${prev.system}.ctags; };
4549
comby = final: prev: { comby = self.packages.${prev.system}.comby; };
46-
nodejs-16_x = final: prev: { nodejs-16_x = self.packages.${prev.system}.nodejs-16_x; };
50+
nodejs-18_x = final: prev: { nodejs-16_x = self.packages.${prev.system}.nodejs-18_x; };
4751
p4-fusion = final: prev: { p4-fusion = self.packages.${prev.system}.p4-fusion; };
4852
};
4953
};

0 commit comments

Comments
 (0)