Skip to content

Collection of nix-colors adapters (Mirrored from GitLab)

Notifications You must be signed in to change notification settings

vfosnar/nix-colors-adapters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❄️ nix-colors-adapters

Configure theme of all your apps with a single line

Collection of adapters for automatically applying nix-colors base16 schemes.

Firefox: Two Firefox windows, one with Gruvbox Dark and second with Ayu Light theme

Dolphin (Kvantum): Two Dolphin windows, one with Gruvbox Dark and second with Ayu Light theme

Code for this example:

- colorScheme = inputs.nix-colors.colorSchemes.gruvbox-dark-hard;
+ colorScheme = inputs.nix-colors.colorSchemes.ayu-light;

Adapters

Adapter Accent Notes
Adwaita (GTK3, GTK4) 🟢 sets GTK3 theme to adw-gtk3
Alacritty 🔴
dunst 🟠
✨Firefox✨ 🟢 depends on Adwaita
GTK2 🟠
Kvantum 🟠 Kvantum is problematic, consider disabling it if you encounter broken apps
Rofi 🔴
swaylock 🟠
Wezterm 🔴

(🟢 supported, 🟠 possible, 🔴 impossible)

Install (system flake + system home-manager)

  1. configure home-manager, make sure to pass inputs to your home module (vimjoyer tutorial)
  2. add nix-colors and nix-colors-adapters to you inputs in flake.nix:
inputs = {
    ...
    nix-colors.url = "github:misterio77/nix-colors";
    nix-colors-adapters.url = "gitlab:vfosnar/nix-colors-adapters";
    ...
};
  1. import them in your home module home.nix:
imports = [
    ...
    inputs.nix-colors.homeManagerModules.default
    inputs.nix-colors-adapters.homeManagerModules.default
    ...
];
  1. you're done!

Configuration (home.nix)

You can configure any base16 theme using nix-colors.

To configure nix-colors with Gruvbox Dark Hard:

colorScheme = inputs.nix-colors.colorSchemes.gruvbox-dark-hard;

Enable/disable adapter

All adapters are enabled by default. To disable an adapter set nixColorsAdapters.<adapter>.enable = false;. For example to disable the kvantum adapter so you can manage its theme manually:

nixColorsAdapters = {
    kvantum.enable = false;
};

Configure Firefox

For Firefox to work you need to specify a list of profile names. The configuration will only apply to these profiles. To properly apply colors the System theme — auto theme must be manually set in Firefox settings.

nixColorsAdapters = {
    firefox.profiles = [ "alice", "bob" ];
};

Configure Wezterm

Themes for Wezterm cannot be applied automatically so you have to run the following in your wezterm.lua:

config.colors = wezterm.color.load_base16_scheme("${config.nixColorsAdapters.wezterm.base16-file}");
return config;

or if configuring Wezterm outside of home manager

local wezterm = require 'wezterm';
config.colors = wezterm.color.load_base16_scheme(" ~/.config/wezterm/nix-colors-adapters-base16.yaml");
return config;

Accent color

The accent color for selected theme is automatically selected for known themes (source). If you want to override the color and provide your own just set nixColorsAdapters.accent. Example:

nixColorsAdapters = {
    accent = "ff0000";
    # or
    accent = config.colorScheme.colors.base08;
};

Sources