Skip to content

Commit

Permalink
chore: added flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanjassal committed Feb 12, 2025
1 parent cb62b01 commit b0db06e
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
78 changes: 78 additions & 0 deletions flake.lock

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

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

outputs = { nixpkgs-matrix, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs-matrix.legacyPackages.${system};
shell = { ci ? false }:
with pkgs;
pkgs.mkShell {
nativeBuildInputs = [ nodejs_20 shellcheck gitAndTools.gh ];
PKG_IGNORE_TAG = 1;
shellHook = ''
echo "Entering $(npm pkg get name)"
set -o allexport
. <(polykey secrets env js-virtualtar)
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
set +v
'';
};
in {
devShells = {
default = shell { ci = false; };
ci = shell { ci = true; };
};
});
}

0 comments on commit b0db06e

Please sign in to comment.