Skip to content

Commit fb5658b

Browse files
authored
Add Nix flake for development environment (#534)
1 parent 94c620c commit fb5658b

File tree

3 files changed

+79
-1
lines changed

3 files changed

+79
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@
88
out/
99
images/.DS_Store
1010
.DS_Store
11-
.env/
11+
.env/
12+
13+
.direnv/
14+
.envrc

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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
description = "Nix flake for Lightdash Docs development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs =
9+
{ self, nixpkgs }:
10+
let
11+
# This covers typical Linux and macOS architectures.x
12+
supportedSystems = [
13+
"x86_64-linux"
14+
"aarch64-linux"
15+
"x86_64-darwin"
16+
"aarch64-darwin"
17+
];
18+
19+
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
20+
in
21+
{
22+
devShells = forAllSystems (
23+
system:
24+
let
25+
pkgs = import nixpkgs {
26+
inherit system;
27+
config = {
28+
allowUnfreePredicate =
29+
pkg:
30+
builtins.elem (nixpkgs.lib.getName pkg) [
31+
"graphite-cli"
32+
];
33+
};
34+
};
35+
in
36+
{
37+
default = pkgs.mkShell {
38+
name = "lightdash-docs-dev-shell";
39+
40+
buildInputs = with pkgs; [
41+
nodejs
42+
graphite-cli
43+
];
44+
};
45+
}
46+
);
47+
};
48+
}

0 commit comments

Comments
 (0)