Skip to content

Commit

Permalink
Add nix setup for development
Browse files Browse the repository at this point in the history
  • Loading branch information
airhorns committed Nov 8, 2023
1 parent 278d96a commit 0382e94
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use flake

source_env_if_exists .envrc.local
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.direnv
dist
node_modules
yarn.lock
vscode-profile*
isolate-*
flamegraph.html
flamegraph.html
*.perf
2 changes: 1 addition & 1 deletion Benchmarking.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ node --prof-process isolate-*.log
You can postprocess the generated `isolate-0x<something>.log` file into the data `flamegraph` expects, and then feed it to `flamegraph` to see a visual breakdown of performance. You can do that in one command like so:

```shell
node --prof-process --preprocess -j isolate-*.log | p flamebearer
node --prof-process --preprocess -j isolate-*.log | pnpm flamebearer
```

#### CPU profiling with VSCode
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

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

33 changes: 33 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
description = "mobx-quick-tree development environment";

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

outputs = { self, flake-utils, nixpkgs }:
(flake-utils.lib.eachSystem [
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
]
(system: nixpkgs.lib.fix (flake:
let
pkgs = nixpkgs.legacyPackages.${system};
in
rec {

packages =
rec {
bash = pkgs.bash;
nodejs = pkgs.nodejs_21;
pnpm = pkgs.nodejs_21.pkgs.pnpm;
};

devShell = pkgs.mkShell {
packages = builtins.attrValues packages;
};
}
)));
}

0 comments on commit 0382e94

Please sign in to comment.