added stuff

This commit is contained in:
vali 2024-04-09 23:11:33 +02:00
commit 236b8c2a6b
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,7 @@
{
imports = [
./gtk.nix
./qt.nix
./global.nix
];
}

View file

@ -0,0 +1,14 @@
{osConfig, ...}: let
cfg = osConfig.modules.style;
in {
# cursor theme
home = {
pointerCursor = {
package = cfg.pointerCursor.package; # pkgs.bibata-cursors;
name = cfg.pointerCursor.name; # "Bibata-Modern-Classic";
size = cfg.pointerCursor.size;
gtk.enable = true;
x11.enable = true;
};
};
}

View file

@ -0,0 +1,89 @@
{
osConfig,
config,
pkgs,
lib,
...
}: let
inherit (lib) mkIf;
inherit (osConfig.modules) device;
cfg = osConfig.modules.style;
acceptedTypes = ["laptop" "desktop" "hybrid" "lite"];
in {
config = mkIf (builtins.elem device.type acceptedTypes) {
xdg.systemDirs.data = let
schema = pkgs.gsettings-desktop-schemas;
in ["${schema}/share/gsettings-schemas/${schema.name}"];
home = {
packages = with pkgs; [
glib # gsettings
cfg.gtk.theme.package
cfg.gtk.iconTheme.package
];
sessionVariables = {
# set GTK theme to the name specified by the gtk theme package
GTK_THEME = "${cfg.gtk.theme.name}";
# gtk applications should use filepickers specified by xdg
GTK_USE_PORTAL = "${toString (lib.boolToNum cfg.gtk.usePortal)}";
};
};
gtk = {
enable = true;
theme = {
name = cfg.gtk.theme.name;
package = cfg.gtk.theme.package;
};
iconTheme = {
name = cfg.gtk.iconTheme.name;
package = cfg.gtk.iconTheme.package;
};
font = {
name = cfg.gtk.font.name;
size = cfg.gtk.font.size;
};
gtk2 = {
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
extraConfig = ''
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
'';
};
gtk3.extraConfig = {
gtk-toolbar-style = "GTK_TOOLBAR_BOTH";
gtk-toolbar-icon-size = "GTK_ICON_SIZE_LARGE_TOOLBAR";
gtk-decoration-layout = "appmenu:none";
gtk-button-images = 1;
gtk-menu-images = 1;
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
gtk-error-bell = 0;
gtk-application-prefer-dark-theme = true;
};
gtk4.extraConfig = {
gtk-decoration-layout = "appmenu:none";
gtk-enable-event-sounds = 0;
gtk-enable-input-feedback-sounds = 0;
gtk-xft-antialias = 1;
gtk-xft-hinting = 1;
gtk-xft-hintstyle = "hintslight";
gtk-error-bell = 0;
gtk-application-prefer-dark-theme = true;
};
};
};
}

View file

@ -0,0 +1,76 @@
{
pkgs,
lib,
osConfig,
...
}: let
inherit (lib) mkIf optionals;
dev = osConfig.modules.device;
sys = osConfig.modules.system;
cfg = osConfig.modules.style;
acceptedTypes = ["laptop" "desktop" "hybrid" "lite"];
in {
config = mkIf (builtins.elem dev.type acceptedTypes && sys.video.enable) {
xdg.configFile = {
"kdeglobals".source = cfg.qt.kdeglobals.source;
"Kvantum/kvantum.kvconfig".source = (pkgs.formats.ini {}).generate "kvantum.kvconfig" {
General.theme = "catppuccin";
Applications.catppuccin = ''
qt5ct, org.kde.dolphin, org.kde.kalendar, org.qbittorrent.qBittorrent, hyprland-share-picker, dolphin-emu, Nextcloud, nextcloud, cantata, org.kde.kid3-qt
'';
};
"Kvantum/catppuccin/catppuccin.kvconfig".source = builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Blue/Catppuccin-Mocha-Blue.kvconfig";
sha256 = "1f8xicnc5696g0a7wak749hf85ynfq16jyf4jjg4dad56y4csm6s";
};
"Kvantum/catppuccin/catppuccin.svg".source = builtins.fetchurl {
url = "https://raw.githubusercontent.com/catppuccin/Kvantum/main/src/Catppuccin-Mocha-Blue/Catppuccin-Mocha-Blue.svg";
sha256 = "0vys09k1jj8hv4ra4qvnrhwxhn48c2gxbxmagb3dyg7kywh49wvg";
};
};
qt = {
enable = true;
platformTheme = mkIf cfg.forceGtk "gtk"; # just an override for QT_QPA_PLATFORMTHEME, takes “gtk”, “gnome”, “qtct” or “kde”
style = mkIf (!cfg.forceGtk) {
name = cfg.qt.theme.name;
package = cfg.qt.theme.package;
};
};
home.packages = with pkgs;
[
libsForQt5.qt5ct
breeze-icons
# add theme package to path just in case
cfg.qt.theme.package
]
++ optionals cfg.useKvantum [
qt6Packages.qtstyleplugin-kvantum
libsForQt5.qtstyleplugin-kvantum
];
home.sessionVariables = {
# scaling - 1 means no scaling
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
# use wayland as the default backend, fallback to xcb if wayland is not available
QT_QPA_PLATFORM = "wayland;xcb";
# disable window decorations everywhere
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
# remain backwards compatible with qt5
DISABLE_QT5_COMPAT = "0";
# tell calibre to use the dark theme, because the light one hurts my eyes
CALIBRE_USE_DARK_PALETTE = "1";
};
};
}