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(home-manager): add support for freetube #327

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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/all-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
./fcitx5.nix
./fish.nix
./foot.nix
./freetube.nix
./fuzzel.nix
./fzf.nix
./gh-dash.nix
Expand Down
25 changes: 25 additions & 0 deletions modules/home-manager/freetube.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ config, lib, ... }:
let
inherit (config.programs.freetube.settings) baseTheme;
inherit (lib.ctp) mkAccentOpt mkUpper;
Anomalocaridid marked this conversation as resolved.
Show resolved Hide resolved
cfg = config.programs.freetube.catppuccin;
enable = cfg.enable && config.programs.freetube.enable;
in
{
options.programs.freetube.catppuccin = lib.ctp.mkCatppuccinOpt { name = "freetube"; } // {
accent = mkAccentOpt "FreeTube";
# FreeTube supports two accent colors
secondaryAccent = mkAccentOpt "FreeTube" // {
# Have the secondary accent default to FreeTube's main accent rather than the global Catppuccin accent
# This assumes most users would prefer both accent colors to be the same when only overriding the main one
default = cfg.accent;
};
};

config.programs.freetube.settings = lib.mkIf enable {
# NOTE: For some reason, baseTheme does not capitalize first letter, but the other settings do
baseTheme = "catppuccin${mkUpper cfg.flavor}";
mainColor = mkUpper "${baseTheme}${mkUpper cfg.accent}";
secColor = mkUpper "${baseTheme}${mkUpper cfg.secondaryAccent}";
};
}
1 change: 1 addition & 0 deletions tests/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
cava.enable = true;
fish.enable = true;
foot.enable = true;
freetube.enable = true;
fuzzel.enable = true;
fzf.enable = true;
gh-dash.enable = true;
Expand Down