diff --git a/modules/home/de/hyprland/classic.nix b/modules/home/de/hyprland/classic.nix new file mode 100644 index 0000000..43d1c62 --- /dev/null +++ b/modules/home/de/hyprland/classic.nix @@ -0,0 +1,51 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + options.custom.de.hyprland.classic.enable = lib.mkEnableOption ""; + + config = lib.mkIf config.custom.de.hyprland.classic.enable { + custom = { + programs = { + hyprland.enable = true; + rofi.enable = true; + hyprlock.enable = true; + }; + + services = { + wpaperd.enable = true; + hypridle.enable = true; + waybar.enable = true; + cliphist.enable = true; + }; + }; + + services.dunst.enable = true; + + home.packages = [ + pkgs.playerctl + pkgs.grimblast + ]; + + wayland.windowManager.hyprland.extraConfig = lib.mkBefore '' + # Variables + $play-pause = playerctl --ignore-player=firefox play-pause + $play-next = playerctl --ignore-player=firefox next + $play-previous = playerctl --ignore-player=firefox previous + $mute = wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + $volume-up = wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ + $volume-down = wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- + $mute-mic = wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle + + # Launch programs + bind = SUPER, R, exec, rofi -show drun + bind = SUPER, V, exec, rofi-clipboard + + # Manage session + bindrl = SUPER CONTROL, L, exec, loginctl lock-session + ''; + }; +} diff --git a/modules/home/de/hyprland/default.nix b/modules/home/de/hyprland/default.nix deleted file mode 100644 index 972ac3f..0000000 --- a/modules/home/de/hyprland/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - config, - osConfig, - pkgs, - lib, - ... -}: -{ - options.custom.de.hyprland.enable = lib.mkEnableOption "" // { - default = osConfig.custom.de.hyprland.enable; - }; - - config = lib.mkIf config.custom.de.hyprland.enable { - wayland.windowManager.hyprland = { - enable = true; - package = null; - portalPackage = null; - }; - - home.packages = [ - pkgs.playerctl - pkgs.grimblast - ]; - - custom = { - services = { - wpaperd.enable = true; - hypridle.enable = true; - waybar.enable = true; - cliphist.enable = true; - }; - - programs = { - rofi.enable = true; - hyprlock.enable = true; - btop.enable = true; - }; - }; - - services.dunst.enable = true; - }; -} diff --git a/modules/home/programs/hyprland/default.nix b/modules/home/programs/hyprland/default.nix new file mode 100644 index 0000000..f0ad28a --- /dev/null +++ b/modules/home/programs/hyprland/default.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: +{ + options.custom.programs.hyprland.enable = lib.mkEnableOption ""; + + config = lib.mkIf config.custom.programs.hyprland.enable { + wayland.windowManager.hyprland = { + enable = true; + package = null; + portalPackage = null; + }; + }; +} diff --git a/modules/home/de/hyprland/keybinds.nix b/modules/home/programs/hyprland/keybinds.nix similarity index 83% rename from modules/home/de/hyprland/keybinds.nix rename to modules/home/programs/hyprland/keybinds.nix index e6bf1eb..26c5ba8 100644 --- a/modules/home/de/hyprland/keybinds.nix +++ b/modules/home/programs/hyprland/keybinds.nix @@ -1,30 +1,19 @@ { config, lib, ... }: { - config = lib.mkIf config.custom.de.hyprland.enable { + config = lib.mkIf config.custom.programs.hyprland.enable { wayland.windowManager.hyprland.extraConfig = '' # Bindflags: # r = release # e = repeat # l = locked - # Variables - $play-pause = playerctl --ignore-player=firefox play-pause - $play-next = playerctl --ignore-player=firefox next - $play-previous = playerctl --ignore-player=firefox previous - $mute = wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle - $volume-up = wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ - $volume-down = wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- - $mute-mic = wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle - # Essentials bind = SUPER SHIFT, C, killactive, bind = SUPER SHIFT, V, togglefloating, bind = SUPER SHIFT, F, fullscreen, 0 # Launch programs - bind = SUPER, R, exec, rofi -show drun bind = SUPER, RETURN, exec, kitty - bind = SUPER, V, exec, rofi-clipboard bind = SUPER, B, exec, firefox bind = SUPER, C, exec, code @@ -61,7 +50,6 @@ bindrl = SUPER CONTROL, R, exec, reboot bindrl = SUPER CONTROL, H, exec, systemctl hibernate bindrl = SUPER CONTROL, S, exec, systemctl sleep - bindrl = SUPER CONTROL, L, exec, loginctl lock-session bindrl = SUPER CONTROL, B, exec, sleep 1 && hyprctl dispatch dpms off # Control media diff --git a/modules/home/de/hyprland/settings.nix b/modules/home/programs/hyprland/settings.nix similarity index 97% rename from modules/home/de/hyprland/settings.nix rename to modules/home/programs/hyprland/settings.nix index cd2aca7..04fe2a7 100644 --- a/modules/home/de/hyprland/settings.nix +++ b/modules/home/programs/hyprland/settings.nix @@ -1,6 +1,6 @@ { config, lib, ... }: { - config = lib.mkIf config.custom.de.hyprland.enable { + config = lib.mkIf config.custom.programs.hyprland.enable { wayland.windowManager.hyprland.settings = { input = { kb_layout = "de"; diff --git a/modules/home/services/cliphist.nix b/modules/home/services/cliphist.nix index f12b310..9fc643a 100644 --- a/modules/home/services/cliphist.nix +++ b/modules/home/services/cliphist.nix @@ -8,11 +8,6 @@ options.custom.services.cliphist.enable = lib.mkEnableOption ""; config = lib.mkIf config.custom.services.cliphist.enable { - assertions = lib.singleton { - assertion = config.custom.programs.rofi.enable; - message = "Cliphist requires Rofi"; - }; - services.cliphist = { enable = true; extraOptions = [ ]; @@ -23,7 +18,9 @@ home.packages = [ pkgs.wl-clipboard - (pkgs.writeScriptBin "rofi-clipboard" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy") - ]; + ] + ++ lib.optional config.custom.programs.rofi.enable ( + pkgs.writeScriptBin "rofi-clipboard" "cliphist list | rofi -dmenu -display-columns 2 | cliphist decode | wl-copy" + ); }; } diff --git a/users/seb/home.nix b/users/seb/home.nix index 92a3b33..fd7d1dd 100644 --- a/users/seb/home.nix +++ b/users/seb/home.nix @@ -19,6 +19,8 @@ custom = { sops.enable = true; + de.hyprland.classic.enable = true; + programs = { shell = { zsh.enable = true; @@ -32,6 +34,7 @@ vscode.enable = true; firefox.enable = true; libreoffice.enable = true; + btop.enable = true; }; };