From a0b39b4f63892b7314a8133930e97e0e30017c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Bori?= Date: Fri, 1 Nov 2024 23:21:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(plasma-manager):=20Fully=20applied?= =?UTF-8?q?=20the=20Dracula=20theme=20and=20declared=20the=20panel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/desktops/addons/plasma6/default.nix | 91 +++++++++++++++++-- modules/home/messages/discord/default.nix | 15 ++- .../nixos/display-managers/sddm/default.nix | 2 +- 3 files changed, 95 insertions(+), 13 deletions(-) diff --git a/modules/home/desktops/addons/plasma6/default.nix b/modules/home/desktops/addons/plasma6/default.nix index aa0232c..95e80e3 100644 --- a/modules/home/desktops/addons/plasma6/default.nix +++ b/modules/home/desktops/addons/plasma6/default.nix @@ -7,20 +7,91 @@ }: let inherit (lib) mkIf types; - inherit (lib.${namespace}) mkBoolOpt; + inherit (lib.${namespace}) mkBoolOpt mkOpt; cfg = config.${namespace}.desktops.addons.plasma6; + wallpaper = pkgs.${namespace}.wallpapers.nix-simple; in { options.${namespace}.desktops.addons.plasma6 = with types; { enable = mkBoolOpt false "Whether or not to enable GNOME addons."; + extraWorkspace = mkOpt attrs { + colorScheme = "DraculaPurple"; + theme = "Dracula"; + lookAndFeel = "Dracula"; + + windowDecorations = { + library = "org.kde.kwin.aurorae"; + theme = "__aurorae__svg__Dracula"; + }; + + splashScreen = { + theme = ""; + }; + + cursor = { + theme = "Dracula-cursors"; + }; + + #iconTheme = "Dracula"; + + inherit wallpaper; + } "Extra configuration for the workspace plasma-manager module."; + + kscreenlocker = mkOpt attrs { + appearance = { + inherit wallpaper; + }; + } "kscreenlocker plasma-manager module configuration."; + + widgets = mkOpt (listOf anything) [ + { + kickoff = { + sortAlphabetically = true; + icon = "nix-snowflake-white"; + }; + } + { + iconTasks = { + launchers = [ + "applications:systemsettings.desktop" + "applications:org.wezfurlong.wezterm.desktop" + "applications:firefox.desktop" + "applications:vesktop.desktop" + "applications:obsidian.desktop" + ]; + }; + } + "org.kde.plasma.marginsseparator" + { + systemTray.items = { + shown = [ + "org.kde.plasma.battery" + "org.kde.plasma.clipboard" + "org.kde.plasma.luminosity" + "org.kde.plasma.bluetooth" + "org.kde.plasma.networkmanagement" + "org.kde.plasma.volume" + ]; + }; + } + { + digitalClock = { + calendar.firstDayOfWeek = "monday"; + time.format = "24h"; + }; + } + ] "List of panel widgets."; }; config = mkIf cfg.enable { - home.packages = [ pkgs.${namespace}.my-dracula-theme ]; + home.packages = [ + pkgs.${namespace}.my-dracula-theme + pkgs.dracula-icon-theme + ]; stylix = { - # Generate impure (not managed by nix) gtk files + # Generate impure (not managed by nix) gtk files because it is using Qt targets.gtk.enable = false; # Trying to apply the wallpaper too early and then it doest not load the home-manager environment targets.kde.enable = false; @@ -30,13 +101,17 @@ in enable = true; workspace = { - colorScheme = "Dracula"; - theme = "Dracula"; + enableMiddleClickPaste = true; + } // cfg.extraWorkspace; - wallpaper = pkgs.${namespace}.wallpapers.nix-simple; + inherit (cfg) kscreenlocker; - enableMiddleClickPaste = true; - }; + panels = [ + { + location = "bottom"; + inherit (cfg) widgets; + } + ]; }; }; } diff --git a/modules/home/messages/discord/default.nix b/modules/home/messages/discord/default.nix index cfea0fb..1094d76 100644 --- a/modules/home/messages/discord/default.nix +++ b/modules/home/messages/discord/default.nix @@ -5,7 +5,7 @@ ... }: let - inherit (lib) mkIf types; + inherit (lib) mkIf types strings; inherit (lib.${namespace}) mkBoolOpt mkOpt @@ -14,12 +14,20 @@ let ; cfg = config.${namespace}.messages.discord; + + trimWith' = + s: + strings.trimWith { + start = true; + end = true; + } s; in { options.${namespace}.messages.discord = with types; { enable = mkBoolOpt false "Whether or not to manage discord."; + quickCss = mkOpt str (builtins.readFile ./custom.css) "Vencord quick CSS."; config = mkOpt attrs { - useQuickCss = true; + useQuickCss = ((trimWith' cfg.quickCss) != ""); plugins = { betterFolders = enabled; betterRoleContext = enabled; @@ -44,9 +52,8 @@ in enable = true; discord = disabled; vesktop.enable = true; - quickCss = builtins.readFile ./custom.css; - inherit (cfg) config; + inherit (cfg) config quickCss; }; }; } diff --git a/modules/nixos/display-managers/sddm/default.nix b/modules/nixos/display-managers/sddm/default.nix index db510f8..3598e0b 100644 --- a/modules/nixos/display-managers/sddm/default.nix +++ b/modules/nixos/display-managers/sddm/default.nix @@ -43,6 +43,6 @@ in theme = "Dracula"; }; - environment.systemPackages = with pkgs; [ theobori-nix.my-dracula-theme ]; + environment.systemPackages = [ pkgs.${namespace}.my-dracula-theme ]; }; }