From d9dafd4dc0dce42bdfb99383addb4535060d3d2f Mon Sep 17 00:00:00 2001 From: Yuri Tatishchev Date: Sun, 1 Jun 2025 18:56:01 -0700 Subject: [PATCH] home: refactor to support slightly different pc/laptop configs --- flake.nix | 8 ++++---- home/cazzzer-laptop.nix | 21 +++++++++++++++++++++ home/cazzzer-pc.nix | 9 +++++++++ home/{ => modules}/default.nix | 0 home/{ => modules}/fish.nix | 0 home/{ => modules}/plasma.nix | 5 ++++- home/{ => modules}/starship.nix | 0 users/cazzzer/default.nix | 24 ------------------------ 8 files changed, 38 insertions(+), 29 deletions(-) create mode 100644 home/cazzzer-laptop.nix create mode 100644 home/cazzzer-pc.nix rename home/{ => modules}/default.nix (100%) rename home/{ => modules}/fish.nix (100%) rename home/{ => modules}/plasma.nix (93%) rename home/{ => modules}/starship.nix (100%) diff --git a/flake.nix b/flake.nix index f9badf4..bf65494 100644 --- a/flake.nix +++ b/flake.nix @@ -26,12 +26,12 @@ outputs = { self, nixpkgs, home-manager, plasma-manager, nixos-generators, secrix }: let - hmModule = { + hmModule = file: { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ]; - home-manager.users.cazzzer = import ./home; + home-manager.users.cazzzer = import file; # Optionally, use home-manager.extraSpecialArgs to pass # arguments to home.nix }; @@ -50,7 +50,7 @@ ./users/cazzzer # https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module home-manager.nixosModules.home-manager - hmModule + (hmModule ./home/cazzzer-pc.nix) ]; }; Yura-TPX13 = nixpkgs.lib.nixosSystem { @@ -63,7 +63,7 @@ ./users/cazzzer # https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module home-manager.nixosModules.home-manager - hmModule + (hmModule ./home/cazzzer-laptop.nix) ]; }; VM = nixpkgs.lib.nixosSystem { diff --git a/home/cazzzer-laptop.nix b/home/cazzzer-laptop.nix new file mode 100644 index 0000000..6142795 --- /dev/null +++ b/home/cazzzer-laptop.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./modules + ]; + + programs.plasma = { + kwin.virtualDesktops.number = 6; + kwin.virtualDesktops.rows = 2; + + shortcuts.kwin = { + "Switch to Desktop 1" = "Meta+F1"; + "Switch to Desktop 2" = "Meta+F2"; + "Switch to Desktop 3" = "Meta+F3"; + "Switch to Desktop 4" = "Meta+Z"; + "Switch to Desktop 5" = "Meta+X"; + "Switch to Desktop 6" = "Meta+C"; + }; + }; +} diff --git a/home/cazzzer-pc.nix b/home/cazzzer-pc.nix new file mode 100644 index 0000000..b692730 --- /dev/null +++ b/home/cazzzer-pc.nix @@ -0,0 +1,9 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./modules + ]; + + programs.plasma.kwin.virtualDesktops.number = 2; +} diff --git a/home/default.nix b/home/modules/default.nix similarity index 100% rename from home/default.nix rename to home/modules/default.nix diff --git a/home/fish.nix b/home/modules/fish.nix similarity index 100% rename from home/fish.nix rename to home/modules/fish.nix diff --git a/home/plasma.nix b/home/modules/plasma.nix similarity index 93% rename from home/plasma.nix rename to home/modules/plasma.nix index 6276f89..b92da67 100644 --- a/home/plasma.nix +++ b/home/modules/plasma.nix @@ -4,6 +4,10 @@ programs.plasma = { enable = true; overrideConfig = true; + resetFilesExclude = [ + "plasma-org.kde.plasma.desktop-appletsrc" + ]; + # Use tela circle icon theme if installed in system packages workspace.iconTheme = if builtins.elem pkgs.tela-circle-icon-theme osConfig.environment.systemPackages then "Tela-circle" else null; fonts = let defaultFont = { @@ -23,7 +27,6 @@ { layout = "minimak-4"; displayName = "us4"; } { layout = "ru"; displayName = "ru"; } ]; - kwin.virtualDesktops.number = 2; session.sessionRestore.restoreOpenApplicationsOnLogin = "startWithEmptySession"; shortcuts = { # kmix.mic_mute = "ScrollLock"; diff --git a/home/starship.nix b/home/modules/starship.nix similarity index 100% rename from home/starship.nix rename to home/modules/starship.nix diff --git a/users/cazzzer/default.nix b/users/cazzzer/default.nix index 5daf2de..b36343b 100644 --- a/users/cazzzer/default.nix +++ b/users/cazzzer/default.nix @@ -14,29 +14,5 @@ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE02AhJIZtrtZ+5sZhna39LUUCEojQzmz2BDWguT9ZHG yuri@tati.sh" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHczlipzGWv8c6oYwt2/9ykes5ElfneywDXBTOYbfSfn Pixel7Pro" ]; - # TODO: think of a better way to do this - packages = with pkgs; lib.optionals (config.networking.hostName == "Yura-PC") [ - # Python - python3 - poetry - - # Haskell - haskellPackages.ghc - haskellPackages.stack - - # Node - nodejs_22 - pnpm - bun - - # Nix - nil - nixd - nixfmt-rfc-style - - # Gleam - gleam - beamMinimal26Packages.erlang - ]; }; }