-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
flake.nix
70 lines (60 loc) · 1.74 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
{
description = "Reimagined language server for Elixir";
inputs.nixpkgs.url = "flake:nixpkgs";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.systems.url = "github:nix-systems/default";
outputs = {
self,
nixpkgs,
systems,
...
} @ inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
flake = {
lib = {
mkLexical = {erlang}: erlang.callPackage ./nix/lexical.nix {};
};
};
systems = import systems;
perSystem = {
self',
pkgs,
...
}: let
erlang = pkgs.beam.packages.erlang;
lexical = self.lib.mkLexical {inherit erlang;};
in {
formatter = pkgs.alejandra;
apps.update-hash = let
script = pkgs.writeShellApplication {
name = "update-hash";
runtimeInputs = [ pkgs.nixFlakes pkgs.gawk ];
text = ''
nix --extra-experimental-features 'nix-command flakes' \
build --no-link "${self}#__fodHashGen" 2>&1 | gawk '/got:/ { print $2 }' || true
'';
};
in {
type = "app";
program = "${script}/bin/update-hash";
};
packages = {
inherit lexical;
default = lexical;
__fodHashGen = lexical.mixFodDeps.overrideAttrs (final: curr: {
outputHash = pkgs.lib.fakeSha256;
});
};
devShells.default = pkgs.mkShell {
packages =
[
erlang.elixir
]
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.darwin.apple_sdk.frameworks.CoreFoundation
pkgs.darwin.apple_sdk.frameworks.CoreServices
];
};
};
};
}