From 31a51c89c36fe3d4cf8487a137c4c8d4780b5516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Sat, 3 May 2025 15:04:35 +0200 Subject: [PATCH] Home Gen509 @ 2025-05-03-15:04 by jonas@comfy-station --- home/jonas@comfy-station.nix | 10 +- home/jonas@monolith.nix | 2 - modules/default.nix | 4 + modules/home/firefox.nix | 92 ++++++----- modules/home/kdeconnect.nix | 17 ++- modules/home/plasma.nix | 288 +++++++++++++++++++---------------- modules/home/wallpaper.nix | 16 ++ 7 files changed, 248 insertions(+), 181 deletions(-) create mode 100644 modules/home/wallpaper.nix diff --git a/home/jonas@comfy-station.nix b/home/jonas@comfy-station.nix index e519063..40a3f62 100644 --- a/home/jonas@comfy-station.nix +++ b/home/jonas@comfy-station.nix @@ -1,11 +1,7 @@ {config, ...}: rec { imports = [ ../modules/home/borg.nix - ../modules/home/firefox.nix - ../modules/home/kdeconnect.nix ../modules/home/ssh.nix - ../modules/home/themes/gtk - ../modules/home/themes/qt ../modules/home/yubikey.nix ]; @@ -22,6 +18,12 @@ hive.hyprland.enable = true; hive.kitty.enable = true; hive.nextcloud.enable = true; + hive.firefox = { + enable = true; + plasmaIntegration = true; + passFF = true; + }; + hive.kdeconnect.enable = true; hive.ranger.enable = true; hive.swaync.enable = true; hive.waybar.enable = true; diff --git a/home/jonas@monolith.nix b/home/jonas@monolith.nix index 17f0fba..a8aa730 100644 --- a/home/jonas@monolith.nix +++ b/home/jonas@monolith.nix @@ -1,8 +1,6 @@ {config, ...}: rec { imports = [ ../modules/home/borg.nix - ../modules/home/firefox.nix - ../modules/home/kdeconnect.nix ../modules/home/ssh.nix ../modules/home/yubikey.nix ]; diff --git a/modules/default.nix b/modules/default.nix index 5b2a809..c0289cc 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -38,5 +38,9 @@ ./home/wlogout ./home/wofi ./home/zsh + ./home/firefox.nix + ./home/kdeconnect.nix + ./home/plasma.nix + ./home/wallpaper.nix ]; } diff --git a/modules/home/firefox.nix b/modules/home/firefox.nix index 546cbb9..3983a70 100644 --- a/modules/home/firefox.nix +++ b/modules/home/firefox.nix @@ -1,54 +1,64 @@ { config, + lib, inputs, pkgs, ... -}: { - programs.firefox = { - enable = true; +}: let + cfg = config.hive.firefox; +in { + options.hive.firefox = { + enable = lib.mkEnableOption "Enable Firefox"; + plasmaIntegration = lib.mkEnableOption "Enable Plasma Integration"; + passFF = lib.mkEnableOption "Enable PassFF"; + }; + config = lib.mkIf cfg.enable { + programs.firefox = { + enable = true; - # Default profile - profiles.jonas = { - name = "Jonas"; - id = 0; - isDefault = true; + # Default profile + profiles.jonas = { + name = "Jonas"; + id = 0; + isDefault = true; - # Search - search = { - default = "DuckDuckGo"; - order = ["DuckDuckGo" "Google"]; - force = true; - engines = { - "Nix Packages" = { - urls = [ - { - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - } - ]; + # Search + search = { + default = "DuckDuckGo"; + order = ["DuckDuckGo" "Google"]; + force = true; + engines = { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + }; }; }; - }; - # Extensions - extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ - ublock-origin - violentmonkey - plasma-integration - passff - ]; + # Extensions + extensions = with inputs.firefox-addons.packages."x86_64-linux"; ([ + ublock-origin + violentmonkey + ] + ++ lib.optional cfg.plasmaIntegration plasma-integration + ++ lib.optional cfg.passFF passff); + }; }; + home.packages = + lib.optional cfg.passFF + pkgs.passff-host; }; - home.packages = with pkgs; [ - passff-host - ]; } diff --git a/modules/home/kdeconnect.nix b/modules/home/kdeconnect.nix index 253f9c5..1d84abf 100644 --- a/modules/home/kdeconnect.nix +++ b/modules/home/kdeconnect.nix @@ -1,4 +1,15 @@ -{...}: { - services.kdeconnect.enable = true; - services.kdeconnect.indicator = false; +{ + config, + lib, + ... +}: let + cfg = config.hive.kdeconnect; +in { + options.hive.kdeconnect = { + enable = lib.mkEnableOption "Enable KDE Connect"; + }; + config = lib.mkIf cfg.enable { + services.kdeconnect.enable = true; + services.kdeconnect.indicator = false; + }; } diff --git a/modules/home/plasma.nix b/modules/home/plasma.nix index 9bc12a0..64e24d8 100644 --- a/modules/home/plasma.nix +++ b/modules/home/plasma.nix @@ -1,141 +1,167 @@ { - pkgs, + config, lib, + pkgs, ... -}: { - home.file.".local/share/wallpaper" = { - source = ./static/wallpaper; - recursive = true; - }; - # load hm-vars in x-session - xsession.enable = true; +}: let + cfg = config.hive.plasma; +in { + options.hive.plasma.enable = lib.mkEnableOption "Plasma configuration"; - # Use kvantum-theme - home.sessionVariables = { - QT_STYLE_OVERRIDE = "kvantum"; - }; + config = lib.mkIf cfg.enable { + # load hm-vars in x-session + xsession.enable = true; - programs.konsole = { - enable = true; - defaultProfile = "default"; - profiles = { - default = { - name = "default"; - colorScheme = "Utterly-Nord-Konsole"; - font = { - name = "Fira Code"; - size = 10; + # Use kvantum-theme + home.sessionVariables = { + QT_STYLE_OVERRIDE = "kvantum"; + }; + + # provide kvantum and nord theme + home.packages = [ + pkgs.utterly-nord-plasma + pkgs.libsForQt5.qtstyleplugin-kvantum + ]; + + programs.konsole = { + enable = true; + defaultProfile = "default"; + profiles = { + default = { + name = "default"; + colorScheme = "Utterly-Nord-Konsole"; + font = { + name = "Fira Code"; + size = 10; + }; + }; + }; + }; + + # use kvantum theme + qt.enable = true; + qt.style.name = "kvantum"; + + # add nord like gtk theme + gtk = { + enable = true; + cursorTheme = { + package = pkgs.nordzy-cursor-theme; + name = "Nordzy-cursors"; + }; + theme = { + package = pkgs.nordic; + name = "Nordic"; + }; + iconTheme = { + package = pkgs.tela-circle-icon-theme; + name = "Tela-circle-nord"; + }; + }; + + programs.plasma = { + enable = true; + overrideConfig = true; + + # + # Some high-level settings: + # + workspace = { + clickItemTo = "select"; + lookAndFeel = "Utterly-Nord"; + theme = "breeze"; + colorScheme = "UtterlyNord"; + cursorTheme = "Breeze"; + wallpaper = "/home/jonas/.local/share/wallpaper/nord.png"; + }; + + hotkeys.commands."launch-konsole" = { + name = "Launch Konsole"; + key = "Meta+Return"; + command = "konsole"; + }; + + panels = [ + # Windows-like panel at the bottom + { + location = "bottom"; + widgets = [ + "org.kde.plasma.kickoff" + "org.kde.plasma.pager" + # We can also configure the widgets. For example if you want to pin + # konsole and dolphin to the task-launcher the following widget will + # have that. + { + name = "org.kde.plasma.icontasks"; + config = { + General.launchers = [ + "applications:org.kde.dolphin.desktop" + "applications:org.kde.konsole.desktop" + ]; + }; + } + "org.kde.plasma.marginsseperator" + "org.kde.plasma.systemtray" + "org.kde.plasma.digitalclock" + ]; + hiding = null; + } + ]; + + # + # Some mid-level settings: + # + shortcuts = { + ksmserver = { + "Lock Session" = ["Screensaver" "Meta+Ctrl+Alt+L"]; + }; + + kwin = + { + "Expose" = "Meta+,"; + "Switch Window Down" = "Meta+J"; + "Switch Window Left" = "Meta+H"; + "Switch Window Right" = "Meta+L"; + "Switch Window Up" = "Meta+K"; + "Window Quick Tile Bottom" = "Meta+Shift+J"; + "Window Quick Tile Left" = "Meta+Shift+H"; + "Window Quick Tile Right" = "Meta+Shift+L"; + "Window Quick Tile Top" = "Meta+Shift+K"; + "Kill Window" = "Meta+Alt+Q"; + "Window Close" = "Meta+Shift+Q"; + } + // ( + with lib; let + desktops = map toString (lists.range 1 8); + in + listToAttrs + (map + (i: { + name = "Switch to Desktop ${i}"; + value = "Meta+${i}"; + }) + desktops) + // listToAttrs (map + (i: { + name = "Window to Desktop ${i}"; + value = "Meta+Shift+${i}"; + }) + desktops) + ); + }; + + # + # Some low-level settings: + # + configFile = { + "baloofilerc"."Basic Settings"."Indexing-Enabled".value = false; + "kwinrc"."org.kde.kdecoration2"."ButtonsOnLeft".value = "SF"; + "kwinrc"."Desktops"."Number" = { + value = 8; + # Forces kde to not change this value (even through the settings app). + immutable = true; }; }; }; }; - - # use kvantum theme - qt.enable = true; - qt.style.name = "kvantum"; - - programs.plasma = { - enable = true; - overrideConfig = true; - - # - # Some high-level settings: - # - workspace = { - clickItemTo = "select"; - lookAndFeel = "Utterly-Nord"; - theme = "breeze"; - colorScheme = "UtterlyNord"; - cursorTheme = "Breeze"; - wallpaper = "/home/jonas/.local/share/wallpaper/nord.png"; - }; - - hotkeys.commands."launch-konsole" = { - name = "Launch Konsole"; - key = "Meta+Return"; - command = "konsole"; - }; - - panels = [ - # Windows-like panel at the bottom - { - location = "bottom"; - widgets = [ - "org.kde.plasma.kickoff" - "org.kde.plasma.pager" - # We can also configure the widgets. For example if you want to pin - # konsole and dolphin to the task-launcher the following widget will - # have that. - { - name = "org.kde.plasma.icontasks"; - config = { - General.launchers = [ - "applications:org.kde.dolphin.desktop" - "applications:org.kde.konsole.desktop" - ]; - }; - } - "org.kde.plasma.marginsseperator" - "org.kde.plasma.systemtray" - "org.kde.plasma.digitalclock" - ]; - hiding = null; - } - ]; - - # - # Some mid-level settings: - # - shortcuts = { - ksmserver = { - "Lock Session" = ["Screensaver" "Meta+Ctrl+Alt+L"]; - }; - - kwin = - { - "Expose" = "Meta+,"; - "Switch Window Down" = "Meta+J"; - "Switch Window Left" = "Meta+H"; - "Switch Window Right" = "Meta+L"; - "Switch Window Up" = "Meta+K"; - "Window Quick Tile Bottom" = "Meta+Shift+J"; - "Window Quick Tile Left" = "Meta+Shift+H"; - "Window Quick Tile Right" = "Meta+Shift+L"; - "Window Quick Tile Top" = "Meta+Shift+K"; - "Kill Window" = "Meta+Alt+Q"; - "Window Close" = "Meta+Shift+Q"; - } - // ( - with lib; let - desktops = map toString (lists.range 1 8); - in - listToAttrs - (map - (i: { - name = "Switch to Desktop ${i}"; - value = "Meta+${i}"; - }) - desktops) - // listToAttrs (map - (i: { - name = "Window to Desktop ${i}"; - value = "Meta+Shift+${i}"; - }) - desktops) - ); - }; - - # - # Some low-level settings: - # - configFile = { - "baloofilerc"."Basic Settings"."Indexing-Enabled".value = false; - "kwinrc"."org.kde.kdecoration2"."ButtonsOnLeft".value = "SF"; - "kwinrc"."Desktops"."Number" = { - value = 8; - # Forces kde to not change this value (even through the settings app). - immutable = true; - }; - }; - }; } diff --git a/modules/home/wallpaper.nix b/modules/home/wallpaper.nix new file mode 100644 index 0000000..5f5d2c3 --- /dev/null +++ b/modules/home/wallpaper.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + ... +}: let + cfg = config.hive.wallpaper; +in { + options.hive.wallpaper.enable = lib.mkEnableOption "Wallpaper symlink"; + + config = lib.mkIf cfg.enable { + home.file.".local/share/wallpaper" = { + source = ./static/wallpaper; + recursive = true; + }; + }; +}