mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 16:39:07 +01:00
hyprland: Refactor to accommodate more DEs
This commit is contained in:
parent
927f056987
commit
048c7fb888
7 changed files with 72 additions and 63 deletions
51
modules/home/de/hyprland/classic.nix
Normal file
51
modules/home/de/hyprland/classic.nix
Normal file
|
|
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
12
modules/home/programs/hyprland/default.nix
Normal file
12
modules/home/programs/hyprland/default.nix
Normal file
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -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";
|
||||
|
|
@ -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"
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue