Skip to content

Commit 810144f

Browse files
committed
[other] add nix
1 parent ccc8d89 commit 810144f

File tree

4 files changed

+141
-1
lines changed

4 files changed

+141
-1
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ dist
3535
dev
3636
.nyc_output
3737
test-results.json
38-
.idea/
38+
.idea/
39+
.direnv/

flake.lock

Lines changed: 96 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: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
description = "NodeJS 16_x project";
3+
4+
inputs = {
5+
# Specify the source of Home Manager and Nixpkgs.
6+
branch-nix.url = "git+ssh://[email protected]/BranchMetrics/nix";
7+
};
8+
9+
outputs = { self, branch-nix }:
10+
let
11+
nixpkgs = branch-nix.nixpkgs;
12+
nixpkgs-unstable = branch-nix.nixpkgs-unstable;
13+
extra-pkgs = branch-nix.packages;
14+
utils = branch-nix.utils;
15+
system-utils = branch-nix.system-utils;
16+
in
17+
utils.lib.eachDefaultSystem (system:
18+
let
19+
stable-pkgs = nixpkgs.legacyPackages.${system};
20+
unstable-pkgs = nixpkgs.legacyPackages.${system};
21+
pkgs = stable-pkgs // {
22+
extra-pkgs = extra-pkgs.${system};
23+
unstable = unstable-pkgs;
24+
};
25+
bazel-os = system-utils.getBazelOs system;
26+
nodejs = pkgs.extra-pkgs.nodejs-16_x;
27+
in
28+
{
29+
devShell = pkgs.mkShell {
30+
nativeBuildInputs = [
31+
nodejs
32+
];
33+
shellHook = ''
34+
if [ -f $HOME/.config/bin/setup-webstorm-sdk ] && [ -f ./.idea/workspace.xml ]; then
35+
$HOME/.config/bin/setup-webstorm-sdk || echo "setup-webstorm-sdk failed"
36+
fi
37+
'';
38+
};
39+
formatter = pkgs.nixpkgs-fmt;
40+
}
41+
);
42+
}

0 commit comments

Comments
 (0)