-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
flake.nix
82 lines (77 loc) · 1.84 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
zigpkgs = {
url = "github:NixOS/nixpkgs/592a779f3c5e7bce1a02027abe11b7996816223f";
};
};
nixConfig = {
extra-substituters = ["https://elixir-tools.cachix.org"];
extra-trusted-public-keys = ["elixir-tools.cachix.org-1:GfK9E139Ysi+YWeS1oNN9OaTfQjqpLwlBaz+/73tBjU="];
};
outputs = {
self,
nixpkgs,
zigpkgs,
}: let
inherit (nixpkgs) lib;
# Helper to provide system-specific attributes
forAllSystems = f:
lib.genAttrs systems (system: let
pkgs = nixpkgs.legacyPackages.${system};
zpkgs = zigpkgs.legacyPackages.${system};
beamPackages = pkgs.beam_minimal.packages.erlang_27;
elixir = beamPackages.elixir_1_17;
in
f {inherit system pkgs zpkgs beamPackages elixir;});
systems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
"aarch64-linux"
];
in {
packages = forAllSystems ({
pkgs,
system,
beamPackages,
elixir,
...
}: {
default = pkgs.callPackage ./package.nix { inherit beamPackages elixir; };
});
devShells = forAllSystems ({
pkgs,
zpkgs,
beamPackages,
elixir,
...
}: let
aliased_7zz = pkgs.symlinkJoin {
name = "7zz-aliased";
paths = [pkgs._7zz];
postBuild = ''
ln -s ${pkgs._7zz}/bin/7zz $out/bin/7z
'';
};
in {
default = pkgs.mkShell {
# The Nix packages provided in the environment
packages = [
beamPackages.erlang
elixir
aliased_7zz
pkgs.autoconf
pkgs.just
pkgs.automake
pkgs.ncurses5
pkgs.openssl
pkgs.starship
pkgs.xz
zpkgs.zig_0_11
pkgs.zsh
];
};
});
};
}