Skip to content

Commit fb0e102

Browse files
author
fidgetingbits
committed
nix flake support
1 parent a53aeb1 commit fb0e102

File tree

4 files changed

+65
-0
lines changed

4 files changed

+65
-0
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/.direnv/
2+
/.emscripten_cache/
13
/.make-work/
24
/.metals/
35
/.vscode-test/

flake.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
description = "A Nix-flake-based development environment for vscode-parse-tree";
3+
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
5+
6+
outputs = { self, nixpkgs }:
7+
let
8+
overlays = [
9+
(final: prev: rec {
10+
nodejs = prev.nodejs-18_x;
11+
yarn = (prev.yarn.override { inherit nodejs; });
12+
})
13+
];
14+
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
15+
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
16+
pkgs = import nixpkgs { inherit overlays system; config.allowUnfree = true; };
17+
});
18+
in
19+
{
20+
devShells = forEachSupportedSystem
21+
({ pkgs }: {
22+
default = pkgs.mkShell
23+
{
24+
packages = with pkgs; [ nodejs yarn emscripten python310 steam-run vsce ];
25+
shellHook = ''
26+
if [ ! -d $(pwd)/.emscripten_cache ]; then
27+
cp -R ${pkgs.emscripten}/share/emscripten/cache/ $(pwd)/.emscripten_cache
28+
chmod u+rwX -R $(pwd)/.emscripten_cache
29+
export EM_CACHE=$(pwd)/.emscripten_cache
30+
fi
31+
'';
32+
};
33+
});
34+
};
35+
}

0 commit comments

Comments
 (0)