From d9e7e445e309fd520fd8d3612b49e542ba85c5c6 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 5 Oct 2025 19:53:42 -0500 Subject: [PATCH] feat: created plasma config --- flake.lock | 24 ++ flake.nix | 5 + modules/home/default.nix | 6 +- modules/home/gui/desktop/plasma/default.nix | 324 ++++++++++++++++++++ modules/nixos/default.nix | 7 +- modules/nixos/desktop/sddm/default.nix | 30 +- parts/config/devshells.nix | 1 + 7 files changed, 378 insertions(+), 19 deletions(-) create mode 100755 modules/home/gui/desktop/plasma/default.nix diff --git a/flake.lock b/flake.lock index 5dcee27..4d3adae 100755 --- a/flake.lock +++ b/flake.lock @@ -1404,6 +1404,29 @@ "type": "github" } }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1759321049, + "narHash": "sha256-8XkU4gIrLT2DJZWQyvsP5woXGZF5eE/7AnKfwQkiwYU=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "205dcfd4a30d4a5d1b4f28defee69daa7c7252cd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "plasma-manager", + "type": "github" + } + }, "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_2", @@ -1466,6 +1489,7 @@ "nixpkgs": "nixpkgs_7", "nixpkgs-stable": "nixpkgs-stable_3", "nur": "nur", + "plasma-manager": "plasma-manager", "pre-commit-hooks-nix": "pre-commit-hooks-nix", "sops-nix": "sops-nix", "systems": "systems_5", diff --git a/flake.nix b/flake.nix index e21481b..c624342 100755 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,11 @@ url = "github:helix-editor/helix"; inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/modules/home/default.nix b/modules/home/default.nix index b6c5709..91187c8 100755 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -21,6 +21,7 @@ in imports = builtins.attrValues { inherit (modules) cli + plasma brave floorp tor @@ -78,6 +79,7 @@ in imports = builtins.attrValues { inherit (modules) cli + plasma brave floorp tor @@ -108,8 +110,8 @@ in systemMonitor usbImager virtManager - hypr - wayland + # hypr + # wayland theming dolphin zotero diff --git a/modules/home/gui/desktop/plasma/default.nix b/modules/home/gui/desktop/plasma/default.nix new file mode 100755 index 0000000..d50727e --- /dev/null +++ b/modules/home/gui/desktop/plasma/default.nix @@ -0,0 +1,324 @@ +{ + flake, + osConfig, + lib, + pkgs, + ... +}: + +let + inherit (flake.config.aesthetics.themes) fonts; + inherit (flake.config.machines) devices; + mars = devices.mars.name; + deimos = devices.deimos.name; + host = osConfig.networking.hostName; + deviceLogic = + d: m: + if host == deimos then + d + else if host == mars then + m + else + null; +in +{ + imports = [ flake.inputs.plasma-manager.homeModules.plasma-manager ]; + + programs = { + plasma = { + enable = true; + workspace = { + clickItemTo = "select"; + lookAndFeel = "org.kde.breezedark.desktop"; + colorScheme = "Scratchy"; + }; + session = { + general.askForConfirmationOnLogout = false; + sessionRestore = { + excludeApplications = [ + (lib.getExe pkgs.bitwarden) + ]; + }; + }; + shortcuts = { + kwin = { + "Window to Desktop 1" = [ "Ctrl+!" ]; + "Window to Desktop 2" = [ "Ctrl+@" ]; + "Window to Desktop 3" = [ "Ctrl+#" ]; + "Window to Desktop 4" = [ "Ctrl+$" ]; + "Window to Desktop 5" = [ "Ctrl+%" ]; + "Switch to Desktop 1" = [ + "Meta+1" + "Ctrl+F1" + ]; + "Switch to Desktop 2" = [ + "Meta+2" + "Ctrl+F2" + ]; + "Switch to Desktop 3" = [ + "Meta+3" + "Ctrl+F3" + ]; + "Switch to Desktop 4" = [ + "Meta+4" + "Ctrl+F4" + ]; + "Window Close" = [ + "Meta+Tab" + "Alt+F4" + ]; + "Window Fullscreen" = [ "Ctrl+Shift+Tab" ]; + }; + }; + hotkeys = { + commands = { + "launch-obsidian" = { + name = "Launch Obsidian"; + key = "Meta+Z"; + command = lib.getExe pkgs.obsidian; + }; + "launch-feishin" = { + name = "Launch Feishin"; + key = "Meta+H"; + command = lib.getExe pkgs.feishin; + }; + "launch-scrcpy" = { + name = "Launch Scrcpy"; + key = "Meta+G"; + command = lib.getExe pkgs.scrcpy; + }; + "launch-dolphin" = { + name = "Launch Dolphin"; + key = "Meta+E"; + command = "dolphin"; + }; + "launch-steam" = { + name = "Launch Steam"; + key = "Meta+S"; + command = lib.getExe pkgs.steam; + }; + "launch-signal" = { + name = "Launch Signal"; + key = "Meta+N"; + command = lib.getExe pkgs.signal-desktop-bin; + }; + "launch-zeditor" = { + name = "Launch Zed Editor"; + key = "Meta+T"; + command = lib.getExe pkgs.zed-editor; + }; + "launch-floorp" = { + name = "Launch Floorp"; + key = "Meta+B"; + command = lib.getExe pkgs.floorp-bin; + }; + "launch-freetube" = { + name = "Launch FreeTube"; + key = "Meta+X"; + command = lib.getExe pkgs.freetube; + }; + "launch-vesktop" = { + name = "Launch Vesktop"; + key = "Meta+V"; + command = lib.getExe pkgs.vesktop; + }; + "launch-element" = { + name = "Launch Element"; + key = "Meta+M"; + command = lib.getExe pkgs.element-desktop; + }; + "launch-ghostty" = { + name = "Launch Ghostty"; + key = "Meta+D"; + command = lib.getExe pkgs.ghostty; + }; + "launch-bitwarden" = { + name = "Launch Bitwarden"; + key = "Meta+P"; + command = lib.getExe pkgs.bitwarden; + }; + "launch-dotfiles" = { + name = "Launch Dotfiles in Zellij"; + key = "Meta+F"; + command = "ghostty -e zellij a dotfiles"; + }; + "launch-yazi" = { + name = "Launch Dotfiles in Zellij"; + key = "Meta+R"; + command = "${lib.getExe pkgs.ghostty} -e ${lib.getExe pkgs.yazi}"; + }; + "launch-fuzzel" = { + name = "Launch Fuzzel"; + key = "Meta+Space"; + command = "fuzzel"; + }; + + # Screenshots & Utilities + "screenshot-gui" = { + name = "Screenshot GUI"; + key = "Meta+Shift+S"; + command = "flameshot gui"; + }; + # "launch-emote" = { + # name = "Launch Emoji Picker"; + # key = "Meta+Shift+."; + # command = lib.getExe pkgs.emote; + # }; + + # Media Controls + "media-next" = { + name = "Next Track"; + key = "Meta+Page_Up"; + command = "playerctl next"; + }; + "media-previous" = { + name = "Previous Track"; + key = "Meta+Page_Down"; + command = "playerctl previous"; + }; + "media-play-pause" = { + name = "Play/Pause"; + key = "Meta+Home"; + command = "playerctl play-pause"; + }; + + # System Controls + "system-shutdown" = { + name = "Shutdown"; + key = "Meta+Shift+End"; + command = "shutdown now"; + }; + "system-reboot" = { + name = "Reboot"; + key = "Meta+Shift+Insert"; + command = "systemctl reboot"; + }; + "lock-screen" = { + name = "Lock Screen"; + key = "Meta+Shift+Home"; + command = "swaylock"; + }; + }; + }; + kwin = { + virtualDesktops = { + rows = 1; + number = 5; + names = [ + "Desktop 1" + "Desktop 2" + "Desktop 3" + "Desktop 4" + "Desktop 5" + ]; + + }; + titlebarButtons.right = [ + "minimize" + "maximize" + "close" + ]; + nightLight = { + enable = true; + mode = "times"; + temperature = { + day = 4500; + night = 2500; + }; + time = { + evening = "22:00"; + morning = "07:00"; + }; + transitionTime = 30; + }; + effects = { + desktopSwitching = { + animation = "slide"; + navigationWrapping = true; + }; + minimization = { + animation = "squash"; + }; + shakeCursor.enable = false; + translucency.enable = true; + windowOpenClose = { + animation = "scale"; + }; + }; + }; + powerdevil = { + AC = { + autoSuspend = { + action = deviceLogic "sleep" null; + idleTimeout = deviceLogic 1200 null; + }; + dimDisplay = { + enable = deviceLogic true false; + idleTimeout = deviceLogic 900 null; + }; + displayBrightness = 100; + inhibitLidActionWhenExternalMonitorConnected = deviceLogic true null; + powerButtonAction = deviceLogic "lockScreen" "shutdown"; + powerProfile = "performance"; + turnOffDisplay = { + idleTimeout = deviceLogic 1800 null; + idleTimeoutWhenLocked = deviceLogic 600 null; + }; + whenLaptopLidClosed = deviceLogic "sleep" null; + whenSleepingEnter = deviceLogic "hybridSleep" null; + }; + battery = { + autoSuspend = { + action = "hibernate"; + idleTimeout = 1200; + }; + dimDisplay = { + enable = true; + idleTimeout = 1200; + }; + displayBrightness = 100; + inhibitLidActionWhenExternalMonitorConnected = true; + powerButtonAction = "hibernate"; + powerProfile = "powerSaving"; + turnOffDisplay = { + idleTimeout = 1800; + idleTimeoutWhenLocked = 600; + }; + whenLaptopLidClosed = "sleep"; + whenSleepingEnter = "standbyThenHibernate"; + }; + lowBattery = { + autoSuspend = { + action = "hibernate"; + idleTimeout = 900; + }; + dimDisplay = { + enable = true; + idleTimeout = 450; + }; + displayBrightness = 100; + inhibitLidActionWhenExternalMonitorConnected = true; + powerButtonAction = "hibernate"; + powerProfile = "powerSaving"; + turnOffDisplay = { + idleTimeout = 1200; + idleTimeoutWhenLocked = 600; + }; + whenLaptopLidClosed = "hibernate"; + whenSleepingEnter = "standbyThenHibernate"; + }; + batteryLevels = { + criticalLevel = 5; + lowLevel = 20; + }; + general.pausePlayersOnSuspend = true; + }; + windows.allowWindowsToRememberPositions = true; + }; + elisa.enable = false; + ghostwriter.enable = false; + kate.enable = false; + konsole.enable = false; + okular.enable = false; + }; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 95bf3f8..b48b8e5 100755 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -8,6 +8,7 @@ in imports = builtins.attrValues { inherit (modules) syncthing + # plasma ollama # niri hypr @@ -24,8 +25,10 @@ in deimos = { imports = builtins.attrValues { inherit (modules) - hypr - wayland + # hypr + # wayland + plasma + sddm network flatpak plymouth diff --git a/modules/nixos/desktop/sddm/default.nix b/modules/nixos/desktop/sddm/default.nix index 34ea7e6..da742d6 100755 --- a/modules/nixos/desktop/sddm/default.nix +++ b/modules/nixos/desktop/sddm/default.nix @@ -10,25 +10,25 @@ in { services = { displayManager = { - defaultSession = "hyprland"; + # defaultSession = "hyprland"; sddm = { enable = true; - package = (flake.inputs.nixpkgs-stable.legacyPackages.${pkgs.system}.kdePackages.sddm); + # package = (flake.inputs.nixpkgs-stable.legacyPackages.${pkgs.system}.kdePackages.sddm); enableHidpi = true; - wayland = true; - theme = "catppuccin-macchiato"; + # wayland = true; + # theme = "catppuccin-macchiato"; }; }; }; - environment = { - systemPackages = [ - (pkgs.catppuccin-sddm.override { - flavor = "macchiato"; - font = "${fonts.name}"; - fontSize = "${toString fonts.sizes.popups}"; - loginBackground = true; - }) - pkgs.catppuccin-sddm - ]; - }; + # environment = { + # systemPackages = [ + # (pkgs.catppuccin-sddm.override { + # flavor = "macchiato"; + # font = "${fonts.name}"; + # fontSize = "${toString fonts.sizes.popups}"; + # loginBackground = true; + # }) + # pkgs.catppuccin-sddm + # ]; + # }; } diff --git a/parts/config/devshells.nix b/parts/config/devshells.nix index 250e27e..d94d3a1 100755 --- a/parts/config/devshells.nix +++ b/parts/config/devshells.nix @@ -9,6 +9,7 @@ graphviz imv just + nixfmt just-lsp litemdview nil