From bbbe2e7287e482ddd3103d9b10d130237a3908a0 Mon Sep 17 00:00:00 2001 From: PerchunPak Date: Wed, 18 Dec 2024 10:10:47 +0100 Subject: [PATCH] feat(home-manager): init oh-my-posh --- modules/home-manager/all-modules.nix | 1 + modules/home-manager/oh-my-posh.nix | 19 +++++++++++++++++++ tests/home.nix | 1 + 3 files changed, 21 insertions(+) create mode 100644 modules/home-manager/oh-my-posh.nix diff --git a/modules/home-manager/all-modules.nix b/modules/home-manager/all-modules.nix index 8233f298..096f1615 100644 --- a/modules/home-manager/all-modules.nix +++ b/modules/home-manager/all-modules.nix @@ -42,6 +42,7 @@ ./tmux.nix ./tofi.nix ./obs-studio.nix + ./oh-my-posh.nix ./waybar.nix ./yazi.nix ./zathura.nix diff --git a/modules/home-manager/oh-my-posh.nix b/modules/home-manager/oh-my-posh.nix new file mode 100644 index 00000000..a176ad49 --- /dev/null +++ b/modules/home-manager/oh-my-posh.nix @@ -0,0 +1,19 @@ +{ catppuccinLib }: +{ config, lib, ... }: + +let + inherit (config.catppuccin) sources; + + cfg = config.programs.oh-my-posh.catppuccin; + palette = (lib.importJSON "${sources.palette}/palette.json").${cfg.flavor}.colors; +in + +{ + options.programs.oh-my-posh.catppuccin = catppuccinLib.mkCatppuccinOption { name = "oh-my-posh"; }; + + config = lib.mkIf cfg.enable { + programs.oh-my-posh = { + settings.palette = lib.mapAttrs (colorName: colorInfo: colorInfo.hex) palette; + }; + }; +} diff --git a/tests/home.nix b/tests/home.nix index dd4dd22f..39634fb0 100644 --- a/tests/home.nix +++ b/tests/home.nix @@ -57,6 +57,7 @@ tmux.enable = true; tofi.enable = true; obs-studio.enable = true; + oh-my-posh.enable = true; waybar.enable = true; yazi.enable = true; zathura.enable = true;