Skip to content

Commit c039f69

Browse files
author
fidgetingbits
committed
Add nix flake
1 parent 3b38e7b commit c039f69

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

flake.lock

Lines changed: 27 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: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
description = "A Nix-flake-based development environment for Cursorless";
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+
pnpm = prev.nodePackages.pnpm;
12+
yarn = (prev.yarn.override { inherit nodejs; });
13+
})
14+
];
15+
supportedSystems =
16+
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
17+
forEachSupportedSystem = f:
18+
nixpkgs.lib.genAttrs supportedSystems (system:
19+
f {
20+
pkgs = import nixpkgs {
21+
inherit overlays system;
22+
config.allowUnfree = true;
23+
};
24+
});
25+
in {
26+
devShells = forEachSupportedSystem ({ pkgs }: {
27+
default = pkgs.mkShell {
28+
packages = with pkgs; [
29+
node2nix
30+
nodejs
31+
pnpm
32+
yarn
33+
python310
34+
vsce
35+
pre-commit
36+
];
37+
# To prevent weird broken non-interactive bash terminal
38+
buildInputs = [ pkgs.bashInteractive ];
39+
shellHook = ''
40+
if [ ! -f .git/hooks/pre-commit ]; then
41+
pre-commit install
42+
fi
43+
'';
44+
};
45+
});
46+
};
47+
}

0 commit comments

Comments
 (0)