feat(modules): add support for helix (#8)

Co-authored-by: Sam Nystrom <sam@samnystrom.dev>
This commit is contained in:
seth 2023-04-14 22:37:39 -04:00 committed by GitHub
parent 9c304e2cd2
commit 298605b31e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View file

@ -2,6 +2,7 @@
imports = [
./bat.nix
./starship.nix
./helix.nix
./gtk.nix
];
options.catppuccin = {

View file

@ -0,0 +1,30 @@
{ config, pkgs, lib, ... }:
let cfg = config.programs.helix.catppuccin;
in {
options.programs.helix.catppuccin = with lib; {
enable = mkEnableOption "Catppuccin theme";
flavour = mkOption {
type = types.enum [ "latte" "frappe" "macchiato" "mocha" ];
default = config.catppuccin.flavour;
description = "Catppuccin flavour for Helix";
};
useItalics = mkEnableOption "Italics in Catppuccin theme for Helix";
};
config.programs.helix = with builtins;
with lib;
with pkgs;
let subdir = if cfg.useItalics then "default" else "no_italics";
in mkIf cfg.enable {
settings = {
theme = "catppuccin-${cfg.flavour}";
editor.color-modes = mkDefault true;
};
themes."catppuccin-${cfg.flavour}" = fromTOML (readFile (fetchFromGitHub {
owner = "catppuccin";
repo = "helix";
rev = "5677c16dc95297a804caea9161072ff174018fdd";
sha256 = "sha256-aa8KZ7/1TXcBqaV/TYOZ8rpusOf5QeQ9i2Upnncbziw=";
} + "/themes/${subdir}/catppuccin_${cfg.flavour}.toml"));
};
}