marleyos/modules/home/iconTheme.nix
punkfairie 3a5d15ffbd feat(modules): Add iconTheme module
Allows setting iconTheme globally.
2024-11-03 20:15:06 -08:00

60 lines
1.3 KiB
Nix

{ lib, config, ... }:
with lib;
let
# https://github.com/nix-community/home-manager/blob/master/modules/misc/gtk.nix
iconThemeType = types.submodule {
options = {
package = mkOption {
type = types.nullOr types.package;
default = null;
example = literalExpression "pkgs.gnome.adwaita-icon-theme";
description = ''
Package providing the icon theme. This package will be installed
to your profile. If `null` then the theme
is assumed to already be available in your profile.
'';
};
name = mkOption {
type = types.str;
example = "Adwaita";
description = "The name of the icon theme within the package.";
};
};
};
in
{
options = {
home = {
iconTheme = mkOption {
type = types.nullOr iconThemeType;
default = null;
description = ''
The icon theme to use.
'';
};
};
};
config =
let
cfg = config.home.iconTheme;
in
{
gtk = mkIf config.gtk.enable (mkDefault {
iconTheme = {
name = cfg.name;
package = cfg.package;
};
});
services.dunst = mkIf config.services.dunst.enable (mkDefault {
iconTheme = {
name = cfg.name;
package = cfg.package;
};
});
};
}