-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
# not sure what this is | ||
inputs.systems.url = "github:nix-systems/default"; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
systems, | ||
flake-utils, | ||
}: | ||
# not sure how to use this function | ||
flake-utils.lib.eachSystem (import systems) #what is systems? | ||
( | ||
system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
|
||
# Set the Erlang version | ||
erlangVersion = "erlangR26"; | ||
# Set the Elixir version | ||
elixirVersion = "elixir_1_15"; | ||
|
||
erlang = pkgs.beam.interpreters.${erlangVersion}; | ||
beamPackages = pkgs.beam.packages.${erlangVersion}; | ||
elixir = beamPackages.${elixirVersion}; | ||
in { | ||
# this doesn't work for some reason | ||
packages."<system>".default = with import <nixpkgs> {}; stdenv.mkDerivation { | ||
name = "next-ls"; | ||
src = self; | ||
buildInputs = [ | ||
erlang | ||
elixir | ||
pkgs.zig | ||
]; | ||
|
||
buildPhase = '' | ||
mix local.hex --force | ||
mix local.rebar --force | ||
mix deps.get | ||
BURRITO_TARGET="darwin_arm64" MIX_ENV=prod mix release | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
cp burrito_out/next_ls_darwin_arm64 $out/bin | ||
''; | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
buildInputs = [ | ||
erlang | ||
elixir | ||
]; | ||
}; | ||
} | ||
); | ||
} |