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, ... }:
{
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 ];
};
}

View file

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

View file

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

View file

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

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