diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 6452b8c..27439d9 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -454,6 +454,7 @@ merge.conflictstyle = "zdiff3"; push.autoSetupRemote = true; + pull.ff = "only"; branch.autoSetupMerge = true; diff --git a/templates/.gitignore b/templates/.gitignore new file mode 100644 index 0000000..301d47e --- /dev/null +++ b/templates/.gitignore @@ -0,0 +1 @@ +flake.lock diff --git a/templates/elixir/flake.lock b/templates/elixir/flake.lock deleted file mode 100644 index 9055d38..0000000 --- a/templates/elixir/flake.lock +++ /dev/null @@ -1,27 +0,0 @@ -{ - "nodes": { - "nixpkgs": { - "locked": { - "lastModified": 1734435836, - "narHash": "sha256-kMBQ5PRiFLagltK0sH+08aiNt3zGERC2297iB6vrvlU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "4989a246d7a390a859852baddb1013f825435cee", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/templates/elixir/flake.nix b/templates/elixir/flake.nix index aaeea38..7d30b37 100644 --- a/templates/elixir/flake.nix +++ b/templates/elixir/flake.nix @@ -1,6 +1,8 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + git-hooks.url = "github:cachix/git-hooks.nix"; + git-hooks.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs: let @@ -8,6 +10,7 @@ in { overlays = import nix/overlays.nix; packages = call (import nix/packages.nix); + checks = call (import nix/checks.nix); devShells = call (import nix/shells.nix); }; } diff --git a/templates/elixir/nix/checks.nix b/templates/elixir/nix/checks.nix new file mode 100644 index 0000000..d6e6f79 --- /dev/null +++ b/templates/elixir/nix/checks.nix @@ -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; + }; + }; +} diff --git a/templates/elixir/nix/overlays.nix b/templates/elixir/nix/overlays.nix index 912427f..8a9dcf7 100644 --- a/templates/elixir/nix/overlays.nix +++ b/templates/elixir/nix/overlays.nix @@ -1,16 +1,9 @@ { - forrSelf = final: prev: { - erlangPackages = prev.beam.packagesWith prev.erlang_28; - erlang = final.erlangPackages.erlang; - elixir = final.erlangPackages.elixir_1_17; - - mixRelease = final.erlangPackages.mixRelease.override { - elixir = final.elixir; - }; - fetchMixDeps = final.erlangPackages.fetchMixDeps.override { - elixir = final.elixir; - }; - + forSelf = final: prev: { + erlang = prev.beam.packagesWith prev.beam.interpreters.erlang_27; + elixir = final.erlang.elixir_1_18; + mixRelease = final.erlang.mixRelease.override {elixir = final.elixir;}; + fetchMixDeps = final.erlang.fetchMixDeps.override {elixir = final.elixir;}; elixir-ls = prev.elixir-ls.override {elixir = final.elixir;}; }; } diff --git a/templates/elixir/nix/packages.nix b/templates/elixir/nix/packages.nix index 42e6288..ed886a4 100644 --- a/templates/elixir/nix/packages.nix +++ b/templates/elixir/nix/packages.nix @@ -2,23 +2,23 @@ pkgs, self, ... -}: { - my-package = let - version = "1.0.0"; - src = ./.; - pname = "my-package"; - in - pkgs.beamPackages.mixRelease { - inherit pname version src; - mixFodDeps = pkgs.beamPackages.fetchMixDeps { - inherit version src; - pname = "mix-deps-${pname}"; - hash = pkgs.lib.fakeSha256; - }; - # buildInputs = with pkgs; []; - # HOME = "$(pwd)"; - # MIX_XDG = "$HOME"; +}: let + version = "1.0.0"; + src = ../.; + pname = "my-package"; +in { + ${pname} = pkgs.mixRelease { + inherit pname version src; + mixFodDeps = pkgs.fetchMixDeps { + inherit version src; + pname = "mix-deps-${pname}"; + sha256 = pkgs.lib.fakeSha256; }; + # buildInputs = with pkgs; []; + # HOME = "$(pwd)"; + # MIX_XDG = "$HOME"; + # RELEASE_COOKIE = "test-cookie"; + }; - default = self.packages.${pkgs.system}.my-package; + default = self.packages.${pkgs.system}.${pname}; }