Work on elixir template
All checks were successful
/ check (push) Successful in 5m24s

This commit is contained in:
Daniel Flanagan 2024-12-19 21:39:53 -06:00
parent ebfe621f4c
commit df79b8dc4a
4 changed files with 29 additions and 15 deletions

View file

@ -1,6 +1,8 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
git-hooks.url = "github:cachix/git-hooks.nix";
git-hooks.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs: let outputs = inputs: let
@ -8,6 +10,7 @@
in { in {
overlays = import nix/overlays.nix; overlays = import nix/overlays.nix;
packages = call (import nix/packages.nix); packages = call (import nix/packages.nix);
checks = call (import nix/checks.nix);
devShells = call (import nix/shells.nix); devShells = call (import nix/shells.nix);
}; };
} }

View file

@ -0,0 +1,17 @@
{
git-hooks,
pkgs,
...
}: {
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;
};
};
}

View file

@ -1,16 +1,9 @@
{ {
forSelf = final: prev: { forSelf = final: prev: {
erlangPackages = prev.beam.packagesWith prev.erlang_28; erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27;
erlang = final.erlangPackages.erlang; elixir = final.erlang.elixir_1_18;
elixir = final.erlangPackages.elixir_1_17; mixRelease = final.erlang.mixRelease.override {elixir = final.elixir;};
fetchMixDeps = final.erlang.fetchMixDeps.override {elixir = final.elixir;};
mixRelease = final.erlangPackages.mixRelease.override {
elixir = final.elixir;
};
fetchMixDeps = final.erlangPackages.fetchMixDeps.override {
elixir = final.elixir;
};
elixir-ls = prev.elixir-ls.override {elixir = final.elixir;}; elixir-ls = prev.elixir-ls.override {elixir = final.elixir;};
}; };
} }

View file

@ -4,19 +4,20 @@
... ...
}: let }: let
version = "1.0.0"; version = "1.0.0";
src = ./.; src = ../.;
pname = "my-package"; pname = "my-package";
in { in {
${pname} = pkgs.beamPackages.mixRelease { ${pname} = pkgs.mixRelease {
inherit pname version src; inherit pname version src;
mixFodDeps = pkgs.beamPackages.fetchMixDeps { mixFodDeps = pkgs.fetchMixDeps {
inherit version src; inherit version src;
pname = "mix-deps-${pname}"; pname = "mix-deps-${pname}";
hash = pkgs.lib.fakeSha256; sha256 = pkgs.lib.fakeSha256;
}; };
# buildInputs = with pkgs; []; # buildInputs = with pkgs; [];
# HOME = "$(pwd)"; # HOME = "$(pwd)";
# MIX_XDG = "$HOME"; # MIX_XDG = "$HOME";
# RELEASE_COOKIE = "test-cookie";
}; };
default = self.packages.${pkgs.system}.${pname}; default = self.packages.${pkgs.system}.${pname};