From 08f64ab5a520e90875e7c6572538146dea50eca3 Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Mon, 5 May 2025 21:47:12 +0800 Subject: [PATCH] refactor(hyprland): move hyprland config to module --- configs/programs/hyprland.nix | 14 -------------- modules/nixos/de.nix | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/configs/programs/hyprland.nix b/configs/programs/hyprland.nix index 6892349..26e222b 100644 --- a/configs/programs/hyprland.nix +++ b/configs/programs/hyprland.nix @@ -1,19 +1,5 @@ { pkgs, ... }: { - 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 - ''; - - programs.hyprland = { - enable = true; - withUWSM = true; - }; - home-manager.users.rafiq = { xdg.configFile."uwsm/env".text = # sh '' diff --git a/modules/nixos/de.nix b/modules/nixos/de.nix index 20c0b7f..a10a278 100644 --- a/modules/nixos/de.nix +++ b/modules/nixos/de.nix @@ -54,6 +54,22 @@ in networking.firewall.allowedTCPPorts = [ 5353 ]; networking.firewall.allowedUDPPorts = [ 5353 ]; }) + (lib.mkIf (cfg.type == "hyprland") { + 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 + ''; + + programs.hyprland = { + enable = true; + withUWSM = true; + }; + + }) ] ); }