Modules/Hyprland: Slight config cleanup
This commit is contained in:
+44
-16
@@ -54,7 +54,7 @@ in
|
|||||||
cursorSize = 24;
|
cursorSize = 24;
|
||||||
cursorPackage = pkgs.bibata-cursors;
|
cursorPackage = pkgs.bibata-cursors;
|
||||||
|
|
||||||
iconTheme = "Papirus";
|
iconTheme = "Papirus-Dark";
|
||||||
iconPackage = pkgs.papirus-icon-theme;
|
iconPackage = pkgs.papirus-icon-theme;
|
||||||
|
|
||||||
scheme = "catppuccin-mocha";
|
scheme = "catppuccin-mocha";
|
||||||
@@ -85,7 +85,32 @@ in
|
|||||||
keybindings = {
|
keybindings = {
|
||||||
main-mod = "SUPER";
|
main-mod = "SUPER";
|
||||||
|
|
||||||
bindings = lib.mergeAttrsList [
|
bindings = let
|
||||||
|
sessionMenu = mylib.rofi.mkMenu {
|
||||||
|
prompt = "Session2";
|
||||||
|
layers = [
|
||||||
|
{
|
||||||
|
" Poweroff" = "poweroff";
|
||||||
|
" Reboot" = "reboot";
|
||||||
|
" Lock" = "loginctl lock-session";
|
||||||
|
# " Reload Hyprpanel" = "systemctl --user restart hyprpanel.service";
|
||||||
|
" Reload Hyprland" = "hyprctl reload";
|
||||||
|
" Exit Hyprland" = "hyprctl dispatch exit";
|
||||||
|
# " Exit Niri" = "niri msg action quit";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
prompts = ["Select Session Action"];
|
||||||
|
rofiCmd = "walker -d";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.mergeAttrsList [
|
||||||
|
{
|
||||||
|
"$mainMod SHIFT, a" = ["exec, walker -m providerlist"];
|
||||||
|
"$mainMod, a" = ["exec, walker -m desktopapplications"];
|
||||||
|
"$mainMod, c" = ["exec, walker -m clipboard"];
|
||||||
|
"$mainMod, Escape" = ["exec, ${sessionMenu}/bin/rofi-menu-Session2"];
|
||||||
|
"$mainMod CTRL, w" = ["exec, waypaper"];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
# Applications
|
# Applications
|
||||||
"$mainMod, t" = ["exec, kitty"];
|
"$mainMod, t" = ["exec, kitty"];
|
||||||
@@ -152,19 +177,18 @@ in
|
|||||||
"10" = "0";
|
"10" = "0";
|
||||||
};
|
};
|
||||||
|
|
||||||
special-ws-bindings = {
|
# special-ws-bindings = {
|
||||||
"ferdium" = "x";
|
# "ferdium" = "x";
|
||||||
"msty" = "z";
|
# "msty" = "z";
|
||||||
"btop" = "b";
|
# "btop" = "b";
|
||||||
"rmpc" = "r";
|
# "rmpc" = "r";
|
||||||
};
|
# };
|
||||||
};
|
};
|
||||||
|
|
||||||
autostart = {
|
autostart = {
|
||||||
immediate = [
|
immediate = [
|
||||||
"kitty --hold fastfetch"
|
"kitty --hold fastfetch"
|
||||||
# "zeal"
|
# "zeal"
|
||||||
"nextcloud --background"
|
|
||||||
# "protonvpn-app"
|
# "protonvpn-app"
|
||||||
|
|
||||||
# "kdeconnect-indicator" # started by services.kdeconnect.indicator
|
# "kdeconnect-indicator" # started by services.kdeconnect.indicator
|
||||||
@@ -172,6 +196,7 @@ in
|
|||||||
|
|
||||||
delayed = [
|
delayed = [
|
||||||
# "keepassxc" # The tray doesn't work when started too early
|
# "keepassxc" # The tray doesn't work when started too early
|
||||||
|
"nextcloud --background"
|
||||||
];
|
];
|
||||||
|
|
||||||
special-silent = {
|
special-silent = {
|
||||||
@@ -190,15 +215,15 @@ in
|
|||||||
|
|
||||||
workspacerules = {
|
workspacerules = {
|
||||||
"1" = [];
|
"1" = [];
|
||||||
"2" = ["neovide" "code-url-handler"];
|
"2" = ["neovide" "code-url-handler" "dev.zed.Zed" "code" "jetbrains-(.+)"];
|
||||||
"3" = ["obsidian" "Zotero"];
|
"3" = ["obsidian" "Zotero"];
|
||||||
"4" = ["firefox" "Google-chrome" "chromium-browser" "org.qutebrowser.qutebrowser"];
|
"4" = ["firefox" "Google-chrome" "chromium-browser" "org.qutebrowser.qutebrowser"];
|
||||||
"5" = ["steam"];
|
"5" = ["steam"];
|
||||||
"6" = ["steam_app_(.+)"];
|
"6" = ["steam_app_(.+)" "factorio"];
|
||||||
"7" = ["signal"];
|
"7" = ["signal"];
|
||||||
"8" = ["tidal-hifi"];
|
"8" = [];
|
||||||
"9" = ["discord"];
|
"9" = ["discord"];
|
||||||
"10" = ["python3"];
|
"10" = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
floating = [
|
floating = [
|
||||||
@@ -209,9 +234,10 @@ in
|
|||||||
}
|
}
|
||||||
{class = "ffplay";}
|
{class = "ffplay";}
|
||||||
{class = "Unity";}
|
{class = "Unity";}
|
||||||
|
{class = "code-url-handler";}
|
||||||
];
|
];
|
||||||
|
|
||||||
transparent-opacity = "0.75";
|
transparent-opacity = "0.85";
|
||||||
|
|
||||||
transparent = [
|
transparent = [
|
||||||
"kitty"
|
"kitty"
|
||||||
@@ -297,9 +323,11 @@ in
|
|||||||
|
|
||||||
# Enable wayland
|
# Enable wayland
|
||||||
XDG_SESSION_TYPE = "wayland";
|
XDG_SESSION_TYPE = "wayland";
|
||||||
QT_QPA_PLATFORM = "wayland;xcb";
|
# QT_QPA_PLATFORM = "wayland;xcb";
|
||||||
|
QT_QPA_PLATFORM = "wayland";
|
||||||
NIXOS_OZONE_WL = "1";
|
NIXOS_OZONE_WL = "1";
|
||||||
# SDL_VIDEODRIVER = "wayland"; # Leave unset as gamescope uses xwayland
|
# ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||||
|
SDL_VIDEODRIVER = "wayland"; # Leave unset as gamescope uses xwayland
|
||||||
|
|
||||||
# Run SSH_ASKPASS as GUI, not TTY for Obsidian git
|
# Run SSH_ASKPASS as GUI, not TTY for Obsidian git
|
||||||
SSH_ASKPASS_REQUIRE = "prefer";
|
SSH_ASKPASS_REQUIRE = "prefer";
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
y = 0;
|
y = 0;
|
||||||
scale = 1;
|
scale = 1;
|
||||||
bitdepth = 10;
|
bitdepth = 10;
|
||||||
cm = "hdr";
|
cm = "auto"; # with render:cm_auto_hdr, we don't need hdr here
|
||||||
};
|
};
|
||||||
|
|
||||||
"DP-2" = {
|
"DP-2" = {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
inputs.nixvim.homeModules.nixvim
|
inputs.nixvim.homeModules.nixvim
|
||||||
inputs.textfox.homeManagerModules.default
|
inputs.textfox.homeManagerModules.default
|
||||||
inputs.walker.homeManagerModules.default
|
inputs.walker.homeManagerModules.default
|
||||||
|
# inputs.stylix.homeModules.stylix
|
||||||
# inputs.direnv-instant.homeModules.direnv-instant
|
# inputs.direnv-instant.homeModules.direnv-instant
|
||||||
# inputs.niri.homeModules.niri # Imported by system module
|
# inputs.niri.homeModules.niri # Imported by system module
|
||||||
# inputs.noctalia.homeModules.default
|
# inputs.noctalia.homeModules.default
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ builtins.concatLists [
|
|||||||
[
|
[
|
||||||
"hyprctl setcursor ${config.home.pointerCursor.name} ${builtins.toString config.home.pointerCursor.size}"
|
"hyprctl setcursor ${config.home.pointerCursor.name} ${builtins.toString config.home.pointerCursor.size}"
|
||||||
"hyprsunset --identity"
|
"hyprsunset --identity"
|
||||||
|
"waypaper --restore"
|
||||||
|
"fcitx5"
|
||||||
|
|
||||||
# HACK: Hyprland doesn't set the xwayland/x11 keymap correctly
|
# HACK: Hyprland doesn't set the xwayland/x11 keymap correctly
|
||||||
"setxkbmap -layout ${hyprland.keyboard.layout} -variant ${hyprland.keyboard.variant} -option ${hyprland.keyboard.option} -model pc104"
|
"setxkbmap -layout ${hyprland.keyboard.layout} -variant ${hyprland.keyboard.variant} -option ${hyprland.keyboard.option} -model pc104"
|
||||||
@@ -20,6 +22,11 @@ builtins.concatLists [
|
|||||||
# This is used for example when running systemd commands without root.
|
# This is used for example when running systemd commands without root.
|
||||||
# "systemctl --user start hyprpolkitagent.service"
|
# "systemctl --user start hyprpolkitagent.service"
|
||||||
# "${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1"
|
# "${pkgs.kdePackages.polkit-kde-agent-1}/libexec/polkit-kde-authentication-agent-1"
|
||||||
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
|
|
||||||
|
# TODO: This is started by niri already (extract to module so niri/hyprland can both use it)
|
||||||
|
# "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"
|
||||||
|
|
||||||
|
# TODO: This is started by niri already (extract to module so niri/hyprland can both use it)
|
||||||
|
"dunst"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -24,11 +24,6 @@
|
|||||||
in {
|
in {
|
||||||
options.homemodules.hyprland = import ./options.nix {inherit lib mylib;};
|
options.homemodules.hyprland = import ./options.nix {inherit lib mylib;};
|
||||||
|
|
||||||
# TODO: Extract common niri/hyprland stuff to modules (e.g., dunst), so no configs are duplicated
|
|
||||||
# TODO: Remove unnecessary bullshit
|
|
||||||
# TODO: Switch to lua config
|
|
||||||
# TODO: Synchronize with niri mappings
|
|
||||||
|
|
||||||
config = lib.mkIf hyprland.enable {
|
config = lib.mkIf hyprland.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
@@ -78,45 +73,10 @@ in {
|
|||||||
# Deps for Qt5 and Qt6 apps (e.g., Nextcloud)
|
# Deps for Qt5 and Qt6 apps (e.g., Nextcloud)
|
||||||
qt5.qtwayland
|
qt5.qtwayland
|
||||||
qt6.qtwayland
|
qt6.qtwayland
|
||||||
|
|
||||||
|
# xwayland
|
||||||
|
# wayland-protocols
|
||||||
];
|
];
|
||||||
|
|
||||||
file = {
|
|
||||||
".config/hypr/keybindings.info".text = let
|
|
||||||
fixupHomeDir = key:
|
|
||||||
builtins.replaceStrings ["/home/${username}"] ["~"] key;
|
|
||||||
|
|
||||||
fixupNixStore = key: let
|
|
||||||
# The pattern has to match the entire string, otherwise it won't work
|
|
||||||
matches = builtins.match ".*/nix/store/(.*)/.*" key;
|
|
||||||
in
|
|
||||||
if (matches == null)
|
|
||||||
then key
|
|
||||||
else builtins.replaceStrings matches ["..."] key;
|
|
||||||
|
|
||||||
fixupNoMod = key:
|
|
||||||
builtins.replaceStrings ["<-"] ["<"] key;
|
|
||||||
|
|
||||||
mkBindHelpKey = key:
|
|
||||||
builtins.replaceStrings ["$mainMod" " " ","] ["${hyprland.keybindings.main-mod}" "-" ""] key;
|
|
||||||
|
|
||||||
mkBindHelpAction = action:
|
|
||||||
builtins.replaceStrings [","] [""] action;
|
|
||||||
|
|
||||||
mkBindHelp = key: action: "<${mkBindHelpKey key}>: ${mkBindHelpAction action}";
|
|
||||||
|
|
||||||
mkBindsHelp = key: actions:
|
|
||||||
actions
|
|
||||||
|> builtins.map (mkBindHelp key)
|
|
||||||
|> builtins.map fixupNoMod
|
|
||||||
|> builtins.map fixupNixStore
|
|
||||||
|> builtins.map fixupHomeDir;
|
|
||||||
in
|
|
||||||
(hyprland.keybindings.bindings // always-bind)
|
|
||||||
|> builtins.mapAttrs mkBindsHelp
|
|
||||||
|> builtins.attrValues
|
|
||||||
|> builtins.concatLists
|
|
||||||
|> builtins.concatStringsSep "\n";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
@@ -131,12 +91,15 @@ in {
|
|||||||
systemd.user.services.hypridle.Install.WantedBy = lib.mkForce ["hyprland-session.target"];
|
systemd.user.services.hypridle.Install.WantedBy = lib.mkForce ["hyprland-session.target"];
|
||||||
systemd.user.services.hypridle.Unit.After = lib.mkForce ["hyprland-session.target"];
|
systemd.user.services.hypridle.Unit.After = lib.mkForce ["hyprland-session.target"];
|
||||||
systemd.user.services.hypridle.Unit.PartOf = lib.mkForce ["hyprland-session.target"];
|
systemd.user.services.hypridle.Unit.PartOf = lib.mkForce ["hyprland-session.target"];
|
||||||
|
systemd.user.services.elephant.Install.WantedBy = lib.mkForce ["hyprland-session.target" "graphical-session.target"];
|
||||||
|
systemd.user.services.elephant.Unit.After = lib.mkForce ["hyprland-session.target" "graphical-session.target"];
|
||||||
|
systemd.user.services.elephant.Unit.PartOf = lib.mkForce ["hyprland-session.target" "graphical-session.target"];
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||||
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||||
configType = "hyprlang"; # TODO: lua
|
configType = "hyprlang";
|
||||||
|
|
||||||
systemd.enable = true; # Enable hyprland-session.target
|
systemd.enable = true; # Enable hyprland-session.target
|
||||||
systemd.variables = ["--all"]; # Import PATH into systemd
|
systemd.variables = ["--all"]; # Import PATH into systemd
|
||||||
|
|||||||
@@ -137,8 +137,12 @@
|
|||||||
hyprland.windowrules
|
hyprland.windowrules
|
||||||
];
|
];
|
||||||
|
|
||||||
|
render = {
|
||||||
|
cm_enabled = true;
|
||||||
|
cm_auto_hdr = true;
|
||||||
|
};
|
||||||
|
|
||||||
dwindle = {
|
dwindle = {
|
||||||
pseudotile = true;
|
|
||||||
preserve_split = true;
|
preserve_split = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -14,7 +14,7 @@
|
|||||||
experimental-features = nix-command flakes pipe-operators
|
experimental-features = nix-command flakes pipe-operators
|
||||||
'';
|
'';
|
||||||
|
|
||||||
settings = {
|
settings = rec {
|
||||||
trusted-users = ["root" username];
|
trusted-users = ["root" username];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
|
|
||||||
@@ -24,11 +24,13 @@
|
|||||||
"https://cache.nixos.org"
|
"https://cache.nixos.org"
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
# "https://app.cachix.org/cache/nixos-rocm"
|
# "https://app.cachix.org/cache/nixos-rocm"
|
||||||
|
"https://hyprland.cachix.org"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
# "nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE="
|
# "nixos-rocm.cachix.org-1:VEpsf7pRIijjd8csKjFNBGzkBqOmw8H9PRmgAq14LnE="
|
||||||
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -318,8 +318,8 @@ with mylib.networking; {
|
|||||||
gpu-screen-recorder.enable = !headless;
|
gpu-screen-recorder.enable = !headless;
|
||||||
|
|
||||||
hyprland = {
|
hyprland = {
|
||||||
# enable = true;
|
enable = false;
|
||||||
enable = !headless;
|
# enable = !headless;
|
||||||
|
|
||||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||||
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
portalPackage = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||||
|
|||||||
Reference in New Issue
Block a user