Add theming support

This commit is contained in:
GHOSCHT 2023-11-04 14:55:10 +01:00
parent f3b0327a03
commit 5f75cf2aab
No known key found for this signature in database
5 changed files with 105 additions and 0 deletions

View file

@ -38,6 +38,11 @@
# xkbVariant = "";
# };
environment.defaultCursor = {
enable = true;
theme = "breeze_cursors";
};
time.timeZone = "Europe/Berlin";
i18n = {
defaultLocale = "en_US.UTF-8";

View file

@ -0,0 +1,44 @@
# Module to set a default cursor theme
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.environment.defaultCursor;
indexThemeText = theme: generators.toINI {} {"icon theme" = {Inherits = "${theme}";};};
mkDefaultCursorFile = theme:
pkgs.writeTextDir
"share/icons/default/index.theme"
"${indexThemeText theme}";
defaultCursorPkg = mkDefaultCursorFile cfg.theme;
in {
options = {
environment.defaultCursor = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to set a default cursor theme for graphical environments.
'';
};
theme = mkOption {
type = types.str;
default = "";
example = "Adwaita";
description = "The name of the defualt cursor theme.";
};
};
};
config = mkIf cfg.enable {
environment.systemPackages = [
defaultCursorPkg
];
};
}

View file

@ -0,0 +1,5 @@
[
# ./gtk.nix
# ./qt.nix
./cursor.nix
]

20
modules/theming/gtk.nix Normal file
View file

@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
vars,
...
}: {
home-manager.users.${vars.user} = {
gtk.enable = true;
# gtk.cursorTheme.package = pkgs.bibata-cursors;
# gtk.cursorTheme.name = "Bibata-Modern-Ice";
gtk.theme.package = pkgs.adw-gtk3;
gtk.theme.name = "adw-gtk3";
# gtk.iconTheme.package = gruvboxPlus;
# gtk.iconTheme.name = "GruvboxPlus";
};
}

31
modules/theming/qt.nix Normal file
View file

@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
vars,
...
}: {
environment.systemPackages = with pkgs; [
libsForQt5.qtstyleplugins
libsForQt5.qtstyleplugin-kvantum
#other stuff
];
home-manager.users.${vars.user} = {
qt.enable = true;
# platform theme "gtk" or "gnome"
qt.platformTheme = "gtk";
# name of the qt theme
qt.style.name = "adwaita";
# detected automatically:
# adwaita, adwaita-dark, adwaita-highcontrast,
# adwaita-highcontrastinverse, breeze,
# bb10bright, bb10dark, cde, cleanlooks,
# gtk2, motif, plastique
# package to use
qt.style.package = pkgs.adwaita-qt;
};
}