From 7762738276b48154a0b234b3f4b30d3d844c19d0 Mon Sep 17 00:00:00 2001 From: isabel Date: Sat, 28 Oct 2023 14:08:22 +0100 Subject: [PATCH 1/3] feat(hm): micro init --- modules/home-manager/default.nix | 1 + modules/home-manager/micro.nix | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 modules/home-manager/micro.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index a4bac3b4..fa596901 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -23,6 +23,7 @@ in ./glamour.nix ./gtk.nix ./neovim.nix + ./micro.nix ./polybar.nix ./sway.nix ./tmux.nix diff --git a/modules/home-manager/micro.nix b/modules/home-manager/micro.nix new file mode 100644 index 00000000..a006377c --- /dev/null +++ b/modules/home-manager/micro.nix @@ -0,0 +1,35 @@ +{ config +, pkgs +, lib +, ... +}: +let + inherit (lib) mkIf; + cfg = config.programs.micro.catppuccin; + enable = cfg.enable && config.programs.micro.enable; + + themePath = "/catppuccin-${cfg.flavour}.micro"; + theme = + pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "micro"; + rev = "ed8ef015f97c357575b5013e18042c9faa6c068a"; + sha256 = "/JwZ+5bLYjZWcV5vH22daLqVWbyJelqRyGa7V0b7EG8="; + } + + "/src" + + themePath; +in +{ + options.programs.micro.catppuccin = + lib.ctp.mkCatppuccinOpt "micro" config; + + # xdg is required for this to work + config = + { + xdg.enable = mkIf enable (lib.mkForce true); + } + // (lib.mkIf enable { + xdg.configFile."micro/colorschemes${themePath}".source = theme; + }); +} From 2072acaa8320a6529973830cfc7792b6cb09dc76 Mon Sep 17 00:00:00 2001 From: Isabel <71222764+isabelroses@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:45:25 +0000 Subject: [PATCH 2/3] Update modules/home-manager/micro.nix Co-authored-by: seth --- modules/home-manager/micro.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/home-manager/micro.nix b/modules/home-manager/micro.nix index a006377c..f809ba11 100644 --- a/modules/home-manager/micro.nix +++ b/modules/home-manager/micro.nix @@ -4,11 +4,10 @@ , ... }: let - inherit (lib) mkIf; cfg = config.programs.micro.catppuccin; enable = cfg.enable && config.programs.micro.enable; - themePath = "/catppuccin-${cfg.flavour}.micro"; + themePath = "catppuccin-${cfg.flavour}.micro"; theme = pkgs.fetchFromGitHub { @@ -17,19 +16,20 @@ let rev = "ed8ef015f97c357575b5013e18042c9faa6c068a"; sha256 = "/JwZ+5bLYjZWcV5vH22daLqVWbyJelqRyGa7V0b7EG8="; } - + "/src" - + themePath; + + "/src/${themePath}"; in { options.programs.micro.catppuccin = lib.ctp.mkCatppuccinOpt "micro" config; - # xdg is required for this to work - config = - { - xdg.enable = mkIf enable (lib.mkForce true); - } - // (lib.mkIf enable { - xdg.configFile."micro/colorschemes${themePath}".source = theme; - }); + config = lib.mkIf enable { + programs.micro.settings.colorscheme = lib.removeSuffix ".micro" themePath; + + xdg = { + # xdg is required for this to work + enable = lib.mkForce true; + configFile."micro/colorschemes/${themePath}".source = theme; + }; + }; +} } From b2d9bbd9e2dc9f724a9b3b44b50a9572ea17f4d7 Mon Sep 17 00:00:00 2001 From: Isabel <71222764+isabelroses@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:51:01 +0000 Subject: [PATCH 3/3] Update modules/home-manager/micro.nix Co-authored-by: seth --- modules/home-manager/micro.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/home-manager/micro.nix b/modules/home-manager/micro.nix index f809ba11..7efc2f12 100644 --- a/modules/home-manager/micro.nix +++ b/modules/home-manager/micro.nix @@ -32,4 +32,3 @@ in }; }; } -}