diff --git a/modules/home/programs/hyprland/default.nix b/modules/home/programs/hyprland/default.nix index 0aacd6a3..91bbf756 100644 --- a/modules/home/programs/hyprland/default.nix +++ b/modules/home/programs/hyprland/default.nix @@ -19,7 +19,6 @@ in { options = { home.programs.hyprland = { enable = mkEnableOption "Enable Hyprland"; - user = mkOption {type = types.enum ["cnst" "toothpick"];}; }; }; diff --git a/modules/home/programs/hyprland/inputs.nix b/modules/home/programs/hyprland/inputs.nix index 91f0ef0e..e7aa3b51 100644 --- a/modules/home/programs/hyprland/inputs.nix +++ b/modules/home/programs/hyprland/inputs.nix @@ -5,13 +5,8 @@ ... }: let inherit (lib) mkIf mkEnableOption mkMerge; - - kbOption = - if osConfig.networking.hostName == "cnixpad" - then "ctrl:swapcaps" - else ""; - cfg = config.home.programs.hyprland; + host = osConfig.networking.hostName; in { options = { home.programs.hyprland.inputs.enable = mkEnableOption "Enables input settings in Hyprland"; @@ -44,7 +39,6 @@ in { input = { kb_layout = "se"; kb_variant = "nodeadkeys"; - kb_options = kbOption; follow_mouse = 1; accel_profile = "flat"; sensitivity = 0; # -1.0 - 1.0, 0 means no modification. @@ -84,31 +78,37 @@ in { }; } - (mkIf (cfg.user == "toothpick") { - wayland.windowManager.hyprland.settings.render = { - explicit_sync = 0; - explicit_sync_kms = 0; - direct_scanout = false; + (mkIf (host == "toothpc") { + wayland.windowManager.hyprland.settings = { + render = { + explicit_sync = 0; + explicit_sync_kms = 0; + direct_scanout = false; + }; + cursor = { + no_hardware_cursors = true; + }; }; }) - (mkIf (cfg.user != "toothpick") { - wayland.windowManager.hyprland.settings.render = { - explicit_sync = 2; - explicit_sync_kms = 2; - direct_scanout = false; + (mkIf (host != "toothpc") { + wayland.windowManager.hyprland.settings = { + render = { + explicit_sync = 2; + explicit_sync_kms = 2; + direct_scanout = false; + }; + cursor = { + no_hardware_cursors = 2; + }; }; }) - (mkIf (cfg.user == "toothpick") { - wayland.windowManager.hyprland.settings.cursor = { - no_hardware_cursors = true; - }; - }) - - (mkIf (cfg.user != "toothpick") { - wayland.windowManager.hyprland.settings.cursor = { - no_hardware_cursors = 2; + (mkIf (host == "cnixpad") { + wayland.windowManager.hyprland.settings = { + input = { + kb_options = "ctrl:swapcaps"; + }; }; }) ]); diff --git a/modules/home/programs/hyprland/keybinds.nix b/modules/home/programs/hyprland/keybinds.nix index cf1e004e..7789a05e 100644 --- a/modules/home/programs/hyprland/keybinds.nix +++ b/modules/home/programs/hyprland/keybinds.nix @@ -7,6 +7,7 @@ }: let inherit (lib) mkIf mkEnableOption mkMerge; cfg = config.home.programs.hyprland; + host = osConfig.networking.hostName; in { options = { home.programs.hyprland.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland"; @@ -86,32 +87,38 @@ in { }; } - (mkIf (cfg.user == "cnst") { - wayland.windowManager.hyprland.settings = let - cnixpad = osConfig.networking.hostName == "cnixpad"; - modKey = - if cnixpad - then "ALT_L" - else "SUPER"; - in { + (mkIf (host == "cnix") { + wayland.windowManager.hyprland.settings = { "$terminal" = "alacritty"; "$browser" = "zen"; "$browserinc" = "zen --private-window"; - "$mod" = modKey; + "$mod" = "SUPER"; bind = [ # Add more host-specific binds as needed ]; }; }) - (mkIf (cfg.user == "toothpick") { + (mkIf (host == "cnixpad") { + wayland.windowManager.hyprland.settings = { + "$terminal" = "foot"; + "$browser" = "zen"; + "$browserinc" = "zen --private-window"; + "$mod" = "ALT_L"; + bind = [ + # Add more host-specific binds as needed + ]; + }; + }) + + (mkIf (host == "toothpc") { wayland.windowManager.hyprland.settings = { "$terminal" = "foot"; "$browser" = "firefox"; "$browserinc" = "firefox --private-window"; "$mod" = "ALT_L"; bind = [ - # Add more toothpc-specific binds as needed + # Add more host-specific binds as needed ]; }; }) diff --git a/modules/home/programs/hyprland/startup.nix b/modules/home/programs/hyprland/startup.nix index 5b20b9c4..cc5bc40d 100644 --- a/modules/home/programs/hyprland/startup.nix +++ b/modules/home/programs/hyprland/startup.nix @@ -1,10 +1,12 @@ { lib, config, + osConfig, ... }: let inherit (lib) mkIf mkEnableOption mkMerge; cfg = config.home.programs.hyprland; + host = osConfig.networking.hostName; in { options = { home.programs.hyprland.startup.enable = mkEnableOption "Enables startup settings in Hyprland"; @@ -22,7 +24,7 @@ in { }; } - (mkIf (cfg.user == "cnix") { + (mkIf (host == "cnix") { wayland.windowManager.hyprland.settings.exec-once = [ "mullvad-vpn" "blueman-applet" @@ -31,7 +33,14 @@ in { ]; }) - (mkIf (cfg.user == "toothpc") { + (mkIf (host == "cnixpad") { + wayland.windowManager.hyprland.settings.exec-once = [ + "blueman-applet" + "pamixer --set-volume 50" + ]; + }) + + (mkIf (host == "toothpc") { wayland.windowManager.hyprland.settings.exec-once = [ "mullvad-vpn" "hyprctl dispatch exec 'sleep 3s && solaar -w hide'" diff --git a/users/cnst/modules.nix b/users/cnst/modules.nix index 47e1b5b5..0fc81f9c 100644 --- a/users/cnst/modules.nix +++ b/users/cnst/modules.nix @@ -49,7 +49,6 @@ }; hyprland = { enable = true; - user = "cnst"; }; hyprlock = { enable = true; diff --git a/users/toothpick/modules.nix b/users/toothpick/modules.nix index f726de7b..cfe80f51 100644 --- a/users/toothpick/modules.nix +++ b/users/toothpick/modules.nix @@ -40,7 +40,6 @@ }; hyprland = { enable = true; - user = "toothpick"; }; hyprlock = { enable = true;