From f6e63e555c76f7cb2232d0d0f62146f60d641377 Mon Sep 17 00:00:00 2001 From: Julian Sutter Date: Thu, 31 Jul 2025 01:13:57 -0700 Subject: [PATCH] Implement modular Plasma taskbar pinning system - Add modular pinning system using NixOS module options - Each desktop module now defines its own pinned applications: * plasma.nix: konsole, dolphin, firefox, tigervnc * gaming.nix: steam, discord * office.nix: slack, signal, libreoffice-writer, libreoffice-calc * dev.nix: windsurf * media.nix: rustdesk * dnm.nix: tor-browser, kleopatra (moved from crypto.nix) - Move Plasma config from user-specific to desktop module for consistency - Rename crypto.nix to dnm.nix and update references - All users with Plasma desktop get automatic taskbar pinning - Applications only appear when their desktop modules are active --- desktop/crypto.nix | 11 ----- desktop/dev.nix | 10 +++- desktop/dnm.nix | 16 +++++++ desktop/gaming.nix | 11 ++++- desktop/media.nix | 10 +++- desktop/office.nix | 12 ++++- desktop/plasma.nix | 112 +++++++++++++++++++++++++++------------------ flake.nix | 2 +- users/jsutter.nix | 4 +- 9 files changed, 124 insertions(+), 64 deletions(-) delete mode 100644 desktop/crypto.nix create mode 100644 desktop/dnm.nix diff --git a/desktop/crypto.nix b/desktop/crypto.nix deleted file mode 100644 index f0dcebe..0000000 --- a/desktop/crypto.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, pkgs, ... }: - -{ - -environment.systemPackages = with pkgs; [ - feather - electrum - kdePackages.kleopatra - tor-browser - ]; -} diff --git a/desktop/dev.nix b/desktop/dev.nix index d930ce9..3d65c4f 100644 --- a/desktop/dev.nix +++ b/desktop/dev.nix @@ -1,8 +1,12 @@ -{ config, pkgs, pkgs-unstable, ... }: +{ config, pkgs, pkgs-unstable, lib, ... }: { + # Add this module's pinned applications + desktop.plasma.pinnedApps = [ + "applications:windsurf.desktop" # Windsurf IDE + ]; -environment.systemPackages = with pkgs; [ + environment.systemPackages = with pkgs; [ (python3.withPackages(ps: with ps; [ pandas requests python-dotenv pip uv ])) nodejs rpi-imager @@ -15,4 +19,6 @@ programs.nix-ld.enable = true; # Android Development programs.adb.enable = true; + + } diff --git a/desktop/dnm.nix b/desktop/dnm.nix new file mode 100644 index 0000000..4451356 --- /dev/null +++ b/desktop/dnm.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: + +{ + # Add this module's pinned applications + desktop.plasma.pinnedApps = [ + "applications:tor-browser.desktop" # Tor browser + "applications:org.kde.kleopatra.desktop" # Kleopatra GPG + ]; + + environment.systemPackages = with pkgs; [ + feather + electrum + kdePackages.kleopatra + tor-browser + ]; +} diff --git a/desktop/gaming.nix b/desktop/gaming.nix index 71dc325..efb50b9 100644 --- a/desktop/gaming.nix +++ b/desktop/gaming.nix @@ -1,8 +1,13 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { + # Add this module's pinned applications + desktop.plasma.pinnedApps = [ + "applications:steam.desktop" # Steam gaming platform + "applications:discord.desktop" # Gaming communication + ]; -environment.systemPackages = with pkgs; [ + environment.systemPackages = with pkgs; [ discord # Gaming communication stremio # Media streaming # parsec-bin @@ -16,4 +21,6 @@ environment.systemPackages = with pkgs; [ dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server }; + + } diff --git a/desktop/media.nix b/desktop/media.nix index 1866dca..8e8d548 100644 --- a/desktop/media.nix +++ b/desktop/media.nix @@ -1,8 +1,16 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { + # Add this module's pinned applications + desktop.plasma.pinnedApps = [ + "applications:rustdesk.desktop" # Remote desktop client + ]; environment.systemPackages = with pkgs; [ vlc # Media player deluge # BitTorrent client + rustdesk # Remote desktop client ]; + + + } diff --git a/desktop/office.nix b/desktop/office.nix index be3884c..1030161 100644 --- a/desktop/office.nix +++ b/desktop/office.nix @@ -1,6 +1,13 @@ -{ config, pkgs, pkgs-unstable, ... }: +{ config, pkgs, pkgs-unstable, lib, ... }: { + # Add this module's pinned applications + desktop.plasma.pinnedApps = [ + "applications:slack.desktop" # Team communication + "applications:signal-desktop.desktop" # Private messaging + "applications:libreoffice-writer.desktop" # Write (LibreOffice Writer) + "applications:libreoffice-calc.desktop" # Calc (LibreOffice Calc) + ]; environment.systemPackages = with pkgs; [ libreoffice-qt thunderbird @@ -9,4 +16,7 @@ # gimp # Temporarily commented out to avoid build errors # calibre ]; + + + } diff --git a/desktop/plasma.nix b/desktop/plasma.nix index caa7cb1..1e4c00e 100644 --- a/desktop/plasma.nix +++ b/desktop/plasma.nix @@ -1,54 +1,76 @@ -{ config, pkgs, home-manager, ... }: +{ config, pkgs, lib, home-manager, ... }: { - services.xserver.enable = true; - services.displayManager.sddm.enable = true; - services.xserver.displayManager.lightdm.enable = false; - services.desktopManager.plasma6.enable = true; - environment.plasma6.excludePackages = with pkgs.kdePackages; [ - khelpcenter - ]; - - programs.dconf.enable = true; - programs.kdeconnect.enable = true; - hardware.bluetooth.enable = true; - - environment.systemPackages = with pkgs; [ - kdePackages.spectacle - arc-theme # Desktop theme - pinentry # GUI pinentry for GPG - tigervnc # VNC client/server - firefox # Web browser - tor-browser-bundle-bin # Tor browser - kleopatra # GPG key manager - ]; - - # GNUPG Stuff - services.pcscd.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; + # Define the module option for pinned applications + options.desktop.plasma.pinnedApps = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = []; + description = "List of applications to pin to the Plasma taskbar"; }; - # RDP - services.xrdp.enable = true; - services.xrdp.defaultWindowManager = "startplasma-x11"; - networking.firewall.allowedTCPPorts = [ 3389 ]; - services.xrdp.openFirewall = true; + config = { + # Add this module's pinned applications + desktop.plasma.pinnedApps = [ + "applications:org.kde.konsole.desktop" # Terminal + "applications:org.kde.dolphin.desktop" # Folder explorer + "applications:firefox.desktop" # Firefox browser + "applications:tigervnc.desktop" # TigerVNC + ]; - # Custom Keyboard Shortcuts for Plasma 6 - environment.etc."kglobalshortcutsrc".text = '' - [khotkeys] - Ctrl+Alt+Delete=Lock Session,none,Lock the session - ''; + services.xserver.enable = true; + services.displayManager.sddm.enable = true; + services.xserver.displayManager.lightdm.enable = false; + services.desktopManager.plasma6.enable = true; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + khelpcenter + ]; - # stop PackageKit polling - services.packagekit.enable = false; + programs.dconf.enable = true; + programs.kdeconnect.enable = true; + hardware.bluetooth.enable = true; + + environment.systemPackages = with pkgs; [ + kdePackages.spectacle + arc-theme # Desktop theme + pinentry # GUI pinentry for GPG + tigervnc # VNC client/server + firefox # Web browser + ]; - # remove the Discover GUI + tray notifier - environment.plasma5.excludePackages = with pkgs.libsForQt5; [ - discover - discover-notifier - ]; + # GNUPG Stuff + services.pcscd.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + # RDP + services.xrdp.enable = true; + services.xrdp.defaultWindowManager = "startplasma-x11"; + networking.firewall.allowedTCPPorts = [ 3389 ]; + services.xrdp.openFirewall = true; + + # Custom Keyboard Shortcuts for Plasma 6 + environment.etc."kglobalshortcutsrc".text = '' + [khotkeys] + Ctrl+Alt+Delete=Lock Session,none,Lock the session + ''; + + # stop PackageKit polling + services.packagekit.enable = false; + + # remove the Discover GUI + tray notifier + environment.plasma5.excludePackages = with pkgs.libsForQt5; [ + discover + ]; + + # Plasma taskbar pinning configuration for all users + # Pinned applications are defined in each desktop module and merged here + home-manager.sharedModules = [{ + xdg.configFile."plasma-org.kde.plasma.desktop-appletsrc".text = '' + [Containments][1][Applets][2][Configuration][General] + launchers=${lib.concatStringsSep "," config.desktop.plasma.pinnedApps} + ''; + }]; + }; } diff --git a/flake.nix b/flake.nix index 1ff1493..e9bd99a 100644 --- a/flake.nix +++ b/flake.nix @@ -47,7 +47,7 @@ ./desktop/gaming.nix ./desktop/media.nix ./desktop/virtualization.nix - ./desktop/crypto.nix + ./desktop/dnm.nix ]; in { nixosConfigurations = { diff --git a/users/jsutter.nix b/users/jsutter.nix index 58ee20d..e4b3c80 100644 --- a/users/jsutter.nix +++ b/users/jsutter.nix @@ -1,4 +1,4 @@ -{ config, pkgs, pkgs-unstable, home-manager, ... }: +{ config, pkgs, pkgs-unstable, home-manager, lib, ... }: { @@ -134,6 +134,8 @@ }; }; }; + + }; }; }