Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hm): micro init #47

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in
./glamour.nix
./gtk.nix
./neovim.nix
./micro.nix
./polybar.nix
./sway.nix
./tmux.nix
Expand Down
35 changes: 35 additions & 0 deletions modules/home-manager/micro.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ 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;
};
};
}
}
isabelroses marked this conversation as resolved.
Show resolved Hide resolved
Loading