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