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

Indirect package set flake input #106

Merged
merged 1 commit into from
Sep 19, 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
122 changes: 14 additions & 108 deletions flake.lock

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

77 changes: 34 additions & 43 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,54 +1,45 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
nixpkgs-matrix = {
type = "indirect";
id = "nixpkgs-matrix";
};
flake-utils.url = "github:numtide/flake-utils";

nixpkgs.follows = "nixpkgs-matrix/nixpkgs";
nixpkgs-matrix.url = "github:matrixai/nixpkgs-matrix";
};

outputs = { nixpkgs, flake-utils, ... }:
outputs = { nixpkgs-matrix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
pkgs = nixpkgs-matrix.legacyPackages.${system};

shell = { ci ? false }: with pkgs; mkShell {
nativeBuildInputs = [
nodejs
shellcheck
patchelf
gitAndTools.gh
];
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"
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
npm install --ignore-scripts
if [ -f 'node_modules/@cloudflare/workerd-linux-64/bin/workerd' ]; then
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
node_modules/@cloudflare/workerd-linux-64/bin/workerd
fi
set +v
'';
};
in
{
shell = { ci ? false }:
with pkgs;
mkShell {
nativeBuildInputs = [ nodejs shellcheck patchelf gitAndTools.gh ];
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"
export PATH="$(pwd)/dist/bin:$(npm root)/.bin:$PATH"
npm install --ignore-scripts
if [ -f 'node_modules/@cloudflare/workerd-linux-64/bin/workerd' ]; then
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
node_modules/@cloudflare/workerd-linux-64/bin/workerd
fi
set +v
'';
};
in {
devShells = {
default = shell { ci = false; };
ci = shell { ci = true; };
Expand Down