2022-07-28 15:47:10 -07:00
|
|
|
{
|
|
|
|
description = "A Nix-flake-based Elixir development environment";
|
|
|
|
|
|
|
|
inputs = {
|
2022-07-31 03:57:49 -07:00
|
|
|
dev.url = "github:the-nix-way/dev-templates";
|
2022-07-28 15:47:10 -07:00
|
|
|
};
|
|
|
|
|
2022-07-31 03:57:49 -07:00
|
|
|
outputs = { self, dev }:
|
|
|
|
let
|
|
|
|
inherit (dev.lib) flake-utils nixpkgs;
|
|
|
|
in flake-utils.lib.eachDefaultSystem (system:
|
2022-07-28 15:47:10 -07:00
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
2022-07-28 15:58:11 -07:00
|
|
|
inherit (pkgs)
|
|
|
|
darwin inotify-tools mkShell nodejs-18_x terminal-notifier;
|
|
|
|
inherit (pkgs.beam.packages.erlangR25) elixir elixir_ls;
|
2022-07-28 15:47:10 -07:00
|
|
|
inherit (pkgs.lib) optionals;
|
|
|
|
inherit (pkgs.stdenv) isDarwin isLinux;
|
|
|
|
|
2022-07-28 15:58:11 -07:00
|
|
|
linuxDeps = optionals isLinux [ inotify-tools ];
|
|
|
|
darwinDeps = optionals isDarwin [ terminal-notifier ]
|
|
|
|
++ (with darwin.apple_sdk.frameworks; [
|
|
|
|
CoreFoundation
|
|
|
|
CoreServices
|
|
|
|
]);
|
2022-07-28 15:47:10 -07:00
|
|
|
in {
|
|
|
|
devShells = {
|
|
|
|
default = mkShell {
|
2022-07-28 15:58:11 -07:00
|
|
|
buildInputs = [ elixir elixir_ls nodejs-18_x ] ++ linuxDeps
|
|
|
|
++ darwinDeps;
|
2022-07-28 15:47:10 -07:00
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
${elixir}/bin/mix --version
|
|
|
|
${elixir}/bin/iex --version
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|