more robust logic for stylix theme picking
This commit is contained in:
62
stylix.nix
62
stylix.nix
@@ -5,27 +5,63 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.stylix;
|
||||
mkScheme = color: name: polarity: image: {
|
||||
inherit name polarity image;
|
||||
iconPackage = pkgs.papirus-icon-theme.override { inherit color; };
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/${name}.yaml";
|
||||
};
|
||||
schemes = {
|
||||
who = mkScheme "orange" "catppuccin-frappe" "dark" ./wallpapers/Nikolay_Kasatkin_Who.jpeg;
|
||||
jesus = mkScheme "red" "equilibrium-light" "light" ./wallpapers/jesus.png;
|
||||
ballerinas = mkScheme "brown" "mocha" "dark" ./wallpapers/Waay-Ballerinas.jpeg;
|
||||
};
|
||||
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 base16Scheme;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user