From ab352eb08e44921dfc87f48b647075d4bb9ef808 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 19 Dec 2024 20:29:10 -0600 Subject: [PATCH 1/5] Don't lock in templates during testing --- templates/.gitignore | 1 + templates/elixir/flake.lock | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) create mode 100644 templates/.gitignore delete mode 100644 templates/elixir/flake.lock 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 -} From 9fdea1fd176cd4613443ed3163f79481bfe49c30 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 19 Dec 2024 20:34:17 -0600 Subject: [PATCH 2/5] Fix typo --- templates/elixir/nix/overlays.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/elixir/nix/overlays.nix b/templates/elixir/nix/overlays.nix index 912427f..bad02d4 100644 --- a/templates/elixir/nix/overlays.nix +++ b/templates/elixir/nix/overlays.nix @@ -1,5 +1,5 @@ { - forrSelf = final: prev: { + forSelf = final: prev: { erlangPackages = prev.beam.packagesWith prev.erlang_28; erlang = final.erlangPackages.erlang; elixir = final.erlangPackages.elixir_1_17; From ebfe621f4c409312302500bd60e37bb8d754e0eb Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 19 Dec 2024 20:36:06 -0600 Subject: [PATCH 3/5] Simplify --- templates/elixir/nix/packages.nix | 33 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/templates/elixir/nix/packages.nix b/templates/elixir/nix/packages.nix index 42e6288..22bd52b 100644 --- a/templates/elixir/nix/packages.nix +++ b/templates/elixir/nix/packages.nix @@ -2,23 +2,22 @@ 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.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"; + }; - default = self.packages.${pkgs.system}.my-package; + default = self.packages.${pkgs.system}.${pname}; } From df79b8dc4a6a5c0d56d713557bc429c978b80a54 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 19 Dec 2024 21:39:53 -0600 Subject: [PATCH 4/5] Work on elixir template --- templates/elixir/flake.nix | 3 +++ templates/elixir/nix/checks.nix | 17 +++++++++++++++++ templates/elixir/nix/overlays.nix | 15 ++++----------- templates/elixir/nix/packages.nix | 9 +++++---- 4 files changed, 29 insertions(+), 15 deletions(-) create mode 100644 templates/elixir/nix/checks.nix 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 bad02d4..8a9dcf7 100644 --- a/templates/elixir/nix/overlays.nix +++ b/templates/elixir/nix/overlays.nix @@ -1,16 +1,9 @@ { forSelf = 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; - }; - + 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 22bd52b..ed886a4 100644 --- a/templates/elixir/nix/packages.nix +++ b/templates/elixir/nix/packages.nix @@ -4,19 +4,20 @@ ... }: let version = "1.0.0"; - src = ./.; + src = ../.; pname = "my-package"; in { - ${pname} = pkgs.beamPackages.mixRelease { + ${pname} = pkgs.mixRelease { inherit pname version src; - mixFodDeps = pkgs.beamPackages.fetchMixDeps { + mixFodDeps = pkgs.fetchMixDeps { inherit version src; pname = "mix-deps-${pname}"; - hash = pkgs.lib.fakeSha256; + sha256 = pkgs.lib.fakeSha256; }; # buildInputs = with pkgs; []; # HOME = "$(pwd)"; # MIX_XDG = "$HOME"; + # RELEASE_COOKIE = "test-cookie"; }; default = self.packages.${pkgs.system}.${pname}; From a49df451a271d571324b484a2ca0520743bd3106 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 20 Dec 2024 09:02:26 -0600 Subject: [PATCH 5/5] Notifications are round --- modules/home-manager/sway.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/sway.nix b/modules/home-manager/sway.nix index 65dc747..c3676d2 100644 --- a/modules/home-manager/sway.nix +++ b/modules/home-manager/sway.nix @@ -24,6 +24,7 @@ enable = true; text = with style.colors.withHashPrefix; '' border-size=1 + border-radius=5 max-visible=5 default-timeout=15000 font=Symbols Nerd Font ${toString style.font.size},${style.font.name} ${toString style.font.size}