From d9d58bbca984e28a38bf1f7f4d0d5ce707ab9086 Mon Sep 17 00:00:00 2001 From: cswimr Date: Mon, 2 Dec 2024 15:56:32 -0500 Subject: [PATCH] setting up plasma-manager --- flake.nix | 28 ++++++--- home-manager/plasma.nix | 86 ++++++++++++++++----------- home-manager/{cswimr.nix => user.nix} | 10 ++-- 3 files changed, 75 insertions(+), 49 deletions(-) rename home-manager/{cswimr.nix => user.nix} (94%) diff --git a/flake.nix b/flake.nix index 1bb4147..413246e 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,11 @@ url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; }; + plasma-manager = { + url = "github:nix-community/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; nix-flatpak.url = "github:gmodena/nix-flatpak"; nixvim = { url = "github:nix-community/nixvim"; @@ -21,6 +26,7 @@ }; outputs = { nixpkgs, home-manager, ... }@inputs: let + user = "cswimr"; system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; @@ -70,19 +76,23 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; + sharedModules = + [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; backupFileExtension = "bak"; extraSpecialArgs = { inherit inputs; inherit pkgs; system = system; hostname = "eclipse"; + user = user; }; - users.cswimr = { + users.${user} = { imports = [ - ./home-manager/cswimr.nix + ./home-manager/user.nix ./home-manager/vscode.nix { - programs.git.extraConfig.user.signingkey = "0EC431A8DA8F8087"; + programs.git.extraConfig.user.signingkey = + "0EC431A8DA8F8087"; } ]; }; @@ -130,19 +140,23 @@ home-manager = { useGlobalPkgs = true; useUserPackages = true; + sharedModules = + [ inputs.plasma-manager.homeManagerModules.plasma-manager ]; backupFileExtension = "bak"; extraSpecialArgs = { inherit inputs; inherit pkgs; system = system; hostname = "nebula"; + user = user; }; - users.cswimr = { + users.${user} = { imports = [ - ./home-manager/cswimr.nix + ./home-manager/user.nix ./home-manager/vscode.nix { - programs.git.extraConfig.user.signingkey = "082F226A1D8C0860"; + programs.git.extraConfig.user.signingkey = + "082F226A1D8C0860"; } ]; }; @@ -151,6 +165,6 @@ ]; }; }; -}; + }; } diff --git a/home-manager/plasma.nix b/home-manager/plasma.nix index d2b65e7..ee2915a 100644 --- a/home-manager/plasma.nix +++ b/home-manager/plasma.nix @@ -2,6 +2,35 @@ imports = [ ]; programs.plasma = { enable = true; + workspace = { + theme = "Breeze"; + iconTheme = "Breeze Dark"; + colorScheme = "CatppuccinMochaBlue"; + cursor = { + size = 24; + theme = "Breeze"; + }; + windowDecorations = { + library = "org.kde.breeze"; + theme = "Breeze"; + }; + }; + hotkeys.commands = { + "spectacle-screenshot" = { + name = "Spectacle Screenshot"; + command = "/etc/nixos/scripts/py/spectacle-screenshot.py"; + comment = + "Take a screenshot of a region on the screen and automatically upload it to Zipline"; + keys = [ "Print" "Meta+S" ]; + }; + "spectacle-recording" = { + name = "Spectacle Recording"; + command = "/etc/nixos/scripts/py/spectacle-screenshot.py --record"; + comment = + "Record a region on the screen and automatically upload it to Zipline"; + keys = [ "Shift+Print" "Meta+Shift+S" ]; + }; + }; panels = [{ location = "bottom"; screen = "all"; @@ -33,47 +62,32 @@ } ]; }]; - #TODO: Convert everything below this to use higher level modules - shortcuts = { - "services/net.local.spectacle-screenshot.py-2.desktop"."_launch" = - "Shift+Print"; - "services/net.local.spectacle-screenshot.py.desktop"."_launch" = "Print"; - "services/org.kde.spectacle.desktop"."ActiveWindowScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."FullScreenScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."RecordRegion" = [ ]; - "services/org.kde.spectacle.desktop"."RecordScreen" = [ ]; - "services/org.kde.spectacle.desktop"."RecordWindow" = [ ]; - "services/org.kde.spectacle.desktop"."RectangularRegionScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."WindowUnderCursorScreenShot" = [ ]; - "services/org.kde.spectacle.desktop"."_launch" = [ ]; + window-rules = [{ + description = "Application settings for Code"; + match = { + window-class = { + value = "code code-url-handler"; + type = "exact"; + }; + }; + apply = { + desktopfile = + "/etc/profiles/per-user/cswimr/share/applications/code.desktop"; + }; + }]; + spectacle.shortcuts = { + captureActiveWindow = [ ]; + captureCurrentMonitor = [ ]; + captureEntireDesktop = [ ]; + captureRetangularRegion = [ ]; + captureWindowUnderCursor = [ ]; + launch = [ ]; }; configFile = { - "katerc"."KTextEditor Renderer"."Color Theme" = "Catppuccin Mocha"; - "kded5rc"."Module-browserintegrationreminder"."autoload" = false; - "kded5rc"."Module-device_automounter"."autoload" = false; - "kwalletrc"."Wallet"."First Use" = false; - "kwinrc"."Desktops"."Id_1" = "f523b65c-46b8-4c91-94f4-9e247db75777"; - "kwinrc"."Desktops"."Number" = 1; - "kwinrc"."Desktops"."Rows" = 1; + # These three plugins have no higher level modules "kwinrc"."Plugins"."sheetEnabled" = true; "kwinrc"."Plugins"."wobblywindowsEnabled" = true; "kwinrc"."Plugins"."zoomEnabled" = false; - "kwinrc"."org.kde.kdecoration2"."theme" = "Breeze"; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."Description" = - "Application settings for Code"; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."clientmachine" = - "localhost"; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."desktopfile" = - "/etc/profiles/per-user/cswimr/share/applications/code.desktop"; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."desktopfilerule" = - 3; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."wmclass" = - "code code-url-handler"; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."wmclasscomplete" = - true; - "kwinrulesrc"."700b0164-f5bb-47c9-93fc-2a4587821757"."wmclassmatch" = 1; - "kwinrulesrc"."General"."count" = 1; - "kwinrulesrc"."General"."rules" = "700b0164-f5bb-47c9-93fc-2a4587821757"; }; }; } diff --git a/home-manager/cswimr.nix b/home-manager/user.nix similarity index 94% rename from home-manager/cswimr.nix rename to home-manager/user.nix index d337b5c..2be1ee1 100755 --- a/home-manager/cswimr.nix +++ b/home-manager/user.nix @@ -1,6 +1,6 @@ -{ pkgs, config, ... }: { - home.username = "cswimr"; - home.homeDirectory = "/home/cswimr"; +{ pkgs, config, user, ... }: { + home.username = user; + home.homeDirectory = "/home/${user}"; home.file = { ".face.icon".source = @@ -19,8 +19,6 @@ config.lib.file.mkOutOfStoreSymlink "/etc/nixos/config/themes/glow.json"; }; - home.sessionPath = [ "/etc/nixos/scripts" ]; - # link the configuration file in current directory to the specified location in home directory # home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg; @@ -48,7 +46,7 @@ # basic configuration of git, please change to your own programs.git = { enable = true; - userName = "cswimr"; + userName = user; userEmail = "seaswimmerthefsh@gmail.com"; extraConfig = { commit = { gpgsign = true; };