From 81e06a0513922790f1c6e36405f7c3981e5f79e3 Mon Sep 17 00:00:00 2001 From: cy Date: Sat, 1 Feb 2025 22:36:56 -0500 Subject: [PATCH 1/5] install plasma and use plasma-manager to configure --- flake.lock | 24 ++++++++++++++++++++++++ flake.nix | 6 ++++++ home/plasma.nix | 25 +++++++++++++++++++++++++ home/yt/ytnix.nix | 2 ++ hosts/ytnix/default.nix | 15 +++++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 home/plasma.nix diff --git a/flake.lock b/flake.lock index 6b42d56..55872fd 100644 --- a/flake.lock +++ b/flake.lock @@ -1154,6 +1154,29 @@ "type": "github" } }, + "plasma-manager": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1736549395, + "narHash": "sha256-XzwkB62Tt5UYoL1jXiHzgk/qz2fUpGHExcSIbyGTtI0=", + "owner": "nix-community", + "repo": "plasma-manager", + "rev": "a53af7f1514ef4cce8620a9d6a50f238cdedec8b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "plasma-manager", + "type": "github" + } + }, "pre-commit-hooks": { "flake": false, "locked": { @@ -1232,6 +1255,7 @@ "nixpkgs-garage": "nixpkgs-garage", "nixvim": "nixvim", "nvim-github-theme": "nvim-github-theme", + "plasma-manager": "plasma-manager", "rust-overlay": "rust-overlay", "sops-nix": "sops-nix", "treefmt": "treefmt" diff --git a/flake.nix b/flake.nix index 66dad85..cb60dbb 100644 --- a/flake.nix +++ b/flake.nix @@ -72,6 +72,11 @@ url = "github:nix-community/nix-ld"; inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR @@ -218,6 +223,7 @@ ./home/yt/ytnix.nix inputs.nixvim.homeManagerModules.nixvim inputs.niri.homeModules.config + inputs.plasma-manager.homeManagerModules.plasma-manager ]; }; diff --git a/home/plasma.nix b/home/plasma.nix new file mode 100644 index 0000000..077b530 --- /dev/null +++ b/home/plasma.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + programs.plasma = { + enable = true; + workspace = { + lookAndFeel = "org.ide.breezedark.desktop"; + cursor = { + theme = "Bibata-Modern-Classic"; + size = 32; + }; + }; + + fonts = { + general = { + family = "IBM Plex Mono"; + pointSize = 12; + }; + }; + + input.keyboard = { + numlockOnStartup = "on"; + options = [ "ctrl:nocaps" ]; + }; + }; +} diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 0e43354..4a8b31e 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -11,6 +11,7 @@ ../irssi.nix ../kitty.nix ../vscode.nix + ../plasma.nix ]; home = { username = "yt"; @@ -114,6 +115,7 @@ lldb (cutter.withPlugins (plugins: with plugins; [ rz-ghidra jsdec sigdb ])) ida-free + patchelf ]; programs.waybar.enable = true; diff --git a/hosts/ytnix/default.nix b/hosts/ytnix/default.nix index b748be0..e0d7c1d 100644 --- a/hosts/ytnix/default.nix +++ b/hosts/ytnix/default.nix @@ -174,6 +174,8 @@ haskell-language-server ghc sbctl # secure boot + wine-wayland + wine64 ]; environment.sessionVariables = { @@ -187,6 +189,12 @@ services.displayManager = { enable = true; autoLogin.user = "yt"; + defaultSession = "plasma"; + sddm = { + enable = true; + wayland.enable = true; + autoNumlock = true; + }; }; fonts.packages = with pkgs; [ @@ -294,6 +302,8 @@ waylandpp cairo xcb-util-cursor + libplist + p11-kit xorg.libX11 xorg.libxcb xorg.xcbutilwm @@ -377,4 +387,9 @@ startAgent = true; enableAskPassword = true; }; + + services.desktopManager.plasma6 = { + enable = true; + enableQt5Integration = true; + }; } From b131f134bc9f35d2bc3286704176331bf2fb6372 Mon Sep 17 00:00:00 2001 From: cy Date: Sat, 1 Feb 2025 23:40:16 -0500 Subject: [PATCH 2/5] add kwin bindings and fix stuff --- home/plasma.nix | 44 +++++++++++++++++++++++++++++++++++++++++++- home/yt/ytnix.nix | 14 ++++++++------ 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/home/plasma.nix b/home/plasma.nix index 077b530..3d919d3 100644 --- a/home/plasma.nix +++ b/home/plasma.nix @@ -2,11 +2,13 @@ { programs.plasma = { enable = true; + overrideConfig = true; + immutableByDefault = true; workspace = { lookAndFeel = "org.ide.breezedark.desktop"; cursor = { theme = "Bibata-Modern-Classic"; - size = 32; + size = 23; }; }; @@ -21,5 +23,45 @@ numlockOnStartup = "on"; options = [ "ctrl:nocaps" ]; }; + + # Meta key is actually the Super key in KDE + + hotkeys.commands = { + "launch-terminal" = { + name = "launch terminal"; + key = "Meta+Return"; + command = "kitty"; + }; + }; + + shortcuts = { + kwin = { + "Switch Window Down" = "Meta+J"; + "Switch Window Left" = "Meta+H"; + "Switch Window Right" = "Meta+L"; + "Switch Window Up" = "Meta+K"; + "Window Quick Tile Down" = "Meta+Shift+J"; + "Window Quick Tile Left" = "Meta+Shift+H"; + "Window Quick Tile Right" = "Meta+Shift+L"; + "Window Quick Tile Up" = "Meta+Shift+K"; + "Window Close" = "Meta+Ctrl+Q"; + "Window Maximize" = "Meta+W"; + "Window Minimize" = "Meta+Shift+-"; + "Window Fullscreen" = "Meta+F"; + "Window Shrink Horizontal" = "Meta+-"; + }; + + ksmserver = { + "Lock Session" = [ + "Screensaver" + "Meta+Ctrl+L" + ]; + }; + }; + + configFile = { + # save RAM + baloofilerc."Basic Settings"."Indexing-Enabled" = false; + }; }; } diff --git a/home/yt/ytnix.nix b/home/yt/ytnix.nix index 4a8b31e..f409021 100644 --- a/home/yt/ytnix.nix +++ b/home/yt/ytnix.nix @@ -22,12 +22,14 @@ systemd.user.startServices = "sd-switch"; - qt = { - enable = true; - platformTheme.name = "kde"; - style.name = "breeze-dark"; - style.package = pkgs.kdePackages.breeze; - }; + # keep this commented when using plasma + # otherwise "system settings" in KDE will not function + # qt = { + # enable = true; + # platformTheme.name = "kde"; + # style.name = "breeze-dark"; + # style.package = pkgs.kdePackages.breeze; + # }; gtk = { enable = true; From c9d700390cf37a9f2acfd8ef1d2b298ee9ec3eda Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 2 Feb 2025 10:52:53 -0500 Subject: [PATCH 3/5] manually redirect renamed repo --- hosts/chunk/forgejo.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hosts/chunk/forgejo.nix b/hosts/chunk/forgejo.nix index 26fb541..0abc681 100644 --- a/hosts/chunk/forgejo.nix +++ b/hosts/chunk/forgejo.nix @@ -33,6 +33,10 @@ services.caddy.virtualHosts."git.cy7.sh".extraConfig = '' import common + + # renamed repo + uri replace /cy/infra /cy/nixos-config + reverse_proxy localhost:3000 ''; services.caddy.virtualHosts."git.cything.io".extraConfig = '' From 11fb3de60c14f06d0834c535a38b1cd16a50779e Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 2 Feb 2025 15:25:04 -0500 Subject: [PATCH 4/5] some more plasma config --- home/plasma.nix | 13 +++++++++++++ hosts/ytnix/default.nix | 3 +++ 2 files changed, 16 insertions(+) diff --git a/home/plasma.nix b/home/plasma.nix index 3d919d3..facdad1 100644 --- a/home/plasma.nix +++ b/home/plasma.nix @@ -32,6 +32,11 @@ key = "Meta+Return"; command = "kitty"; }; + "launch-browser" = { + name = "launch browser"; + key = "Meta+B"; + command = "librewolf"; + }; }; shortcuts = { @@ -63,5 +68,13 @@ # save RAM baloofilerc."Basic Settings"."Indexing-Enabled" = false; }; + + # looks like KDE overrides services.logind settings + powerdevil.AC = { + whenLaptopLidClosed = "hibernate"; + }; + powerdevil.battery = { + whenLaptopLidClosed = "hibernate"; + }; }; } diff --git a/hosts/ytnix/default.nix b/hosts/ytnix/default.nix index e0d7c1d..bd175eb 100644 --- a/hosts/ytnix/default.nix +++ b/hosts/ytnix/default.nix @@ -304,6 +304,9 @@ xcb-util-cursor libplist p11-kit + kdePackages.qtwayland + qt6.qtwayland + libsForQt5.qt5.qtwayland xorg.libX11 xorg.libxcb xorg.xcbutilwm From 78f94a64297c35a92d71fb7161713789d16d9baa Mon Sep 17 00:00:00 2001 From: cy Date: Sun, 2 Feb 2025 15:26:01 -0500 Subject: [PATCH 5/5] flake update Signed-off-by: cy --- flake.lock | 56 +++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/flake.lock b/flake.lock index 55872fd..df9e697 100644 --- a/flake.lock +++ b/flake.lock @@ -369,11 +369,11 @@ ] }, "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "lastModified": 1738453229, + "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", "type": "github" }, "original": { @@ -562,11 +562,11 @@ ] }, "locked": { - "lastModified": 1738428726, - "narHash": "sha256-OUoEgorFHBVnqQ2lITqs6MGN7MH4t/8hLEO29OKu6CM=", + "lastModified": 1738448366, + "narHash": "sha256-4ATtQqBlgsGqkHTemta0ydY6f7JBRXz4Hf574NHQpkg=", "owner": "nix-community", "repo": "home-manager", - "rev": "dae6d3460c8bab3ac9f38a86affe45b32818e764", + "rev": "18fa9f323d8adbb0b7b8b98a8488db308210ed93", "type": "github" }, "original": { @@ -683,11 +683,11 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1738341980, - "narHash": "sha256-xOpkKwNkpbK6lL/V48xIsONnk8PBzbf7D98EqqGpGGs=", + "lastModified": 1738446528, + "narHash": "sha256-NYL/r7EXSyYP7nXuYGvGYMI9QtztGjVaKKofBt/pCv8=", "ref": "refs/heads/main", - "rev": "083c6de22cb306b0f1f7bd8e062ecdd72133e4e2", - "revCount": 17337, + "rev": "a51380645f61b33d37a536b596d16c481f7b84a6", + "revCount": 17342, "type": "git", "url": "https://git.lix.systems/lix-project/lix" }, @@ -737,11 +737,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1738410471, - "narHash": "sha256-j0XZIViI4ZEFwhrEzVKz696/4DZ9pRiWtGfxJogA+MM=", + "lastModified": 1738502867, + "narHash": "sha256-92cVHcxV7j00BquLo5I4G8EwKzrq2AlHuD3AQV9r+T8=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "16f8e14385163479aca7231d8fab0091adac2e56", + "rev": "cf0be7affb15e21727d137c029146fe7df2bc6d0", "type": "github" }, "original": { @@ -770,11 +770,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1738404307, - "narHash": "sha256-BFtfL5kZbIsDAMgbVP5E0HbqDapYWw4NBw1xS0AOCCc=", + "lastModified": 1738479340, + "narHash": "sha256-sutel7RKfu9eIJsjswSzptCIvKELbXQCSldt0PtwSd0=", "owner": "YaLTeR", "repo": "niri", - "rev": "32ad545f842f4c176548e30d183d10e0a2bab752", + "rev": "d5592743cb04cef3fe50c987b7ba9349c5090dbd", "type": "github" }, "original": { @@ -1065,11 +1065,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1738396600, - "narHash": "sha256-fWpw3MUUidq+GzuQdgpZwk4Vh4MF6MN2HEyyT2PguGI=", + "lastModified": 1738487426, + "narHash": "sha256-hnB0V0R/aKASnTBeTthFvW60uydv1xswWD4weqSuSfg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "6eec6bbb933a6dad6cf6afe3d51329f31d22e974", + "rev": "8ed1fafea6a613d962f6a84c1153d34dc8b06d83", "type": "github" }, "original": { @@ -1102,11 +1102,11 @@ ] }, "locked": { - "lastModified": 1738428106, - "narHash": "sha256-HpuE7jQnyOXJStEoP2AAsOTTqsdudn6xV1o+EbV8ssc=", + "lastModified": 1738517265, + "narHash": "sha256-ZzulGUIHZhvcSHx+1ucCJkIcn27r9H+cSzCCpKxJcls=", "owner": "nix-community", "repo": "nixvim", - "rev": "8f8f50243ea803304b1bd04aa56bd736fe2c28eb", + "rev": "56d0c4579e022b44a3e324f722fa23a6f4295798", "type": "github" }, "original": { @@ -1125,11 +1125,11 @@ ] }, "locked": { - "lastModified": 1737924095, - "narHash": "sha256-9RO/IlxiE7bpY7GYsdDMNB533PnDOBo9UvYyXXqlN4c=", + "lastModified": 1738445998, + "narHash": "sha256-wF2ZcRKF37re161jrXtNyjGMBDsIFtPeDvmIVfp8f7w=", "owner": "NuschtOS", "repo": "search", - "rev": "5efc9c966bb9bdad07a3c28667eac38b758c6f18", + "rev": "381d84a7422a4dbfef6a9c7703dbaf42036ae1c3", "type": "github" }, "original": { @@ -1285,11 +1285,11 @@ ] }, "locked": { - "lastModified": 1738376888, - "narHash": "sha256-S6ErHxkSm0iA7ZMsjjDaASWxbELYcdfv8BhOkkj1rHw=", + "lastModified": 1738463259, + "narHash": "sha256-+5QJpiRpkh1ALvKcMEpPyGwkPZfaynsYF4SFdNW5UfQ=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "83284068670d5ae4a43641c4afb150f3446be70d", + "rev": "e2bb8c205a069514535f083742c7da8dfb6e02b9", "type": "github" }, "original": {