hyprland module consolidation and some refactoring
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.programs.hyprland.cnst.appearance;
|
||||
cfg = config.home.programs.hyprland.appearance;
|
||||
in {
|
||||
options = {
|
||||
home.programs.hyprland.cnst.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
|
||||
home.programs.hyprland.appearance.enable = mkEnableOption "Enables appearance settings in Hyprland";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
@@ -1,44 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
umodPath,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption mkDefault;
|
||||
cfg = config.home.programs.hyprland.cnst;
|
||||
in {
|
||||
imports = [
|
||||
"${umodPath}/programs/hyprland/cnst/appearance.nix"
|
||||
"${umodPath}/programs/hyprland/cnst/inputs.nix"
|
||||
"${umodPath}/programs/hyprland/cnst/keybinds.nix"
|
||||
"${umodPath}/programs/hyprland/cnst/rules.nix"
|
||||
"${umodPath}/programs/hyprland/cnst/startup.nix"
|
||||
];
|
||||
|
||||
options = {
|
||||
home.programs.hyprland.cnst.enable = mkEnableOption "Enable Hyprland";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.programs.hyprland.cnst = {
|
||||
appearance.enable = mkDefault cfg.enable;
|
||||
inputs.enable = mkDefault cfg.enable;
|
||||
keybinds.enable = mkDefault cfg.enable;
|
||||
rules.enable = mkDefault cfg.enable;
|
||||
startup.enable = mkDefault cfg.enable;
|
||||
};
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.packages.${pkgs.system}.default;
|
||||
systemd = {
|
||||
variables = ["--all"];
|
||||
extraCommands = [
|
||||
"systemctl --user stop graphical-session.target"
|
||||
"systemctl --user start hyprland-session.target"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.programs.hyprland.cnst.startup;
|
||||
in {
|
||||
options = {
|
||||
home.programs.hyprland.cnst.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec-once = [
|
||||
# STARTUP
|
||||
# exec-once = systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
|
||||
"systemctl --user start polkit-gnome-authentication-agent-1"
|
||||
# exec-once = lxqt-policykit-agent &
|
||||
"pamixer --set-volume 50"
|
||||
"blueman-applet & udiskie -Nt"
|
||||
"mullvad-vpn"
|
||||
# exec-once = swaybg -i ~/media/images/wallpaper.png
|
||||
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
|
||||
# exec-once = hyprctl dispatch exec "sleep 4s && copyq --start-server"
|
||||
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
|
||||
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,49 @@
|
||||
{umodPath, ...}: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
umodPath,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption mkOption types mkDefault;
|
||||
cfg = config.home.programs.hyprland;
|
||||
hyprlandPkg = pkgs.hyprland;
|
||||
isCnst = osConfig.networking.hostName == "cnix";
|
||||
in {
|
||||
imports = [
|
||||
"${umodPath}/programs/hyprland/cnst"
|
||||
"${umodPath}/programs/hyprland/toothpick"
|
||||
./appearance.nix
|
||||
./inputs.nix
|
||||
./keybinds.nix
|
||||
./rules.nix
|
||||
./startup.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
home.programs.hyprland = {
|
||||
enable = mkEnableOption "Enable Hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.programs.hyprland = {
|
||||
appearance.enable = mkDefault true;
|
||||
inputs.enable = mkDefault true;
|
||||
keybinds.enable = mkDefault true;
|
||||
rules.enable = mkDefault true;
|
||||
startup.enable = mkDefault true;
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
package = hyprlandPkg;
|
||||
systemd = {
|
||||
variables = ["--all"];
|
||||
extraCommands = [
|
||||
"systemctl --user stop graphical-session.target"
|
||||
"systemctl --user start hyprland-session.target"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,14 +5,28 @@
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
toothpc = osConfig.networking.hostName == "toothpc";
|
||||
kbOption =
|
||||
if osConfig.networking.hostName == "cnixpad"
|
||||
then "ctrl:swapcaps"
|
||||
else "";
|
||||
cfg = config.home.programs.hyprland.cnst.inputs;
|
||||
cfg = config.home.programs.hyprland.inputs;
|
||||
|
||||
renderSettings =
|
||||
if toothpc
|
||||
then {
|
||||
explicit_sync = 0;
|
||||
explicit_sync_kms = 0;
|
||||
direct_scanout = false;
|
||||
}
|
||||
else {
|
||||
explicit_sync = 2;
|
||||
explicit_sync_kms = 2;
|
||||
direct_scanout = false;
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
home.programs.hyprland.cnst.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
|
||||
home.programs.hyprland.inputs.enable = mkEnableOption "Enables input settings in Hyprland";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
@@ -73,11 +87,7 @@ in {
|
||||
xwayland = {
|
||||
force_zero_scaling = false;
|
||||
};
|
||||
render = {
|
||||
explicit_sync = 2;
|
||||
explicit_sync_kms = 2;
|
||||
direct_scanout = false;
|
||||
};
|
||||
render = renderSettings;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -6,28 +6,35 @@
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
modKey =
|
||||
if osConfig.networking.hostName == "cnixpad"
|
||||
then "ALT_L"
|
||||
else "SUPER";
|
||||
term =
|
||||
if osConfig.networking.hostName == "cnixpad"
|
||||
then "foot"
|
||||
else "alacritty";
|
||||
cfg = config.home.programs.hyprland.cnst.keybinds;
|
||||
cfg = config.home.programs.hyprland.keybinds;
|
||||
in {
|
||||
options = {
|
||||
home.programs.hyprland.cnst.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
|
||||
home.programs.hyprland.keybinds.enable = mkEnableOption "Enables keybind settings in Hyprland";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
wayland.windowManager.hyprland.settings = let
|
||||
cnixpad = osConfig.networking.hostName == "cnixpad";
|
||||
toothpc = osConfig.networking.hostName == "toothpc";
|
||||
modKey =
|
||||
if (cnixpad || toothpc)
|
||||
then "ALT_L"
|
||||
else "SUPER";
|
||||
term =
|
||||
if (cnixpad || toothpc)
|
||||
then "foot"
|
||||
else "alacritty";
|
||||
browser =
|
||||
if toothpc
|
||||
then "firefox"
|
||||
else "zen";
|
||||
in {
|
||||
"$terminal" = term;
|
||||
"$fileManager" = "thunar";
|
||||
"$passwordManager" = "keepassxc";
|
||||
"$menu" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
|
||||
"$menuw" = "pkill anyrun || anyrun | xargs hyprctl dispatch exec --";
|
||||
"$browser" = "zen";
|
||||
"$browserinc" = "zen --private-window";
|
||||
"$browser" = browser;
|
||||
"$browserinc" = "${browser} --private-window";
|
||||
"$yazi" = "alacritty -e yazi";
|
||||
"$tuirun" = "tuirun-toggle.sh";
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.programs.hyprland.cnst.rules;
|
||||
cfg = config.home.programs.hyprland.rules;
|
||||
in {
|
||||
options = {
|
||||
home.programs.hyprland.cnst.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
|
||||
home.programs.hyprland.rules.enable = mkEnableOption "Enables window rule settings in Hyprland";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
40
modules/home/programs/hyprland/startup.nix
Normal file
40
modules/home/programs/hyprland/startup.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
cfg = config.home.programs.hyprland.startup;
|
||||
isCnix = osConfig.networking.hostName == "cnix";
|
||||
isCnixpad = osConfig.networking.hostName == "cnixpad";
|
||||
isToothpc = osConfig.networking.hostName == "toothpc";
|
||||
in {
|
||||
options = {
|
||||
home.programs.hyprland.startup.enable = mkEnableOption "Enables startup settings in Hyprland";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
wayland.windowManager.hyprland.settings = {
|
||||
exec-once =
|
||||
[
|
||||
"systemctl --user start polkit-gnome-authentication-agent-1"
|
||||
"udiskie -Nt"
|
||||
"wl-clip-persist --clipboard regular --all-mime-type-regex '^(?!x-kde-passwordManagerHint).+'"
|
||||
"hyprctl dispatch exec 'sleep 5s && keepassxc'"
|
||||
]
|
||||
++ lib.optionals isCnix [
|
||||
"mullvad-vpn"
|
||||
"blueman-applet"
|
||||
"pamixer --set-volume 50"
|
||||
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
|
||||
]
|
||||
++ lib.optionals isCnixpad [
|
||||
"blueman-applet"
|
||||
]
|
||||
++ lib.optionals isToothpc [
|
||||
"mullvad-vpn"
|
||||
"hyprctl dispatch exec 'sleep 3s && solaar -w hide'"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user