Skip to content

Commit 013ddc5

Browse files
committed
[Nothing]: add nix develop support
1 parent e534a32 commit 013ddc5

File tree

4 files changed

+313
-0
lines changed

4 files changed

+313
-0
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
zig-cache
22
zig-out
3+
.direnv

flake.lock

Lines changed: 254 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: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
description = "For lua environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
zig-overlay.url = "github:mitchellh/zig-overlay";
7+
zls-overlay.url = "github:zigtools/zls";
8+
};
9+
10+
outputs = { self, nixpkgs, ... }@ inputs:
11+
let
12+
systems = [
13+
# "aarch64-linux"
14+
# "i686-linux"
15+
# "aarch64-darwin"
16+
# "x86_64-darwin"
17+
"x86_64-linux"
18+
];
19+
# This is a function that generates an attribute by calling a function you
20+
# pass to it, with each system as an argument
21+
forAllSystems = nixpkgs.lib.genAttrs systems;
22+
in
23+
{
24+
# This is for using nix direnv and flake develop environment
25+
devShells = forAllSystems (system:
26+
let
27+
pkgs = import nixpkgs {
28+
inherit system;
29+
overlays = [
30+
inputs.zig-overlay.overlays.default
31+
(final: prev: {
32+
zlspkgs = inputs.zls-overlay.packages.${system}.default;
33+
})
34+
];
35+
};
36+
in
37+
{
38+
default =
39+
pkgs.mkShell {
40+
packages = with pkgs; [
41+
zigpkgs.default
42+
zls
43+
nodePackages.live-server
44+
];
45+
};
46+
47+
nightly =
48+
pkgs.mkShell {
49+
packages = with pkgs;[
50+
zigpkgs.master
51+
zlspkgs
52+
nodePackages.live-server
53+
];
54+
};
55+
});
56+
};
57+
}

0 commit comments

Comments
 (0)