feat(desktop): move window-manager config to homes and use home-manager modules
This commit is contained in:
parent
a04688d17b
commit
9167a54ace
12 changed files with 99 additions and 86 deletions
47
modules/nixos/desktop/window-manager/hyprland/default.nix
Normal file
47
modules/nixos/desktop/window-manager/hyprland/default.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf singleton;
|
||||
inherit (config.desktop) mainMonitor;
|
||||
cfg = config.desktop.window-manager.hyprland;
|
||||
in
|
||||
{
|
||||
options.desktop.window-manager.hyprland = {
|
||||
enable = mkEnableOption "";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
desktop.enableWaylandUtilities = true;
|
||||
environment.loginShellInit = # sh
|
||||
''
|
||||
if [[ -z "$SSH_CLIENT" && -z "$SSH_CONNECTION" ]]; then
|
||||
if uwsm check may-start; then
|
||||
exec uwsm start hyprland-uwsm.desktop
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
environment.variables = {
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
home-manager.sharedModules = singleton {
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
systemd.enable = false;
|
||||
};
|
||||
xdg.configFile."uwsm/env".text = # sh
|
||||
''
|
||||
export GDK_SCALE=${mainMonitor.scale}
|
||||
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
||||
'';
|
||||
xdg.configFile."uwsm/env-hyprland".text = # sh
|
||||
''
|
||||
export GDK_SCALE=${mainMonitor.scale}
|
||||
export STEAM_FORCE_DESKTOPUI_SCALING=${mainMonitor.scale}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue