Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use separate nixpkgs for js toolchains #3229

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions app/app.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
_: {
perSystem =
{
pkgs,
unstablePkgs,
lib,
pkgs,
jsPkgs,
ensureAtRepositoryRoot,
...
}:
let
pkgsDeps = with pkgs; [
pkg-config
deps = with jsPkgs; [
python3
];
nodeDeps = with unstablePkgs; [
pkg-config
nodePackages_latest.nodejs
nodePackages_latest."patch-package"
];
combinedDeps = pkgsDeps ++ nodeDeps;
packageJSON = lib.importJSON ./package.json;
in
{
packages = {
app = unstablePkgs.buildNpmPackage {
app = jsPkgs.buildNpmPackage {
npmDepsHash = "sha256-yrqA4Qp7iiGvSo/Xk0G5adXdVqgK8nGYGdXtvLp7EPk=";
src = ./.;
sourceRoot = "app";
npmFlags = [ "--enable-pre-post-scripts" ];
pname = packageJSON.name;
inherit (packageJSON) version;
nativeBuildInputs = combinedDeps;
buildInputs = combinedDeps;
nativeBuildInputs = deps;
buildInputs = deps;
installPhase = ''
mkdir -p $out
cp -r ./build/* $out
Expand All @@ -44,7 +41,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "app-dev-server";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd app/
Expand All @@ -58,7 +55,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "app-dev-server";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd app/
Expand All @@ -72,7 +69,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "deploy-app-ipfs";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd app/
Expand Down
3 changes: 2 additions & 1 deletion app/src/lib/graphql/queries/channels.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { graphql } from "gql.tada"

export const channelsQuery = graphql(/* GraphQL */ `query ChannelsQuery($limit: Int = 500) @cached(ttl: 30) {
export const channelsQuery =
graphql(/* GraphQL */ `query ChannelsQuery($limit: Int = 500) @cached(ttl: 30) {
v1_channels(
where: {source_chain: {enabled: {_eq: true}}, destination_chain: {enabled: {_eq: true}}},
order_by: [
Expand Down
5 changes: 2 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down Expand Up @@ -227,8 +227,7 @@
"noNestedTernary": "off",
"noExportedImports": "off",
"useImportRestrictions": "off",
"noDescendingSpecificity": "off",
"useExplicitFunctionReturnType": "off"
"noDescendingSpecificity": "off"
},
"performance": {
"all": true,
Expand Down
17 changes: 8 additions & 9 deletions ceremony/ceremony.nix
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
_: {
perSystem =
{
pkgs,
unstablePkgs,
lib,
pkgs,
jsPkgs,
ensureAtRepositoryRoot,
...
}:
let
pkgsDeps = with pkgs; [
deps = with jsPkgs; [
pkg-config
python3
nodePackages_latest.nodejs
];
nodeDeps = with unstablePkgs; [ nodePackages_latest.nodejs ];
combinedDeps = pkgsDeps ++ nodeDeps;
packageJSON = lib.importJSON ./package.json;
in
{
packages = {
ceremony = unstablePkgs.buildNpmPackage {
ceremony = jsPkgs.buildNpmPackage {
npmDepsHash = "sha256-2s556is4PJaGmxQhIUPZLINh6J6ngeTf32bwDtl+v6Q=";
src = ./.;
sourceRoot = "ceremony";
npmFlags = [ "--legacy-peer-deps" ];
pname = packageJSON.name;
inherit (packageJSON) version;
nativeBuildInputs = combinedDeps;
buildInputs = combinedDeps;
nativeBuildInputs = deps;
buildInputs = deps;
installPhase = ''
mkdir -p $out
cp -r ./build/* $out
Expand All @@ -44,7 +43,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "ceremony-dev-server";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd ceremony/
Expand Down
19 changes: 9 additions & 10 deletions docs/docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ _: {
lib,
pkgs,
mkCi,
unstablePkgs,
jsPkgs,
ensureAtRepositoryRoot,
...
}:
let
pkgsDeps = with pkgs; [ pkg-config ];
nodeDeps = with unstablePkgs; [
deps = with jsPkgs; [
vips
pkg-config
nodePackages_latest.nodejs
];
combinedDeps = pkgsDeps ++ nodeDeps;
packageJSON = lib.importJSON ./package.json;
in
{
packages = {
docs = mkCi false (
unstablePkgs.buildNpmPackage {
jsPkgs.buildNpmPackage {
npmDepsHash = "sha256-v2rwxCCKmbtwxAynUryTigfg0V4cmARh6HgfKTwFQds=";
src = ./.;
srcs = [
Expand All @@ -30,8 +29,8 @@ _: {
sourceRoot = "docs";
pname = packageJSON.name;
inherit (packageJSON) version;
nativeBuildInputs = combinedDeps;
buildInputs = combinedDeps;
nativeBuildInputs = deps;
buildInputs = deps;
installPhase = ''
mkdir -p $out
cp -r ./dist/* $out
Expand All @@ -49,7 +48,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "docs-dev-server";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd docs/
Expand All @@ -64,7 +63,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "docs-check";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
biome check docs --error-on-warnings --write --unsafe
Expand All @@ -84,7 +83,7 @@ _: {
type = "app";
program = pkgs.writeShellApplication {
name = "deploy-docs-ipfs";
runtimeInputs = combinedDeps;
runtimeInputs = deps;
text = ''
${ensureAtRepositoryRoot}
cd docs/
Expand Down
35 changes: 17 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 8 additions & 11 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
nixpkgs-go.url = "github:NixOS/nixpkgs/nixos-unstable";
# Track a separate nixpkgs for unstable nixos
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
# Track a separate nixpkgs for JS/TS toolchains
nixpkgs-js.url = "github:NixOS/nixpkgs/nixos-unstable";
# Remove when lnav is updated on upstream nixpkgs
nixpkgs-lnav.url = "github:cor/nixpkgs/lnav-v0.12.2-beta";
process-compose.url = "github:F1bonacc1/process-compose";
Expand Down Expand Up @@ -94,11 +96,6 @@
url = "github:CosmWasm/wasmvm/v2.1.3";
flake = false;
};
biome = {
url = "github:biomejs/biome/cli/v1.9.3";
flake = false;
};

stargaze = {
url = "git+https://github.com/public-awesome/stargaze?ref=main&submodules=1";
flake = false;
Expand Down Expand Up @@ -247,7 +244,6 @@
./tools/rust/rust.nix
./tools/rust/crane.nix
./tools/tera/tera.nix
./tools/biome/biome.nix
./tools/docgen/docgen.nix
./tools/hasura-cli/hasura-cli.nix
./tools/todo-comment.nix
Expand All @@ -272,7 +268,6 @@
rust,
system,
lib,
biome,
...
}:
let
Expand All @@ -295,6 +290,7 @@
};

goPkgs = import inputs.nixpkgs-go { inherit system; };
jsPkgs = import inputs.nixpkgs-js { inherit system; };
unstablePkgs = import inputs.nixpkgs-unstable { inherit system; };
in
{
Expand All @@ -306,6 +302,7 @@
get-flake
uniondBundleVersions
goPkgs
jsPkgs
unstablePkgs
mkCi
;
Expand Down Expand Up @@ -496,10 +493,8 @@
self'.packages.tdc
yq
])
++ (with unstablePkgs; [
wasm-tools
++ (with jsPkgs; [
bun # for running TypeScript files on the fly
postgresql
emmet-language-server
nodePackages.graphqurl
nodePackages_latest.nodejs
Expand All @@ -510,6 +505,8 @@
nodePackages_latest.vscode-langservers-extracted
])
++ (with unstablePkgs; [
wasm-tools
postgresql
go_1_23
gopls
go-tools
Expand Down Expand Up @@ -554,8 +551,8 @@
pkgs
unstablePkgs
goPkgs
jsPkgs
rust
biome
;
};
};
Expand Down
Loading