From 05d19c1813a73a5e5b4ec152876dc9d282025ec3 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Wed, 10 Jul 2024 08:27:17 +0100 Subject: [PATCH] Add plasma config back, reconfigure to coexist with sway config Split system-level sway and plasma config into separate files, move sway-specific home-level config to sway file. Only truly common desktop components are kept in common spaces. This allows much easier switching between using KDE Plasma and Sway. --- flake.lock | 24 ++ flake.nix | 10 + home/Northstar.nix | 26 ++- home/Scorch.nix | 15 +- home/Tone.nix | 34 ++- home/Vanguard.nix | 58 +++-- home/desktop/default.nix | 57 +---- home/desktop/plasma/default.nix | 219 ++++++++++++++++++ home/desktop/plasma/konsole.nix | 32 +++ home/desktop/plasma/onelight.colorscheme | 100 ++++++++ home/desktop/{ => sway}/avizo/default.nix | 0 home/desktop/sway/default.nix | 49 +++- home/desktop/{ => sway}/foot/default.nix | 0 home/desktop/{ => sway}/fuzzel/default.nix | 0 home/desktop/{ => sway}/mako/default.nix | 0 home/desktop/{ => sway}/rofi/default.nix | 0 home/desktop/{ => sway}/swayidle/default.nix | 0 home/desktop/{ => sway}/swaylock/default.nix | 0 .../{ => sway}/swaylock/swaylockfx.nix | 0 home/desktop/{ => sway}/swaync/default.nix | 0 home/desktop/{ => sway}/waybar/default.nix | 0 home/desktop/{ => sway}/wlogout/default.nix | 0 .../{ => sway}/wlogout/icons/hibernate.png | Bin .../desktop/{ => sway}/wlogout/icons/lock.png | Bin .../{ => sway}/wlogout/icons/logout.png | Bin .../{ => sway}/wlogout/icons/reboot.png | Bin .../{ => sway}/wlogout/icons/shutdown.png | Bin .../{ => sway}/wlogout/icons/suspend.png | Bin system/Northstar.nix | 7 +- system/Scorch.nix | 2 +- system/Tone.nix | 5 +- system/Vanguard.nix | 2 +- system/desktop/default.nix | 63 +++++ system/desktop/plasma.nix | 14 ++ system/{desktop.nix => desktop/sway.nix} | 65 +----- system/laptop.nix | 2 +- 36 files changed, 622 insertions(+), 162 deletions(-) create mode 100644 home/desktop/plasma/default.nix create mode 100644 home/desktop/plasma/konsole.nix create mode 100644 home/desktop/plasma/onelight.colorscheme rename home/desktop/{ => sway}/avizo/default.nix (100%) rename home/desktop/{ => sway}/foot/default.nix (100%) rename home/desktop/{ => sway}/fuzzel/default.nix (100%) rename home/desktop/{ => sway}/mako/default.nix (100%) rename home/desktop/{ => sway}/rofi/default.nix (100%) rename home/desktop/{ => sway}/swayidle/default.nix (100%) rename home/desktop/{ => sway}/swaylock/default.nix (100%) rename home/desktop/{ => sway}/swaylock/swaylockfx.nix (100%) rename home/desktop/{ => sway}/swaync/default.nix (100%) rename home/desktop/{ => sway}/waybar/default.nix (100%) rename home/desktop/{ => sway}/wlogout/default.nix (100%) rename home/desktop/{ => sway}/wlogout/icons/hibernate.png (100%) rename home/desktop/{ => sway}/wlogout/icons/lock.png (100%) rename home/desktop/{ => sway}/wlogout/icons/logout.png (100%) rename home/desktop/{ => sway}/wlogout/icons/reboot.png (100%) rename home/desktop/{ => sway}/wlogout/icons/shutdown.png (100%) rename home/desktop/{ => sway}/wlogout/icons/suspend.png (100%) create mode 100644 system/desktop/default.nix create mode 100644 system/desktop/plasma.nix rename system/{desktop.nix => desktop/sway.nix} (55%) diff --git a/flake.lock b/flake.lock index 52b52b0e..cb27d068 100644 --- a/flake.lock +++ b/flake.lock @@ -105,12 +105,36 @@ "type": "github" } }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720369165, + "narHash": "sha256-MLRzgdEEmckPVwwllD8+4zkqnnxfMgFw5zk6O3JUiks=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "995d818078778b366e6302ea32d83c2ba586e015", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "plasma-manager", + "type": "github" + } + }, "root": { "inputs": { "base16": "base16", "home-manager": "home-manager", "iosevka-custom": "iosevka-custom", "nixpkgs": "nixpkgs_2", + "plasma-manager": "plasma-manager", "tt-schemes": "tt-schemes" } }, diff --git a/flake.nix b/flake.nix index 5c23e237..89760961 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,13 @@ url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; iosevka-custom.url = "git+https://git.xenia.me.uk/pixelifytica/iosevka.git"; base16.url = "github:SenchoPens/base16.nix"; tt-schemes = { @@ -23,6 +30,7 @@ outputs = { nixpkgs, home-manager, + plasma-manager, iosevka-custom, base16, tt-schemes, @@ -41,6 +49,7 @@ }; in { inherit iosevkaCustom; + inherit (plasma-manager.packages.${system}) rc2nix; accentColourName = "base0E"; fonts = with iosevkaCustom; rec { sizes = { @@ -97,6 +106,7 @@ backupFileExtension = "backup"; users.${username} = { imports = [ + plasma-manager.homeManagerModules.plasma-manager base16.homeManagerModule {scheme = "${tt-schemes}/base16/one-light.yaml";} ./home/default.nix diff --git a/home/Northstar.nix b/home/Northstar.nix index 82ece262..228c1116 100644 --- a/home/Northstar.nix +++ b/home/Northstar.nix @@ -1,9 +1,21 @@ -{...}: { - imports = [./personal.nix]; - wayland.windowManager.sway.config.workspaceOutputAssign = [ - { - output = "eDP-1"; - workspace = "1"; - } +{ + config, + lib, + ... +}: { + imports = [ + ./personal.nix + ./desktop/plasma/default.nix ]; + programs.plasma = lib.mkIf config.programs.plasma.enable { + configFile.kcminputrc."Libinput/1739/52759/SYNA32AA:00 06CB:CE17 Touchpad".NaturalScroll = true; + }; + wayland.windowManager.sway = lib.mkIf config.wayland.windowManager.sway.enable { + config.workspaceOutputAssign = [ + { + output = "eDP-1"; + workspace = "1"; + } + ]; + }; } diff --git a/home/Scorch.nix b/home/Scorch.nix index 82fbce76..02df3516 100644 --- a/home/Scorch.nix +++ b/home/Scorch.nix @@ -1,6 +1,13 @@ -{...}: { - imports = [./work.nix]; - wayland.windowManager.sway.config = { - output."Dell Inc. DELL P3223QE CCG8YN3".scale = "1.5"; +{ + config, + lib, + ... +}: { + imports = [ + ./work.nix + ./desktop/plasma/default.nix + ]; + wayland.windowManager.sway = lib.mkIf config.wayland.windowManager.sway.enable { + config.output."Dell Inc. DELL P3223QE CCG8YN3".scale = "1.5"; }; } diff --git a/home/Tone.nix b/home/Tone.nix index 7fde6f2a..a99bce36 100644 --- a/home/Tone.nix +++ b/home/Tone.nix @@ -1,15 +1,27 @@ -{...}: { - imports = [./work.nix]; - wayland.windowManager.sway.config = { - output."eDP-1".scale = "1.25"; - workspaceOutputAssign = [ - { - output = "eDP-1"; - workspace = "1"; - } - ]; +{ + config, + lib, + ... +}: { + imports = [ + ./work.nix + ./desktop/plasma/default.nix + ]; + programs.plasma = lib.mkIf config.programs.plasma.enable { + configFile.kcminputrc."Libinput/1160/4132/DELL0A21:00 0488:1024 Touchpad".NaturalScroll = true; }; - services.kanshi = { + wayland.windowManager.sway = lib.mkIf config.wayland.windowManager.sway.enable { + config = { + output."eDP-1".scale = "1.25"; + workspaceOutputAssign = [ + { + output = "eDP-1"; + workspace = "1"; + } + ]; + }; + }; + services.kanshi = lib.mkIf config.wayland.windowManager.sway.enable { enable = true; settings = let laptopScreen = { diff --git a/home/Vanguard.nix b/home/Vanguard.nix index 14d6cb13..f0fb8c56 100644 --- a/home/Vanguard.nix +++ b/home/Vanguard.nix @@ -1,35 +1,43 @@ -{pkgs, ...}: { +{ + config, + lib, + pkgs, + ... +}: { imports = [ ./personal.nix ./games/default.nix ./streaming/default.nix + ./desktop/plasma/default.nix ]; home.packages = with pkgs; [blender prusa-slicer]; - wayland.windowManager.sway.config = { - output = { - "Microstep MSI G27CQ4 E2 Unknown" = { - mode = "2560x1440@120Hz"; - position = "1920 0"; - adaptive_sync = "on"; - }; - "Acer Technologies ED270R TJMEE0043W01" = { - mode = "1920x1080@120Hz"; - position = "0 140"; - adaptive_sync = "off"; + wayland.windowManager.sway = lib.mkIf config.wayland.windowManager.sway.enable { + config = { + output = { + "Microstep MSI G27CQ4 E2 Unknown" = { + mode = "2560x1440@120Hz"; + position = "1920 0"; + adaptive_sync = "on"; + }; + "Acer Technologies ED270R TJMEE0043W01" = { + mode = "1920x1080@120Hz"; + position = "0 140"; + adaptive_sync = "off"; + }; }; + workspaceOutputAssign = [ + { + output = "DP-1"; + workspace = "2"; + } + { + output = "DP-2"; + workspace = "1"; + } + ]; + startup = [ + {command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-1 --primary";} + ]; }; - workspaceOutputAssign = [ - { - output = "DP-1"; - workspace = "2"; - } - { - output = "DP-2"; - workspace = "1"; - } - ]; - startup = [ - {command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-1 --primary";} - ]; }; } diff --git a/home/desktop/default.nix b/home/desktop/default.nix index d20a4fdb..0731a067 100644 --- a/home/desktop/default.nix +++ b/home/desktop/default.nix @@ -5,17 +5,7 @@ accentColourName, ... }: { - imports = [ - ./sway/default.nix - ./alacritty/default.nix - ./avizo/default.nix - ./fuzzel/default.nix - ./swaylock/default.nix - ./swayidle/default.nix - ./swaync/default.nix - ./waybar/default.nix - ./wlogout/default.nix - ]; + imports = [./alacritty/default.nix]; home = { pointerCursor = let name = @@ -33,46 +23,13 @@ }; }; packages = with pkgs; [ - pinentry-gnome3 - gnome.seahorse - ffmpeg - evince libreoffice-fresh inkscape webcord teams-for-linux - grim - slurp - swayimg - swaybg - (writeShellScriptBin "protonmail-setup-bridge" '' - pkill -9 -f protonmail-bridge - ${protonmail-bridge}/bin/protonmail-bridge -c - swaymsg exec "${protonmail-bridge}/bin/protonmail-bridge -n" - '') - (writeShellScriptBin "davmail-setup" '' - systemctl --user restart davmail # Ensure config file is present - systemctl --user stop davmail - ${davmail}/bin/davmail -n ~/.davmail.properties - systemctl --user restart davmail - '') ]; }; - services = { - avizo.enable = true; - gpg-agent.pinentryPackage = pkgs.pinentry-gnome3; - syncthing.enable = true; - kdeconnect = { - enable = true; - indicator = true; - }; - udiskie = { - enable = true; - notify = true; - automount = true; - tray = "never"; - }; - }; + services.syncthing.enable = true; programs.mpv.enable = true; gtk = let extraCss = import ./base16/gtk.nix { @@ -104,16 +61,16 @@ name = "Colloid-${toCapital color}-${toCapital config.scheme.variant}"; }; iconTheme = let - color = "violet"; + color = "breeze"; in { package = pkgs.papirus-icon-theme.override {inherit color;}; name = "Papirus-${toCapital config.scheme.variant}"; }; }; - qt = { - enable = true; - style.name = "gtk2"; - }; + # qt = { + # enable = true; + # style.name = "breeze"; + # }; xdg = { mime.enable = true; mimeApps = let diff --git a/home/desktop/plasma/default.nix b/home/desktop/plasma/default.nix new file mode 100644 index 00000000..5149b84f --- /dev/null +++ b/home/desktop/plasma/default.nix @@ -0,0 +1,219 @@ +{ + config, + pkgs, + fonts, + rc2nix, + ... +}: { + imports = [ + ../default.nix + ./konsole.nix + ]; + home.packages = with pkgs; [ + rc2nix + wl-clipboard + colloid-kde + ]; + services.gpg-agent.pinentryPackage = pkgs.pinentry-qt; + programs.plasma = { + enable = true; + overrideConfig = true; + + workspace = { + clickItemTo = "open"; + lookAndFeel = "org.kde.breeze.desktop"; + theme = "breeze-light"; + colorScheme = "BreezeLight"; + cursor = { + inherit (config.home.pointerCursor) size; + theme = config.home.pointerCursor.name; + }; + iconTheme = "Papirus"; + wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}"; + }; + + fonts = let + general = { + family = fonts.sansSerif.name; + pointSize = 12; + }; + small = { + inherit (general) family; + pointSize = general.pointSize - 2; + }; + fixedWidth = { + family = fonts.monospace.name; + pointSize = 12; + }; + in { + inherit general small fixedWidth; + menu = general; + toolbar = general; + windowTitle = small; + }; + + hotkeys.commands = { + "launch-emacs" = { + name = "Launch Emacs Client Window"; + key = "Meta+Alt+X"; + command = "emacsclient -c"; + }; + }; + + panels = [ + { + height = 32; + lengthMode = "fill"; + location = "bottom"; + alignment = "center"; + hiding = "normalpanel"; + floating = true; + widgets = [ + { + name = "org.kde.plasma.kickoff"; + config.General = { + icon = "nix-snowflake"; + primaryActions = "0"; + favoritesDisplay = "0"; + applicationsDisplay = "1"; + pin = "false"; + showActionButtonCaptions = "true"; + compactMode = "false"; + }; + } + { + name = "org.kde.plasma.icontasks"; + config.General = { + maxStripes = "1"; + showToolTips = "true"; + launchers = [ + "applications:org.kde.konsole.desktop" + "preferred://filemanager" + "preferred://browser" + ]; + }; + } + { + name = "org.kde.plasma.pager"; + config.General = { + showWindowIcons = "true"; + showOnlyCurrentScreen = "false"; + wrapPage = "true"; + }; + } + "org.kde.plasma.cameraindicator" + { + systemTray = { + icons = { + spacing = "small"; + scaleToFit = false; + }; + }; + } + { + digitalClock = { + date = { + enable = true; + format = "isoDate"; + position = "besideTime"; + }; + time = { + format = "24h"; + showSeconds = "onlyInTooltip"; + }; + calendar.showWeekNumbers = true; + }; + } + { + name = "org.kde.plasma.userswitcher"; + config.General = { + showFace = "true"; + showName = "false"; + showFullName = "true"; + showTechnicalInfo = "true"; + }; + } + ]; + } + ]; + + shortcuts = { + ksmserver = { + "Lock Session" = ["Screensaver" "Meta+Alt+L"]; + }; + kwin = { + "Walk Through Windows of Current Application" = "Alt+`"; + "Walk Through Windows of Current Application (Reverse)" = "Alt+¬"; + "ToggleMouseClick" = "Meta+*"; + "Expose" = "Meta+,"; + "Switch Window Down" = "Meta+J"; + "Switch Window Left" = "Meta+H"; + "Switch Window Right" = "Meta+L"; + "Switch Window Up" = "Meta+K"; + }; + }; + + kwin = { + virtualDesktops = { + rows = 1; + number = 4; + }; + effects = { + translucency.enable = true; + blur.enable = true; + cube.enable = true; + dimAdminMode.enable = true; + }; + }; + + configFile = { + baloofilerc."Basic Settings"."Indexing-Enabled" = false; + plasmanotifyrc.Notifications.NormalAlwaysOnTop = true; + kcminputrc.Keyboard.NumLock = 1; + krunnerrc.General.FreeFloating = true; + kscreenlockerrc = { + Daemon.Timeout = 15; + Greeter.WallpaperPlugin = "org.kde.potd"; + }; + klipperrc = { + General = { + SyncClipboards = true; + MaxClipItems = 5; + IgnoreImages = false; + KeepClipboardContents = false; + }; + }; + kdeglobals = { + General = { + TerminalApplication = "konsole"; + TerminalService = "org.kde.konsole.desktop"; + }; + }; + kwinrc = { + Plugins = { + frozenappEnabled = false; + mouseclickEnabled = true; + shakecursorEnabled = true; + }; + Windows = { + FocusPolicy = "FocusFollowsMouse"; + RollOverDesktops = true; + }; + Tiling.padding = 10; + NightColor = { + Active = true; + Mode = "Location"; + LatitudeFixed = "51.7"; + LongitudeFixed = "-1.2"; + }; + "Effect-translucency" = { + Inactive = 100; + MoveResize = 80; + Dialogs = 80; + ComboboxPopups = 80; + Menus = 80; + }; + }; + }; + }; +} diff --git a/home/desktop/plasma/konsole.nix b/home/desktop/plasma/konsole.nix new file mode 100644 index 00000000..22459e17 --- /dev/null +++ b/home/desktop/plasma/konsole.nix @@ -0,0 +1,32 @@ +{ + pkgs, + fonts, + ... +}: { + home.packages = [pkgs.kdePackages.yakuake]; + programs.konsole = { + enable = true; + defaultProfile = "One-Light"; + customColorSchemes.onelight = ./onelight.colorscheme; + profiles.onelight = { + name = "One-Light"; + colorScheme = "onelight"; + font = { + name = fonts.monospace.name; + size = fonts.sizes.terminal; + }; + extraConfig = { + "Interaction Options" = { + "TextEditorCmd" = 6; + "TextEditorCmdCustom" = "emacsclient -c +LINE:COLUMN PATH"; + "UnderlineFilesEnabled" = "true"; + "OpenLinksByDirectClickEnabled" = "true"; + }; + "Terminal Features" = { + "BlinkingCursorEnabled" = "true"; + "VerticalLine" = "false"; + }; + }; + }; + }; +} diff --git a/home/desktop/plasma/onelight.colorscheme b/home/desktop/plasma/onelight.colorscheme new file mode 100644 index 00000000..60630cd7 --- /dev/null +++ b/home/desktop/plasma/onelight.colorscheme @@ -0,0 +1,100 @@ +[Background] +Color=250,250,250 + +[BackgroundFaint] +Color=250,250,250 + +[BackgroundIntense] +Color=250,250,250 + +[Color0] +Color=250,250,250 + +[Color0Faint] +Color=160,161,167 + +[Color0Intense] +Color=160,161,167 + +[Color1] +Color=202,18,67 + +[Color1Faint] +Color=202,18,67 + +[Color1Intense] +Color=202,18,67 + +[Color2] +Color=80,161,79 + +[Color2Faint] +Color=80,161,79 + +[Color2Intense] +Color=80,161,79 + +[Color3] +Color=215,95,0 + +[Color3Faint] +Color=215,95,0 + +[Color3Intense] +Color=215,95,0 + +[Color4] +Color=64,120,242 + +[Color4Faint] +Color=64,120,242 + +[Color4Intense] +Color=64,120,242 + +[Color5] +Color=166,38,164 + +[Color5Faint] +Color=166,38,164 + +[Color5Intense] +Color=166,38,164 + +[Color6] +Color=1,132,188 + +[Color6Faint] +Color=1,132,188 + +[Color6Intense] +Color=1,132,188 + +[Color7] +Color=56,58,66 + +[Color7Faint] +Color=9,10,11 + +[Color7Intense] +Color=9,10,11 + +[Foreground] +Color=56,58,66 + +[ForegroundFaint] +Color=56,58,66 + +[ForegroundIntense] +Color=56,58,66 + +[General] +Anchor=0.5,0.5 +Blur=true +ColorRandomization=false +Description=One Light +FillStyle=Tile +Opacity=0.9 +Wallpaper= +WallpaperFlipType=NoFlip +WallpaperOpacity=1 diff --git a/home/desktop/avizo/default.nix b/home/desktop/sway/avizo/default.nix similarity index 100% rename from home/desktop/avizo/default.nix rename to home/desktop/sway/avizo/default.nix diff --git a/home/desktop/sway/default.nix b/home/desktop/sway/default.nix index b775b266..9945fa07 100644 --- a/home/desktop/sway/default.nix +++ b/home/desktop/sway/default.nix @@ -10,9 +10,54 @@ ${pkgs.swaybg}/bin/swaybg -m fill -i ${../wallpapers/landscapes/tropic_island_day.jpg} ''; in { - home.packages = [set-background]; + imports = [ + ../default.nix + ./avizo/default.nix + ./fuzzel/default.nix + ./swaylock/default.nix + ./swayidle/default.nix + ./swaync/default.nix + ./waybar/default.nix + ./wlogout/default.nix + ]; + home.packages = with pkgs; [ + set-background + pinentry-gnome3 + gnome.seahorse + ffmpeg + evince + grim + slurp + swayimg + swaybg + (writeShellScriptBin "protonmail-setup-bridge" '' + pkill -9 -f protonmail-bridge + ${protonmail-bridge}/bin/protonmail-bridge -c + swaymsg exec "${protonmail-bridge}/bin/protonmail-bridge -n" + '') + (writeShellScriptBin "davmail-setup" '' + systemctl --user restart davmail # Ensure config file is present + systemctl --user stop davmail + ${davmail}/bin/davmail -n ~/.davmail.properties + systemctl --user restart davmail + '') + ]; programs.waybar.systemd.target = "sway-session.target"; - services.kanshi.systemdTarget = "sway-session.target"; + services = { + kanshi.systemdTarget = "sway-session.target"; + gpg-agent.pinentryPackage = pkgs.pinentry-gnome3; + avizo.enable = true; + kdeconnect = { + enable = true; + indicator = true; + }; + udiskie = { + enable = true; + notify = true; + automount = true; + tray = "never"; + }; + }; wayland.windowManager.sway = { enable = true; package = diff --git a/home/desktop/foot/default.nix b/home/desktop/sway/foot/default.nix similarity index 100% rename from home/desktop/foot/default.nix rename to home/desktop/sway/foot/default.nix diff --git a/home/desktop/fuzzel/default.nix b/home/desktop/sway/fuzzel/default.nix similarity index 100% rename from home/desktop/fuzzel/default.nix rename to home/desktop/sway/fuzzel/default.nix diff --git a/home/desktop/mako/default.nix b/home/desktop/sway/mako/default.nix similarity index 100% rename from home/desktop/mako/default.nix rename to home/desktop/sway/mako/default.nix diff --git a/home/desktop/rofi/default.nix b/home/desktop/sway/rofi/default.nix similarity index 100% rename from home/desktop/rofi/default.nix rename to home/desktop/sway/rofi/default.nix diff --git a/home/desktop/swayidle/default.nix b/home/desktop/sway/swayidle/default.nix similarity index 100% rename from home/desktop/swayidle/default.nix rename to home/desktop/sway/swayidle/default.nix diff --git a/home/desktop/swaylock/default.nix b/home/desktop/sway/swaylock/default.nix similarity index 100% rename from home/desktop/swaylock/default.nix rename to home/desktop/sway/swaylock/default.nix diff --git a/home/desktop/swaylock/swaylockfx.nix b/home/desktop/sway/swaylock/swaylockfx.nix similarity index 100% rename from home/desktop/swaylock/swaylockfx.nix rename to home/desktop/sway/swaylock/swaylockfx.nix diff --git a/home/desktop/swaync/default.nix b/home/desktop/sway/swaync/default.nix similarity index 100% rename from home/desktop/swaync/default.nix rename to home/desktop/sway/swaync/default.nix diff --git a/home/desktop/waybar/default.nix b/home/desktop/sway/waybar/default.nix similarity index 100% rename from home/desktop/waybar/default.nix rename to home/desktop/sway/waybar/default.nix diff --git a/home/desktop/wlogout/default.nix b/home/desktop/sway/wlogout/default.nix similarity index 100% rename from home/desktop/wlogout/default.nix rename to home/desktop/sway/wlogout/default.nix diff --git a/home/desktop/wlogout/icons/hibernate.png b/home/desktop/sway/wlogout/icons/hibernate.png similarity index 100% rename from home/desktop/wlogout/icons/hibernate.png rename to home/desktop/sway/wlogout/icons/hibernate.png diff --git a/home/desktop/wlogout/icons/lock.png b/home/desktop/sway/wlogout/icons/lock.png similarity index 100% rename from home/desktop/wlogout/icons/lock.png rename to home/desktop/sway/wlogout/icons/lock.png diff --git a/home/desktop/wlogout/icons/logout.png b/home/desktop/sway/wlogout/icons/logout.png similarity index 100% rename from home/desktop/wlogout/icons/logout.png rename to home/desktop/sway/wlogout/icons/logout.png diff --git a/home/desktop/wlogout/icons/reboot.png b/home/desktop/sway/wlogout/icons/reboot.png similarity index 100% rename from home/desktop/wlogout/icons/reboot.png rename to home/desktop/sway/wlogout/icons/reboot.png diff --git a/home/desktop/wlogout/icons/shutdown.png b/home/desktop/sway/wlogout/icons/shutdown.png similarity index 100% rename from home/desktop/wlogout/icons/shutdown.png rename to home/desktop/sway/wlogout/icons/shutdown.png diff --git a/home/desktop/wlogout/icons/suspend.png b/home/desktop/sway/wlogout/icons/suspend.png similarity index 100% rename from home/desktop/wlogout/icons/suspend.png rename to home/desktop/sway/wlogout/icons/suspend.png diff --git a/system/Northstar.nix b/system/Northstar.nix index cc688d8c..b433d6e4 100644 --- a/system/Northstar.nix +++ b/system/Northstar.nix @@ -1 +1,6 @@ -{...}: {imports = [./laptop.nix];} +{...}: { + imports = [ + ./laptop.nix + ./desktop/plasma.nix + ]; +} diff --git a/system/Scorch.nix b/system/Scorch.nix index 2c16c398..4fb32e16 100644 --- a/system/Scorch.nix +++ b/system/Scorch.nix @@ -1,5 +1,5 @@ {pkgs, ...}: { - imports = [./desktop.nix]; + imports = [./desktop/plasma.nix]; boot = { loader.efi.efiSysMountPoint = "/boot/efi"; initrd = { diff --git a/system/Tone.nix b/system/Tone.nix index e3711647..02504e20 100644 --- a/system/Tone.nix +++ b/system/Tone.nix @@ -1,5 +1,8 @@ {pkgs, ...}: { - imports = [./laptop.nix]; + imports = [ + ./laptop.nix + ./desktop/plasma.nix + ]; boot.initrd = { secrets = {"/crypto_keyfile.bin" = null;}; luks.devices."luks-761eeb11-3091-4142-9232-4fb33165eccd" = { diff --git a/system/Vanguard.nix b/system/Vanguard.nix index b7b0cadc..62d7fcdd 100644 --- a/system/Vanguard.nix +++ b/system/Vanguard.nix @@ -1,5 +1,5 @@ {config, ...}: { - imports = [./desktop.nix]; + imports = [./desktop/plasma.nix]; boot = { initrd.kernelModules = ["amdgpu"]; extraModulePackages = with config.boot.kernelPackages; [v4l2loopback]; diff --git a/system/desktop/default.nix b/system/desktop/default.nix new file mode 100644 index 00000000..9e180f8b --- /dev/null +++ b/system/desktop/default.nix @@ -0,0 +1,63 @@ +{ + config, + lib, + pkgs, + ... +}: { + nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; + system.autoUpgrade.operation = "boot"; + hardware.bluetooth.enable = true; + environment = { + sessionVariables = { + NIXOS_OZONE_WL = "1"; + QT_QPA_PLATFORM = lib.mkIf config.programs.sway.enable "wayland"; + }; + systemPackages = with pkgs; [ + xdg-utils + hunspell + hunspellDicts.en_GB-large + ]; + }; + security = { + polkit.enable = true; + pam.loginLimits = [ + { + domain = "@users"; + item = "rtprio"; + type = "-"; + value = 1; + } + ]; + }; + programs = { + dconf.enable = true; + noisetorch.enable = true; + kdeconnect.enable = true; + gamescope = { + enable = true; + capSysNice = true; + }; + xwayland.enable = true; + }; + gtk.iconCache.enable = true; + services = { + flatpak.enable = true; + printing.enable = true; + pipewire = { + enable = true; + pulse.enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + }; + xserver = { + enable = false; + xkb = { + layout = "gb"; + variant = ""; + options = "ctrl:nocaps"; + }; + }; + }; +} diff --git a/system/desktop/plasma.nix b/system/desktop/plasma.nix new file mode 100644 index 00000000..6acc6a53 --- /dev/null +++ b/system/desktop/plasma.nix @@ -0,0 +1,14 @@ +{pkgs, ...}: { + imports = [./default.nix]; + environment.plasma6.excludePackages = with pkgs.kdePackages; [plasma-browser-integration]; + services = { + displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + desktopManager.plasma6 = { + enable = true; + enableQt5Integration = true; + }; + }; +} diff --git a/system/desktop.nix b/system/desktop/sway.nix similarity index 55% rename from system/desktop.nix rename to system/desktop/sway.nix index 7c3d2772..cbddd4c4 100644 --- a/system/desktop.nix +++ b/system/desktop/sway.nix @@ -1,21 +1,12 @@ { - config, lib, pkgs, ... }: { imports = [./default.nix]; - nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; - system.autoUpgrade.operation = "boot"; - hardware.bluetooth.enable = true; environment = { - sessionVariables = { - NIXOS_OZONE_WL = "1"; - GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim"; - QT_QPA_PLATFORM = lib.mkIf config.programs.sway.enable "wayland"; - }; + sessionVariables.GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim"; systemPackages = with pkgs; [ - xdg-utils wtype wl-clipboard libsecret @@ -23,34 +14,16 @@ libcamera glib gsettings-desktop-schemas - hunspell - hunspellDicts.en_GB-large pamixer pavucontrol playerctl brightnessctl ]; }; - security = { - polkit.enable = true; - pam = { - services.swaylock = {}; - loginLimits = [ - { - domain = "@users"; - item = "rtprio"; - type = "-"; - value = 1; - } - ]; - }; - }; + security.pam.services.swaylock = {}; programs = { - dconf.enable = true; light.enable = true; nm-applet.enable = true; - noisetorch.enable = true; - kdeconnect.enable = true; file-roller.enable = true; thunar = { enable = true; @@ -68,24 +41,11 @@ wrapperFeatures.gtk = true; xwayland.enable = true; }; - gamescope = { - enable = true; - capSysNice = true; - }; - xwayland.enable = true; - }; - gtk.iconCache.enable = true; - qt = { - enable = true; - style = "gtk2"; - platformTheme = "gtk2"; }; services = { dbus.packages = with pkgs; [gcr]; gnome.gnome-keyring.enable = true; - flatpak.enable = true; blueman.enable = true; - printing.enable = true; accounts-daemon.enable = true; tumbler.enable = true; udisks2.enable = true; @@ -93,14 +53,6 @@ enable = true; package = lib.mkForce pkgs.gnome3.gvfs; }; - pipewire = { - enable = true; - pulse.enable = true; - alsa = { - enable = true; - support32Bit = true; - }; - }; greetd = { enable = true; settings = let @@ -110,14 +62,11 @@ default_session = {inherit command;}; }; }; - xserver = { - enable = false; - xkb = { - layout = "gb"; - variant = ""; - options = "ctrl:nocaps"; - }; - }; + }; + qt = { + enable = true; + style = "gtk2"; + platformTheme = "gtk2"; }; xdg.portal = { enable = true; diff --git a/system/laptop.nix b/system/laptop.nix index 98b32f92..9f357577 100644 --- a/system/laptop.nix +++ b/system/laptop.nix @@ -1,5 +1,5 @@ {...}: { - imports = [./desktop.nix]; + imports = [./desktop/default.nix]; powerManagement.enable = true; services.auto-cpufreq = { enable = true;