Skip to content
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
46 changes: 23 additions & 23 deletions flake.lock

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

49 changes: 28 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,37 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pnpm_10
];
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];

shellHook = ''
echo "StackOne AI Node SDK development environment"
perSystem =
{ pkgs, ... }:
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pnpm_10
nixfmt-rfc-style
];

# Install dependencies only if node_modules/.pnpm/lock.yaml is older than pnpm-lock.yaml
if [ ! -f node_modules/.pnpm/lock.yaml ] || [ pnpm-lock.yaml -nt node_modules/.pnpm/lock.yaml ]; then
echo "📦 Installing dependencies..."
pnpm install --frozen-lockfile
fi
'';
shellHook = ''
echo "StackOne AI Node SDK development environment"

# Install dependencies only if node_modules/.pnpm/lock.yaml is older than pnpm-lock.yaml
if [ ! -f node_modules/.pnpm/lock.yaml ] || [ pnpm-lock.yaml -nt node_modules/.pnpm/lock.yaml ]; then
echo "📦 Installing dependencies..."
pnpm install --frozen-lockfile
fi
'';
};
};
}
);
};
}
4 changes: 4 additions & 0 deletions lefthook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ pre-commit:
glob: '*'
run: pnpm oxfmt --no-error-on-unmatched-pattern {staged_files}
stage_fixed: true
- name: nixfmt
glob: '*.nix'
run: nix develop --command nixfmt {staged_files}
stage_fixed: true

pre-push:
jobs:
Expand Down
Loading