Skip to content

Commit

Permalink
feat(hm): micro init (#47)
Browse files Browse the repository at this point in the history
* feat(hm): micro init

* Update modules/home-manager/micro.nix

Co-authored-by: seth <[email protected]>

* Update modules/home-manager/micro.nix

Co-authored-by: seth <[email protected]>

---------

Co-authored-by: seth <[email protected]>
  • Loading branch information
isabelroses and getchoo authored Nov 2, 2023
1 parent 4840eda commit 71f4a7d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ in
./gtk.nix
./mako.nix
./neovim.nix
./micro.nix
./polybar.nix
./sway.nix
./tmux.nix
Expand Down
34 changes: 34 additions & 0 deletions modules/home-manager/micro.nix
Original file line number Diff line number Diff line change
@@ -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;
};
};
}

0 comments on commit 71f4a7d

Please sign in to comment.