From 71f4a7d6ffef709c6d4e8d8f229b0f6ac583f0a0 Mon Sep 17 00:00:00 2001 From: Isabel <71222764+isabelroses@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:05:02 +0000 Subject: [PATCH] feat(hm): micro init (#47) * feat(hm): micro init * Update modules/home-manager/micro.nix Co-authored-by: seth * Update modules/home-manager/micro.nix Co-authored-by: seth --------- Co-authored-by: seth --- modules/home-manager/default.nix | 1 + modules/home-manager/micro.nix | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 modules/home-manager/micro.nix diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index d40bded..6b3241f 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -24,6 +24,7 @@ in ./gtk.nix ./mako.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 0000000..7efc2f1 --- /dev/null +++ b/modules/home-manager/micro.nix @@ -0,0 +1,34 @@ +{ config +, pkgs +, lib +, ... +}: +let + 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; + + 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; + }; + }; +}