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