Skip to content

Commit

Permalink
fix(spicitify): support selecting color theme
Browse files Browse the repository at this point in the history
  • Loading branch information
misumisumi committed Sep 29, 2024
1 parent cda3399 commit abba01b
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 54 deletions.
64 changes: 38 additions & 26 deletions apps/user/color-theme/catppuccin/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
pkgs,
lib,
inputs,
config,
scheme ? "small",
colorTheme ? "catppuccin-macchiato",
Expand All @@ -17,34 +18,45 @@ in
inherit flavor;
pointerCursor.enable = true;
};
programs = {
alacritty.catppuccin.enable = true;
bat.catppuccin.enable = true;
btop.catppuccin.enable = true;
git.delta.catppuccin.enable = true;
kitty.catppuccin.enable = true;
obs-studio.catppuccin.enable = true;
starship = {
catppuccin.enable = true;
settings = {
palettes."catppuccin_${flavor}" =
let
palette =
(lib.importTOML "${config.catppuccin.sources.starship}/themes/${flavor}.toml")
.palettes."catppuccin_${flavor}";
in
{
bg = palette.base;
terminal_dark = palette.surface0;
fg = palette.text;
magenta = palette.maroon;
cyan = palette.teal;
};
programs =
{
alacritty.catppuccin.enable = true;
bat.catppuccin.enable = true;
btop.catppuccin.enable = true;
git.delta.catppuccin.enable = true;
kitty.catppuccin.enable = true;
obs-studio.catppuccin.enable = true;
starship = {
catppuccin.enable = true;
settings = {
palettes."catppuccin_${flavor}" =
let
palette =
(lib.importTOML "${config.catppuccin.sources.starship}/themes/${flavor}.toml")
.palettes."catppuccin_${flavor}";
in
{
bg = palette.base;
terminal_dark = palette.surface0;
fg = palette.text;
magenta = palette.maroon;
cyan = palette.teal;
};
};
};
yazi.catppuccin.enable = true;
zathura.catppuccin.enable = true;
}
// lib.optionalAttrs (scheme == "full") {
spicetify =
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{
theme = spicePkgs.themes.catppuccin;
colorScheme = "${flavor}";
};
};
yazi.catppuccin.enable = true;
zathura.catppuccin.enable = true;
};
services = {
dunst.catppuccin.enable = true;
};
Expand Down
24 changes: 18 additions & 6 deletions apps/user/color-theme/nord/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
lib,
pkgs,
inputs,
scheme,
...
}:
Expand All @@ -16,12 +17,23 @@
./kitty.nix
./rofi.nix
];
programs = {
starship.settings = lib.importTOML ./starship/nord.toml;
yazi.theme = lib.importTOML ./yazi/nord.toml;
bat.config.theme = "nord";
btop.settings.color_theme = "nord";
};
programs =
{
starship.settings = lib.importTOML ./starship/nord.toml;
yazi.theme = lib.importTOML ./yazi/nord.toml;
bat.config.theme = "nord";
btop.settings.color_theme = "nord";
}
// lib.optionalAttrs (scheme == "full") {
spicetify =
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
in
{
theme = spicePkgs.themes.nord;
colorScheme = "Nord";
};
};
xdg.configFile =
{
"bat/Nord.tmTheme".source = ./sublime/Nord.tmTheme;
Expand Down
58 changes: 38 additions & 20 deletions apps/user/color-theme/tokyonight/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pkgs,
lib,
config,
inputs,
scheme ? "small",
colorTheme ? "tokyonight-storm",
...
Expand All @@ -13,28 +14,45 @@ let
if (lib.versionAtLeast config.home.version.release "24.11") then "themeFile" else "theme";
in
{
programs = {
alacritty.settings = lib.importTOML "${pack}/alacritty/tokyonight_${flavor}.toml";
starship.settings = lib.importTOML ./starship/${flavor}.toml;
kitty."${kittyAttrName}" = "tokyo_night_${flavor}";
yazi.theme = lib.importTOML "${pack}/yazi/tokyonight_${flavor}.toml" // {
manager.syntect_theme = "${pack}/sublime/tokyonight_${flavor}.tmTheme";
};
bat = {
config.theme = flavor;
themes.${flavor} = {
src = pack;
file = "sublime/tokyonight_${flavor}.tmTheme";
programs =
{
alacritty.settings = lib.importTOML "${pack}/alacritty/tokyonight_${flavor}.toml";
starship.settings = lib.importTOML ./starship/${flavor}.toml;
kitty."${kittyAttrName}" = "tokyo_night_${flavor}";
yazi.theme = lib.importTOML "${pack}/yazi/tokyonight_${flavor}.toml" // {
manager.syntect_theme = "${pack}/sublime/tokyonight_${flavor}.tmTheme";
};
bat = {
config.theme = flavor;
themes.${flavor} = {
src = pack;
file = "sublime/tokyonight_${flavor}.tmTheme";
};
};
btop.settings = {
color_theme = "tokyo-night";
};
git.includes = [ { path = "${pack}/delta/tokyonight_${flavor}.gitconfig"; } ];
zathura.extraConfig = ''
include ${pack + "/zatura/tokyonight_${flavor}.zathurarc"}
'';
}
// lib.optionalAttrs (scheme == "full") {
spicetify =
let
spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system};
fixedFlavor = {
day = "latte";
storm = "frappe";
moon = "macchiato";
night = "mocha";
};
in
{
theme = spicePkgs.themes.catppuccin;
colorScheme = "${fixedFlavor.${flavor}}";
};
};
btop.settings = {
color_theme = "tokyo-night";
};
git.includes = [ { path = "${pack}/delta/tokyonight_${flavor}.gitconfig"; } ];
zathura.extraConfig = ''
include ${pack + "/zatura/tokyonight_${flavor}.zathurarc"}
'';
};
}
// lib.optionalAttrs (scheme != "core") {
home.sessionVariables = {
Expand Down
2 changes: 0 additions & 2 deletions apps/user/full/programs/spicetify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ in
{
programs.spicetify = {
enable = true;
theme = spicePkgs.themes.catppuccin;
colorScheme = "mocha";

enabledExtensions = with spicePkgs.extensions; [
copyToClipboard
Expand Down

0 comments on commit abba01b

Please sign in to comment.