Skip to content

Commit df01031

Browse files
committed
Add nix flake
1 parent 62988d8 commit df01031

File tree

5 files changed

+8198
-1
lines changed

5 files changed

+8198
-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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ node_modules
1010
npm-debug.log*
1111
yarn-debug.log*
1212
yarn-error.log*
13-
yarn.lock
1413

1514
# Editor directories and files
1615
.idea

flake.lock

Lines changed: 63 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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
inputs.nixpkgs.url = "nixpkgs";
3+
inputs.flake-utils.url = "github:numtide/flake-utils";
4+
inputs.devshell.url = "github:numtide/devshell";
5+
inputs.devshell.inputs.nixpkgs.follows = "nixpkgs";
6+
inputs.devshell.inputs.flake-utils.follows = "flake-utils";
7+
8+
outputs = { self, nixpkgs, flake-utils, devshell }:
9+
flake-utils.lib.eachDefaultSystem (system: let
10+
pkgs = import nixpkgs {
11+
inherit system;
12+
overlays = [ devshell.overlay ];
13+
};
14+
nodeModules = pkgs.mkYarnModules rec {
15+
pname = "zigbee2mqtt-networkmap-node-modules";
16+
version = "1.0";
17+
packageJSON = ./package.json;
18+
yarnLock = ./yarn.lock;
19+
};
20+
in {
21+
devShell = pkgs.devshell.mkShell {
22+
env = [{
23+
name = "NODE_OPTIONS";
24+
value = "--openssl-legacy-provider";
25+
}];
26+
devshell.startup.yarn.text = ''
27+
ln -sf ${nodeModules}/node_modules .
28+
'';
29+
packages = with pkgs; [
30+
yarn
31+
];
32+
};
33+
});
34+
}

0 commit comments

Comments
 (0)