Skip to content

Commit 5bbc2f7

Browse files
committed
chore: init-nix-local
1 parent 6b110df commit 5bbc2f7

File tree

4 files changed

+115
-1
lines changed

4 files changed

+115
-1
lines changed

.envrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ensure Nix is available even in non-login shells (what direnv uses)
2+
if [ -r /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]; then
3+
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
4+
elif [ -r "$HOME/.nix-profile/etc/profile.d/nix.sh" ]; then
5+
. "$HOME/.nix-profile/etc/profile.d/nix.sh"
6+
fi
7+
8+
use flake

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,10 @@ test-output
8282

8383
# Gemini local knowledge base files
8484
GEMINI.md
85-
**/GEMINI.md
85+
**/GEMINI.md
86+
87+
# Nix and direnv
88+
.direnv/
89+
result*
90+
!.envrc
91+

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
description = "Development environment for the ping-javascript-sdk monorepo";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
# Get the pkgs set for the specific system
13+
pkgs = import nixpkgs { inherit system; };
14+
15+
# Node.js version from your .node-version file
16+
nodejs = pkgs.nodejs_22;
17+
in
18+
{
19+
# The `devShell` is the development environment activated by `nix develop`
20+
devShells.default = pkgs.mkShell {
21+
# The packages available in the development shell.
22+
packages = [
23+
nodejs
24+
pkgs.pnpm
25+
pkgs.git
26+
];
27+
28+
shellHook = ''
29+
# This hook runs when you enter the shell
30+
echo "---"
31+
echo "Welcome to the Nix development environment for ping-javascript-sdk!"
32+
echo ""
33+
echo "Node.js version: $(node --version)"
34+
echo "pnpm version: $(pnpm --version)"
35+
echo "---"
36+
'';
37+
};
38+
});
39+
}

0 commit comments

Comments
 (0)