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
This commit is contained in:
Evie Litherland-Smith 2024-09-27 11:41:52 +01:00
parent 73799275ba
commit 506163ff37
6 changed files with 172 additions and 138 deletions

View file

@ -1,5 +1,6 @@
{ pkgs, username, ... }: { pkgs, username, ... }:
{ {
imports = [ ./sway.nix ];
home-manager.users.${username}.imports = [ ./home/desktop.nix ]; home-manager.users.${username}.imports = [ ./home/desktop.nix ];
nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
@ -7,7 +8,6 @@
sessionVariables = { sessionVariables = {
NIXOS_OZONE_WL = "1"; NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORM = "wayland"; QT_QPA_PLATFORM = "wayland";
GRIM_DEFAULT_DIR = "$HOME/Pictures/Screenshots";
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [
libsecret libsecret
@ -33,14 +33,6 @@
dconf.enable = true; dconf.enable = true;
noisetorch.enable = true; noisetorch.enable = true;
kdeconnect.enable = true; kdeconnect.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [
thunar-archive-plugin
thunar-volman
];
};
sway.enable = true;
xwayland.enable = true; xwayland.enable = true;
}; };
gtk.iconCache.enable = true; gtk.iconCache.enable = true;
@ -48,12 +40,6 @@
dbus.packages = [ pkgs.gcr ]; dbus.packages = [ pkgs.gcr ];
flatpak.enable = true; flatpak.enable = true;
printing.enable = true; printing.enable = true;
tumbler.enable = true;
udisks2.enable = true;
gvfs = {
enable = true;
package = pkgs.gnome3.gvfs;
};
pipewire = { pipewire = {
enable = true; enable = true;
pulse.enable = true; pulse.enable = true;
@ -62,20 +48,6 @@
support32Bit = true; support32Bit = true;
}; };
}; };
greetd = {
enable = true;
settings =
let
default_session.command = "sway";
in
{
inherit default_session;
initial_session = {
inherit (default_session) command;
user = username;
};
};
};
xserver = { xserver = {
enable = true; enable = true;
xkb = { xkb = {
@ -85,14 +57,8 @@
}; };
}; };
}; };
qt = {
enable = true;
style = "adwaita";
platformTheme = "gnome";
};
xdg.portal = { xdg.portal = {
enable = true; enable = true;
config.common.default = "*"; # TODO change for xdg-desktop-portal > 1.17 changes config.common.default = "*"; # TODO change for xdg-desktop-portal > 1.17 changes
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
}; };
} }

View file

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./sway/default.nix ./sway/default.nix
./plasma/default.nix
./emacs/default.nix ./emacs/default.nix
./terminal/default.nix ./terminal/default.nix
./browser/default.nix ./browser/default.nix
@ -9,7 +10,6 @@
./services/email/default.nix ./services/email/default.nix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
libreoffice-fresh
webcord webcord
signal-desktop signal-desktop
whatsapp-for-linux whatsapp-for-linux

View file

@ -1,64 +1,74 @@
{ {
config, config,
lib, # lib,
pkgs, pkgs,
... ...
}: }:
{ {
imports = [ ./konsole.nix ]; # imports = [ ./konsole.nix ];
home.packages = with pkgs; [ home.packages = with pkgs; [
libreoffice-qt-fresh
rc2nix rc2nix
wl-clipboard wl-clipboard
(papirus-icon-theme.override { color = "violet"; }) (papirus-icon-theme.override { color = "breeze"; })
]; ];
services.gpg-agent.pinentryPackage = pkgs.pinentry-qt; services.gpg-agent.pinentryPackage = pkgs.pinentry-qt;
programs.plasma = { programs.plasma = {
enable = true; enable = true;
overrideConfig = true; overrideConfig = true;
workspace = # workspace =
let # let
toCapital = import ../lib/to_capital.nix lib; # toCapital = import ../lib/to_capital.nix lib;
in # in
{ # {
clickItemTo = "open"; # clickItemTo = "open";
theme = "default"; # theme = "default";
colorScheme = "Breeze${toCapital config.lib.stylix.scheme.variant}"; # colorScheme = "Breeze${toCapital config.lib.stylix.scheme.variant}";
iconTheme = "Papirus-${toCapital config.lib.stylix.scheme.variant}"; # iconTheme = "Papirus-${toCapital config.lib.stylix.scheme.variant}";
windowDecorations = { # windowDecorations = {
library = "org.kde.breeze"; # library = "org.kde.breeze";
theme = "Breeze"; # theme = "Breeze";
}; # };
cursor = { # cursor = {
inherit (config.home.pointerCursor) size; # inherit (config.home.pointerCursor) size;
theme = config.home.pointerCursor.name; # theme = config.home.pointerCursor.name;
}; # };
wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}"; # wallpaper = "${../wallpapers/landscapes/tropic_island_day.jpg}";
}; # };
fonts = # fonts =
let # let
general = { # general = {
family = config.stylix.fonts.sansSerif.name; # family = config.stylix.fonts.sansSerif.name;
pointSize = 12; # pointSize = 12;
}; # };
small = { # small = {
inherit (general) family; # inherit (general) family;
pointSize = general.pointSize - 2; # pointSize = general.pointSize - 2;
}; # };
fixedWidth = { # fixedWidth = {
family = config.stylix.fonts.monospace.name; # family = config.stylix.fonts.monospace.name;
pointSize = 12; # pointSize = 12;
}; # };
in # in
{ # {
inherit general small fixedWidth; # inherit general small fixedWidth;
menu = general; # menu = general;
toolbar = general; # toolbar = general;
windowTitle = small; # windowTitle = small;
}; # };
hotkeys.commands = { 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" = { "launch-emacs" = {
name = "Launch Emacs Client Window"; name = "Launch Emacs Client Window";
key = "Meta+Alt+X"; key = "Meta+Alt+X";
@ -168,6 +178,7 @@
"InvertWindow" = "Meta+Ctrl+U"; "InvertWindow" = "Meta+Ctrl+U";
"Invert Screen Colors" = [ ]; "Invert Screen Colors" = [ ];
}; };
"services/org.kde.konsole.desktop"."_launch" = [ ];
"services/org.kde.krunner.desktop"."_launch" = [ "services/org.kde.krunner.desktop"."_launch" = [
"Meta+Space" "Meta+Space"
"Search" "Search"
@ -279,44 +290,44 @@
KeepClipboardContents = false; KeepClipboardContents = false;
}; };
}; };
kdeglobals = { # kdeglobals = {
General = # General =
let # let
AccentColor = # AccentColor =
let # let
r = config.lib.stylix.scheme."base0D-rgb-r"; # r = config.lib.stylix.scheme."base0D-rgb-r";
g = config.lib.stylix.scheme."base0D-rgb-g"; # g = config.lib.stylix.scheme."base0D-rgb-g";
b = config.lib.stylix.scheme."base0D-rgb-b"; # b = config.lib.stylix.scheme."base0D-rgb-b";
in # in
"${r}, ${g}, ${b}"; # "${r}, ${g}, ${b}";
in # in
{ # {
inherit AccentColor; # inherit AccentColor;
LastUsedCustomAccentColor = AccentColor; # LastUsedCustomAccentColor = AccentColor;
TerminalApplication = "konsole"; # TerminalApplication = "konsole";
TerminalService = "org.kde.konsole.desktop"; # TerminalService = "org.kde.konsole.desktop";
}; # };
WM = { # WM = {
# TODO convert to base16 colours at some point # # TODO convert to base16 colours at some point
activeBackground = "227,229,231"; # activeBackground = "227,229,231";
activeBlend = "227,229,231"; # activeBlend = "227,229,231";
activeForeground = "35,38,41"; # activeForeground = "35,38,41";
inactiveBackground = "239,240,241"; # inactiveBackground = "239,240,241";
inactiveBlend = "239,240,241"; # inactiveBlend = "239,240,241";
inactiveForeground = "112,125,138"; # inactiveForeground = "112,125,138";
}; # };
}; # };
breezerc = { # breezerc = {
Common = { # Common = {
OutlineClassButton = true; # OutlineClassButton = true;
OutlineCloseButtone = true; # OutlineCloseButtone = true;
ShadowSize = "ShadowVeryLarge"; # ShadowSize = "ShadowVeryLarge";
ShadowStrength = "128"; # ShadowStrength = "128";
}; # };
Style = { # Style = {
MenuOpacity = "100"; # MenuOpacity = "100";
}; # };
}; # };
dolphinrc = { dolphinrc = {
ContentDisplay = { ContentDisplay = {
UsePermissionsFormat = "CombinedFormat"; UsePermissionsFormat = "CombinedFormat";
@ -344,27 +355,27 @@
LatitudeFixed = "51.7"; LatitudeFixed = "51.7";
LongitudeFixed = "-1.2"; LongitudeFixed = "-1.2";
}; };
"Effect-translucency" = { # "Effect-translucency" = {
# Re-enable translucency when I can work out how to apply # # Re-enable translucency when I can work out how to apply
# blur to all windows # # blur to all windows
Inactive = 100; # Inactive = 100;
MoveResize = 100; # MoveResize = 100;
Dialogs = 100; # Dialogs = 100;
ComboboxPopups = 100; # ComboboxPopups = 100;
Menus = 100; # Menus = 100;
}; # };
"org.kde.kdecoration2" = { # "org.kde.kdecoration2" = {
BorderSize = "None"; # BorderSize = "None";
BorderSizeAuto = "false"; # BorderSizeAuto = "false";
}; # };
"Script-krohnkite" = { # "Script-krohnkite" = {
limitTileWidth = true; # limitTileWidth = true;
screenGapBottom = 5; # screenGapBottom = 5;
screenGapLeft = 5; # screenGapLeft = 5;
screenGapRight = 5; # screenGapRight = 5;
screenGapTop = 5; # screenGapTop = 5;
tileLayoutGap = 5; # tileLayoutGap = 5;
}; # };
}; };
}; };
}; };

View file

@ -8,6 +8,7 @@
imports = [ ./waybar/default.nix ]; imports = [ ./waybar/default.nix ];
stylix.targets.swaylock.useImage = false; # Using swaylock-effects instead stylix.targets.swaylock.useImage = false; # Using swaylock-effects instead
home.packages = with pkgs; [ home.packages = with pkgs; [
libreoffice-fresh
ffmpeg ffmpeg
grim grim
slurp slurp

14
system/plasma.nix Normal file
View file

@ -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;
};
};
}

42
system/sway.nix Normal file
View file

@ -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 ];
}