-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8490111
commit 9499681
Showing
2 changed files
with
49 additions
and
152 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,56 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix"; | ||
nixpkgs.follows = "nixpkgs-matrix/nixpkgs"; | ||
nixpkgs-matrix = { | ||
type = "indirect"; | ||
id = "nixpkgs-matrix"; | ||
}; | ||
}; | ||
|
||
outputs = { nixpkgs, flake-utils, ... }: | ||
outputs = { nixpkgs-matrix, flake-utils, ... }: | ||
flake-utils.lib.eachSystem ([ | ||
"x86_64-linux" | ||
"x86_64-windows" | ||
"x86_64-darwin" | ||
"aarch64-darwin" | ||
]) (system: | ||
let | ||
pkgs = import nixpkgs { | ||
system = system; | ||
}; | ||
pkgs = nixpkgs-matrix.legacyPackages.${system}; | ||
|
||
shell = { ci ? false }: with pkgs; pkgs.mkShell { | ||
nativeBuildInputs = [ | ||
nodejs_20 | ||
shellcheck | ||
jq | ||
]; | ||
# Don't set rpath for native addons | ||
NIX_DONT_SET_RPATH = true; | ||
NIX_NO_SELF_RPATH = true; | ||
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}"; | ||
shellHook = '' | ||
echo "Entering $(npm pkg get name)" | ||
set -o allexport | ||
. ./.env | ||
set +o allexport | ||
set -v | ||
${ | ||
lib.optionalString ci | ||
'' | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
shopt -s inherit_errexit | ||
'' | ||
} | ||
mkdir --parents "$(pwd)/tmp" | ||
shell = { ci ? false }: | ||
with pkgs; | ||
pkgs.mkShell { | ||
nativeBuildInputs = [ nodejs_20 shellcheck jq ]; | ||
# Don't set rpath for native addons | ||
NIX_DONT_SET_RPATH = true; | ||
NIX_NO_SELF_RPATH = true; | ||
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}"; | ||
shellHook = '' | ||
echo "Entering $(npm pkg get name)" | ||
set -o allexport | ||
. ./.env | ||
set +o allexport | ||
set -v | ||
${lib.optionalString ci '' | ||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
shopt -s inherit_errexit | ||
''} | ||
mkdir --parents "$(pwd)/tmp" | ||
# Built executables and NPM executables | ||
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH" | ||
# Built executables and NPM executables | ||
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH" | ||
npm install --ignore-scripts | ||
npm install --ignore-scripts | ||
set +v | ||
''; | ||
}; | ||
in | ||
{ | ||
devShells = { | ||
default = shell { ci = false; }; | ||
ci = shell { ci = true; }; | ||
set +v | ||
''; | ||
}; | ||
} | ||
); | ||
in { | ||
devShells = { | ||
default = shell { ci = false; }; | ||
ci = shell { ci = true; }; | ||
}; | ||
}); | ||
} |