Files
nix/scripts/new-elixir.nix

35 lines
774 B
Nix

{ pkgs }:
pkgs.writeShellScriptBin "new-elixir" ''
nix-shell -p elixir --run "mix new $1 --sup"
cd $1
echo '
{
description = "$1";
inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; };
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
erlang = pkgs.beam.packages.erlang_26.erlang;
elixir = pkgs.beam.packages.erlang_26.elixir;
in {
devShells.''${system}.default = pkgs.mkShell {
packages = [
pkgs.fswatch
erlang
elixir
pkgs.inotify-tools
pkgs.lexical
];
};
};
}
' > flake.nix
echo 'use flake' > .envrc
direnv allow
git init
''