refactor(hyprland): move nvidia option > wayland.nvidia/add hyprlands.extras
hyprland extras to serve as place to add hyprecosystem projects
This commit is contained in:
parent
ba410aa838
commit
82f539c989
9 changed files with 61 additions and 54 deletions
|
|
@ -8,11 +8,6 @@
|
||||||
options.homeModules.desktop.wayland.windowManager = {
|
options.homeModules.desktop.wayland.windowManager = {
|
||||||
hyprland = {
|
hyprland = {
|
||||||
enable = lib.mkEnableOption "Enable Hyprland window-manager";
|
enable = lib.mkEnableOption "Enable Hyprland window-manager";
|
||||||
nvidia = lib.mkOption {
|
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
description = "Apply Hyprland nvidia settings";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,14 @@
|
||||||
{ lib, config, pkgs, inputs, ... }:
|
{ lib, config, pkgs, inputs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
|
cfg = config.homeModules.desktop.wayland.windowManager.hyprland;
|
||||||
inherit (import ./pkgs {inherit pkgs;}) hyprbrightness hyprvolume hyprkillsession;
|
inherit (import ./pkgs {inherit pkgs;}) hyprbrightness hyprvolume;
|
||||||
inherit (inputs.ooks-scripts.packages.${pkgs.system}) hyprrecord powermenu zellijmenu;
|
inherit (inputs.ooks-scripts.packages.${pkgs.system}) powermenu zellijmenu;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.hyprland.homeManagerModules.default
|
inputs.hyprland.homeManagerModules.default
|
||||||
./settings
|
./settings
|
||||||
|
./extras
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
@ -17,15 +18,11 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast
|
|
||||||
pkgs.hyprshade
|
|
||||||
pkgs.hyprpicker
|
pkgs.hyprpicker
|
||||||
hyprvolume
|
hyprvolume
|
||||||
hyprkillsession
|
|
||||||
hyprbrightness
|
hyprbrightness
|
||||||
|
|
||||||
# Personal scripts
|
# Personal scripts
|
||||||
hyprrecord
|
|
||||||
powermenu
|
powermenu
|
||||||
zellijmenu #TODO: only add if zellij enabled
|
zellijmenu #TODO: only add if zellij enabled
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hyprcapture
|
||||||
|
./hyprshade
|
||||||
|
];
|
||||||
|
|
||||||
|
options.homeModules.desktop.wayland.windowManager.hyprland.extras = {
|
||||||
|
hyprcapture = {
|
||||||
|
enable = lib.mkEnableOption "Enable hyprcapture screenshot/recording module";
|
||||||
|
};
|
||||||
|
hyprshade = {
|
||||||
|
enable = lib.mkEnableOption "Enable hyprshade tool module";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
{ lib, config, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeModules.desktop.wayland.windowManager.hyprland.extras.hyprcapture;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
|
home.packages = with inputs; [
|
||||||
|
# Screenshot tool
|
||||||
|
hyprwm-contrib.packages.${pkgs.system}.grimblast
|
||||||
|
# Screen recording tool
|
||||||
|
ooks-scripts.packages.${pkgs.system}.hyprrecord
|
||||||
|
];
|
||||||
|
|
||||||
|
wayland.windowManager.hyprland.settings.bind = [
|
||||||
|
# Screenshot binds
|
||||||
|
", Print, exec, grimblast --notify --cursor copysave area"
|
||||||
|
"SUPER, Print, exec, grimblast --notify --cursor copysave screen"
|
||||||
|
# Recording binds
|
||||||
|
"SUPER, r, exec, hyprrecord -a -w video screen copysave"
|
||||||
|
"SUPER CTRL, r, exec, hyprrecord -a -w video area copysave"
|
||||||
|
"SUPER ALT, r, exec, hyprrecord -w gif area copysave"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.homeModules.desktop.wayland.windowManager.hyprland.extras.hyprshade;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = [ pkgs.hyprshade ];
|
||||||
|
# TODO: implement hyprshade configuration
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -4,8 +4,6 @@ let
|
||||||
packages = {
|
packages = {
|
||||||
hyprvolume = pkgs.callPackage ./hyprvolume.nix {};
|
hyprvolume = pkgs.callPackage ./hyprvolume.nix {};
|
||||||
hyprbrightness = pkgs.callPackage ./hyprbrightness.nix {};
|
hyprbrightness = pkgs.callPackage ./hyprbrightness.nix {};
|
||||||
# Script to help Hyprland quit https://github.com/hyprwm/Hyprland/issues/3558#issuecomment-1848768654
|
|
||||||
hyprkillsession = pkgs.callPackage ./hyprkillsession.nix {};
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
packages
|
packages
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
pkgs.writeShellApplication {
|
|
||||||
name = "hyprkillsession";
|
|
||||||
runtimeInputs = with pkgs; [ procps ];
|
|
||||||
text = ''
|
|
||||||
if pgrep -x Hyprland >/dev/null; then
|
|
||||||
|
|
||||||
hyprctl dispatch exit 0
|
|
||||||
sleep 2
|
|
||||||
|
|
||||||
if pgrep -x Hyprland >/dev/null; then
|
|
||||||
killall -9 Hyprland
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
|
|
@ -41,15 +41,6 @@ in
|
||||||
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
|
"SUPER, bracketleft, exec, ${spotifyctl} playback previous"
|
||||||
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
|
"SUPER, backslash, exec, ${spotifyctl} playback play-pause"
|
||||||
|
|
||||||
# Screenshot
|
|
||||||
|
|
||||||
", Print, exec, grimblast --notify --cursor copysave area"
|
|
||||||
"SUPER, Print, exec, grimblast --notify --cursor copysave screen"
|
|
||||||
"SUPER, r, exec, hyprrecord -a -w video screen copysave"
|
|
||||||
"SUPER CTRL, r, exec, hyprrecord -a -w video area copysave"
|
|
||||||
"SUPER ALT, r, exec, hyprrecord -w gif area copysave"
|
|
||||||
|
|
||||||
|
|
||||||
# Brightness
|
# Brightness
|
||||||
|
|
||||||
",XF86MonBrightnessUp, exec, hyprbrightness up"
|
",XF86MonBrightnessUp, exec, hyprbrightness up"
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,8 @@ in
|
||||||
{
|
{
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
wayland.windowManager.hyprland.settings.env = [
|
wayland.windowManager.hyprland.settings.env = [
|
||||||
"CLUTTER_BACKEND,wayland"
|
"XDG_SESSION_DESKTOP,hyprland"
|
||||||
"NIXOS_OZONE_WL,1"
|
|
||||||
"GDK_BACKEND,wayland"
|
|
||||||
"QT_QPA_PLATFORM,wayland"
|
|
||||||
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
|
|
||||||
"MOZ_ENABLE_WAYLAND,1"
|
|
||||||
"MOZ_DBUS_REMOTE,1"
|
|
||||||
"XDG_SESSION_TYPE,wayland"
|
|
||||||
"XDG_SESSIONDESKTOP,hyprland"
|
|
||||||
"XDG_CURRENT_DESKTOP,hyprland"
|
"XDG_CURRENT_DESKTOP,hyprland"
|
||||||
] ++ lib.optionals cfg.nvidia [
|
|
||||||
"LIBVA_DRIVER_NAME,nvidia"
|
|
||||||
"GBM_BACKEND,nvidia-drm"
|
|
||||||
"__GLX_VENDEOR_LIBRARY_NAME,nvidia"
|
|
||||||
"WLR_NO_HARDWARE_CURSORS,1"
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue