parent
ccad1cefd5
commit
f2ea15fa7c
4 changed files with 28 additions and 7 deletions
3
templates/elixir/.gitignore
vendored
3
templates/elixir/.gitignore
vendored
|
@ -20,3 +20,6 @@ erl_crash.dump
|
|||
|
||||
# direnv cache
|
||||
/.direnv
|
||||
|
||||
# nix-generated pre commit hooks
|
||||
.pre-commit-config.yaml
|
||||
|
|
|
@ -2,16 +2,28 @@
|
|||
git-hooks,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}: let
|
||||
hook = {
|
||||
command,
|
||||
stages ? ["pre-commit"],
|
||||
...
|
||||
}: {
|
||||
inherit stages;
|
||||
enable = true;
|
||||
name = command;
|
||||
entry = command;
|
||||
pass_filenames = false;
|
||||
};
|
||||
in {
|
||||
git-hooks = git-hooks.lib.${pkgs.system}.run {
|
||||
src = ./..;
|
||||
hooks = {
|
||||
alejandra.enable = true;
|
||||
convco.enable = true;
|
||||
credo.enable = true;
|
||||
dialyzer.enable = true;
|
||||
mix-format.enable = true;
|
||||
mix-test.enable = true;
|
||||
credo = hook {command = "mix credo --strict";};
|
||||
formatting = hook {command = "mix format --check-formatted";};
|
||||
dialyzer = hook {command = "mix dialyzer";};
|
||||
test = hook {command = "mix test";};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ in {
|
|||
pname = "mix-deps-${pname}";
|
||||
sha256 = pkgs.lib.fakeSha256;
|
||||
};
|
||||
LANG = "C.UTF-8";
|
||||
# buildInputs = with pkgs; [];
|
||||
# HOME = "$(pwd)";
|
||||
# MIX_XDG = "$HOME";
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
{
|
||||
pkgs,
|
||||
# self,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
elixir-dev = pkgs.mkShell {
|
||||
shellHook = "export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive";
|
||||
shellHook = ''
|
||||
${self.checks.${pkgs.system}.git-hooks.shellHook}
|
||||
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
|
||||
'';
|
||||
# inputsFrom = [self.packages.${pkgs.system}.my-package];
|
||||
buildInputs = with pkgs; [
|
||||
elixir
|
||||
elixir-ls
|
||||
inotify-tools
|
||||
];
|
||||
MIX_ENV = "dev";
|
||||
};
|
||||
default = self.outputs.devShells.${pkgs.system}.elixir-dev;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue