refactor(hm/gui): reorganize modules
All checks were successful
/ check (push) Successful in 9s
/ check-renovaterc (push) Successful in 3s
/ build-packages (push) Successful in 13s
/ build-vm (push) Successful in 2s
/ report-size (push) Successful in 5s

This way we are not `import`ing stuff which is slow.

It also makes it easier to turn off the sway module.
This commit is contained in:
Jalil David Salamé Messina 2025-04-21 14:01:24 +02:00
parent 816cfdd2af
commit 5358188ad1
Signed by: jalil
GPG key ID: F016B9E770737A0B
7 changed files with 392 additions and 383 deletions

View file

@ -21,6 +21,11 @@ let
};
in
{
imports = [
./sway.nix
./waybar.nix
];
config = lib.mkIf (jhome.enable && cfg.enable) {
home.packages =
(with pkgs; [
@ -73,30 +78,6 @@ in
};
# Text editor
nixvim.clipboard.providers.wl-copy.enable = lib.mkDefault true;
# Status bar
waybar = {
enable = true;
systemd.enable = true;
settings = lib.mkIf config.jhome.styling.enable (
import ./waybar-settings.nix { inherit config lib; }
);
# Style overrides to highlight workspaces with windows
style =
lib.pipe
# css
''
.modules-left #workspaces button {
border-bottom: 3px solid @base01;
}
.modules-left #workspaces button.persistent {
border-bottom: 3px solid transparent;
}
''
[
(lib.optionalString config.jhome.styling.enable)
lib.mkAfter
];
};
# Terminal
wezterm = {
enable = cfg.terminal == "wezterm";
@ -173,17 +154,6 @@ in
};
};
# Window Manager
wayland.windowManager.sway = {
inherit (cfg.sway) enable;
package = swayPkg; # no sway package if it comes from the OS
config = import ./sway-config.nix { inherit config pkgs; };
systemd = {
enable = true;
xdgAutostart = true;
};
};
# Set cursor style
stylix = lib.mkIf config.jhome.styling.enable { inherit cursor; };
home.pointerCursor = lib.mkIf config.jhome.styling.enable (