From 506163ff378c020850a7bfcac4d8836dddb450f4 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 27 Sep 2024 11:41:52 +0100 Subject: [PATCH] Customise plasma config to disable things set by stylix Split system-level sway config to separate file, imported by system/desktop.nix, and add plasma.nix at the same level --- system/desktop.nix | 36 +----- system/home/desktop.nix | 2 +- system/home/plasma/default.nix | 215 +++++++++++++++++---------------- system/home/sway/default.nix | 1 + system/plasma.nix | 14 +++ system/sway.nix | 42 +++++++ 6 files changed, 172 insertions(+), 138 deletions(-) create mode 100644 system/plasma.nix create mode 100644 system/sway.nix diff --git a/system/desktop.nix b/system/desktop.nix index d094fe92..ecd04ead 100644 --- a/system/desktop.nix +++ b/system/desktop.nix @@ -1,5 +1,6 @@ { pkgs, username, ... }: { + imports = [ ./sway.nix ]; home-manager.users.${username}.imports = [ ./home/desktop.nix ]; nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; hardware.bluetooth.enable = true; @@ -7,7 +8,6 @@ sessionVariables = { NIXOS_OZONE_WL = "1"; QT_QPA_PLATFORM = "wayland"; - GRIM_DEFAULT_DIR = "$HOME/Pictures/Screenshots"; }; systemPackages = with pkgs; [ libsecret @@ -33,14 +33,6 @@ dconf.enable = true; noisetorch.enable = true; kdeconnect.enable = true; - thunar = { - enable = true; - plugins = with pkgs.xfce; [ - thunar-archive-plugin - thunar-volman - ]; - }; - sway.enable = true; xwayland.enable = true; }; gtk.iconCache.enable = true; @@ -48,12 +40,6 @@ dbus.packages = [ pkgs.gcr ]; flatpak.enable = true; printing.enable = true; - tumbler.enable = true; - udisks2.enable = true; - gvfs = { - enable = true; - package = pkgs.gnome3.gvfs; - }; pipewire = { enable = true; pulse.enable = true; @@ -62,20 +48,6 @@ support32Bit = true; }; }; - greetd = { - enable = true; - settings = - let - default_session.command = "sway"; - in - { - inherit default_session; - initial_session = { - inherit (default_session) command; - user = username; - }; - }; - }; xserver = { enable = true; xkb = { @@ -85,14 +57,8 @@ }; }; }; - qt = { - enable = true; - style = "adwaita"; - platformTheme = "gnome"; - }; xdg.portal = { enable = true; config.common.default = "*"; # TODO change for xdg-desktop-portal > 1.17 changes - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; } diff --git a/system/home/desktop.nix b/system/home/desktop.nix index 1d9dc4fe..91cfc237 100644 --- a/system/home/desktop.nix +++ b/system/home/desktop.nix @@ -2,6 +2,7 @@ { imports = [ ./sway/default.nix + ./plasma/default.nix ./emacs/default.nix ./terminal/default.nix ./browser/default.nix @@ -9,7 +10,6 @@ ./services/email/default.nix ]; home.packages = with pkgs; [ - libreoffice-fresh webcord signal-desktop whatsapp-for-linux diff --git a/system/home/plasma/default.nix b/system/home/plasma/default.nix index a9bab311..c54f8de1 100644 --- a/system/home/plasma/default.nix +++ b/system/home/plasma/default.nix @@ -1,64 +1,74 @@ { config, - lib, + # lib, pkgs, ... }: { - imports = [ ./konsole.nix ]; + # imports = [ ./konsole.nix ]; home.packages = with pkgs; [ + libreoffice-qt-fresh rc2nix wl-clipboard - (papirus-icon-theme.override { color = "violet"; }) + (papirus-icon-theme.override { color = "breeze"; }) ]; services.gpg-agent.pinentryPackage = pkgs.pinentry-qt; programs.plasma = { enable = true; overrideConfig = true; - workspace = - let - toCapital = import ../lib/to_capital.nix lib; - in - { - clickItemTo = "open"; - theme = "default"; - colorScheme = "Breeze${toCapital config.lib.stylix.scheme.variant}"; - iconTheme = "Papirus-${toCapital config.lib.stylix.scheme.variant}"; - windowDecorations = { - library = "org.kde.breeze"; - theme = "Breeze"; - }; - cursor = { - inherit (config.home.pointerCursor) size; - theme = config.home.pointerCursor.name; - }; - wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}"; - }; + # workspace = + # let + # toCapital = import ../lib/to_capital.nix lib; + # in + # { + # clickItemTo = "open"; + # theme = "default"; + # colorScheme = "Breeze${toCapital config.lib.stylix.scheme.variant}"; + # iconTheme = "Papirus-${toCapital config.lib.stylix.scheme.variant}"; + # windowDecorations = { + # library = "org.kde.breeze"; + # theme = "Breeze"; + # }; + # cursor = { + # inherit (config.home.pointerCursor) size; + # theme = config.home.pointerCursor.name; + # }; + # wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}"; + # }; - fonts = - let - general = { - family = config.stylix.fonts.sansSerif.name; - pointSize = 12; - }; - small = { - inherit (general) family; - pointSize = general.pointSize - 2; - }; - fixedWidth = { - family = config.stylix.fonts.monospace.name; - pointSize = 12; - }; - in - { - inherit general small fixedWidth; - menu = general; - toolbar = general; - windowTitle = small; - }; + # fonts = + # let + # general = { + # family = config.stylix.fonts.sansSerif.name; + # pointSize = 12; + # }; + # small = { + # inherit (general) family; + # pointSize = general.pointSize - 2; + # }; + # fixedWidth = { + # family = config.stylix.fonts.monospace.name; + # pointSize = 12; + # }; + # in + # { + # inherit general small fixedWidth; + # menu = general; + # toolbar = general; + # windowTitle = small; + # }; hotkeys.commands = { + "launch-terminal" = + let + command = config.programs.plasma.configFile.kdeglobals.General.TerminalApplication.value; + in + { + inherit command; + name = "Launch ${command} emulator"; + key = "Ctrl+Alt+T"; + }; "launch-emacs" = { name = "Launch Emacs Client Window"; key = "Meta+Alt+X"; @@ -168,6 +178,7 @@ "InvertWindow" = "Meta+Ctrl+U"; "Invert Screen Colors" = [ ]; }; + "services/org.kde.konsole.desktop"."_launch" = [ ]; "services/org.kde.krunner.desktop"."_launch" = [ "Meta+Space" "Search" @@ -279,44 +290,44 @@ KeepClipboardContents = false; }; }; - kdeglobals = { - General = - let - AccentColor = - let - r = config.lib.stylix.scheme."base0D-rgb-r"; - g = config.lib.stylix.scheme."base0D-rgb-g"; - b = config.lib.stylix.scheme."base0D-rgb-b"; - in - "${r}, ${g}, ${b}"; - in - { - inherit AccentColor; - LastUsedCustomAccentColor = AccentColor; - TerminalApplication = "konsole"; - TerminalService = "org.kde.konsole.desktop"; - }; - WM = { - # TODO convert to base16 colours at some point - activeBackground = "227,229,231"; - activeBlend = "227,229,231"; - activeForeground = "35,38,41"; - inactiveBackground = "239,240,241"; - inactiveBlend = "239,240,241"; - inactiveForeground = "112,125,138"; - }; - }; - breezerc = { - Common = { - OutlineClassButton = true; - OutlineCloseButtone = true; - ShadowSize = "ShadowVeryLarge"; - ShadowStrength = "128"; - }; - Style = { - MenuOpacity = "100"; - }; - }; + # kdeglobals = { + # General = + # let + # AccentColor = + # let + # r = config.lib.stylix.scheme."base0D-rgb-r"; + # g = config.lib.stylix.scheme."base0D-rgb-g"; + # b = config.lib.stylix.scheme."base0D-rgb-b"; + # in + # "${r}, ${g}, ${b}"; + # in + # { + # inherit AccentColor; + # LastUsedCustomAccentColor = AccentColor; + # TerminalApplication = "konsole"; + # TerminalService = "org.kde.konsole.desktop"; + # }; + # WM = { + # # TODO convert to base16 colours at some point + # activeBackground = "227,229,231"; + # activeBlend = "227,229,231"; + # activeForeground = "35,38,41"; + # inactiveBackground = "239,240,241"; + # inactiveBlend = "239,240,241"; + # inactiveForeground = "112,125,138"; + # }; + # }; + # breezerc = { + # Common = { + # OutlineClassButton = true; + # OutlineCloseButtone = true; + # ShadowSize = "ShadowVeryLarge"; + # ShadowStrength = "128"; + # }; + # Style = { + # MenuOpacity = "100"; + # }; + # }; dolphinrc = { ContentDisplay = { UsePermissionsFormat = "CombinedFormat"; @@ -344,27 +355,27 @@ LatitudeFixed = "51.7"; LongitudeFixed = "-1.2"; }; - "Effect-translucency" = { - # Re-enable translucency when I can work out how to apply - # blur to all windows - Inactive = 100; - MoveResize = 100; - Dialogs = 100; - ComboboxPopups = 100; - Menus = 100; - }; - "org.kde.kdecoration2" = { - BorderSize = "None"; - BorderSizeAuto = "false"; - }; - "Script-krohnkite" = { - limitTileWidth = true; - screenGapBottom = 5; - screenGapLeft = 5; - screenGapRight = 5; - screenGapTop = 5; - tileLayoutGap = 5; - }; + # "Effect-translucency" = { + # # Re-enable translucency when I can work out how to apply + # # blur to all windows + # Inactive = 100; + # MoveResize = 100; + # Dialogs = 100; + # ComboboxPopups = 100; + # Menus = 100; + # }; + # "org.kde.kdecoration2" = { + # BorderSize = "None"; + # BorderSizeAuto = "false"; + # }; + # "Script-krohnkite" = { + # limitTileWidth = true; + # screenGapBottom = 5; + # screenGapLeft = 5; + # screenGapRight = 5; + # screenGapTop = 5; + # tileLayoutGap = 5; + # }; }; }; }; diff --git a/system/home/sway/default.nix b/system/home/sway/default.nix index fcf58fc6..a014aa49 100644 --- a/system/home/sway/default.nix +++ b/system/home/sway/default.nix @@ -8,6 +8,7 @@ imports = [ ./waybar/default.nix ]; stylix.targets.swaylock.useImage = false; # Using swaylock-effects instead home.packages = with pkgs; [ + libreoffice-fresh ffmpeg grim slurp diff --git a/system/plasma.nix b/system/plasma.nix new file mode 100644 index 00000000..df160f54 --- /dev/null +++ b/system/plasma.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + environment.plasma6.excludePackages = [ pkgs.kdePackages.plasma-browser-integration ]; + services = { + displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + desktopManager.plasma6 = { + enable = true; + enableQt5Integration = true; + }; + }; +} diff --git a/system/sway.nix b/system/sway.nix new file mode 100644 index 00000000..d2cf69d5 --- /dev/null +++ b/system/sway.nix @@ -0,0 +1,42 @@ +{ pkgs, username, ... }: +{ + environment.sessionVariables.GRIM_DEFAULT_DIR = "$HOME/Pictures/Screenshots"; + programs = { + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; + sway.enable = true; + }; + services = { + tumbler.enable = true; + udisks2.enable = true; + gvfs = { + enable = true; + package = pkgs.gnome3.gvfs; + }; + greetd = { + enable = true; + settings = + let + default_session.command = "sway"; + in + { + inherit default_session; + initial_session = { + inherit (default_session) command; + user = username; + }; + }; + }; + }; + qt = { + enable = true; + style = "adwaita"; + platformTheme = "gnome"; + }; + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; +}