NixOS/stylix.nix

85 lines
1.9 KiB
Nix

{
pkgs,
lib,
config,
...
}:
let
scheme = schemes.ballerinas;
cfg = config.my.stylix;
mkScheme =
{
color ? null,
name ? null,
polarity,
image,
iconPackage ? pkgs.papirus-icon-theme.override { inherit color; },
}:
{
inherit
name
polarity
image
iconPackage
;
base16Scheme = if name != null then "${pkgs.base16-schemes}/share/themes/${name}.yaml" else null;
};
schemes = {
who = mkScheme {
name = "catppuccin-frappe";
polarity = "dark";
image = ./wallpapers/Nikolay_Kasatkin_Who.jpeg;
iconPackage = pkgs.catppuccin-papirus-folders.override {
flavor = "frappe";
accent = "peach";
};
};
space = mkScheme {
name = "solarflare";
color = "carmine";
polarity = "dark";
image = ./wallpapers/space.jpg;
};
jesus = mkScheme {
color = "red";
name = "equilibrium-light";
polarity = "light";
image = ./wallpapers/jesus.png;
};
ballerinas = mkScheme {
color = "brown";
name = "mocha";
polarity = "dark";
image = ./wallpapers/Waay-Ballerinas.jpeg;
};
};
in
{
options.my.stylix.enable = lib.mkEnableOption "enable";
config = {
stylix = {
inherit (scheme) image polarity;
enable = cfg.enable;
targets.qt.platform = lib.mkForce "qtct";
} // lib.optionalAttrs (scheme ? base16Scheme) { inherit (scheme) base16Scheme; };
home-manager.users.jawz = {
gtk = lib.mkIf (!cfg.enable) {
iconTheme = scheme.iconPackage;
};
stylix = {
enable = cfg.enable;
iconTheme = {
enable = cfg.enable;
package = scheme.iconPackage;
light = "Papirus-Light";
dark = "Papirus-Dark";
};
targets.librewolf = {
firefoxGnomeTheme.enable = cfg.enable;
profileNames = [ "jawz" ];
};
};
};
};
}