From fdd3f1c42b67c1d0d042c434a6e4ea42a45641ad Mon Sep 17 00:00:00 2001 From: cnst Date: Mon, 25 Nov 2024 19:16:07 +0100 Subject: [PATCH] greetd uwsm changes --- modules/nixos/services/greetd/default.nix | 57 ++++++++++++++--------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/modules/nixos/services/greetd/default.nix b/modules/nixos/services/greetd/default.nix index c8f59c7d..15a05efa 100644 --- a/modules/nixos/services/greetd/default.nix +++ b/modules/nixos/services/greetd/default.nix @@ -6,6 +6,7 @@ }: let inherit (lib) mkIf mkEnableOption mkMerge mkOption types; cfg = config.nixos.services.greetd; + host = config.networking.hostName; in { options = { nixos.services.greetd = { @@ -22,31 +23,45 @@ in { }; }; - config = mkIf cfg.enable { - services.greetd = let - session = { - command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop"; - user = cfg.user; + config = mkIf cfg.enable (mkMerge [ + { + services.greetd = let + session = { + command = "${lib.getExe config.programs.uwsm.package} start hyprland-uwsm.desktop"; + user = cfg.user; + }; + in { + enable = true; + settings = { + terminal.vt = 1; + default_session = session; + initial_session = session; + }; }; - in { - enable = true; - settings = { - terminal.vt = 1; - default_session = session; - initial_session = session; - }; - }; + } - programs.uwsm = { - enable = true; - waylandCompositors.hyprland = { - binPath = "/run/current-system/sw/bin/Hyprland"; - prettyName = "Hyprland"; - comment = "Hyprland managed by UWSM"; + (mkIf (host == "cnix") { + programs.uwsm = { + enable = true; + waylandCompositors.hyprland = { + binPath = "/etc/profiles/per-user/cnst/bin/Hyprland"; + prettyName = "Hyprland"; + comment = "Hyprland managed by UWSM"; + }; }; - }; + }) + (mkIf (host == "toothpc") { + programs.uwsm = { + enable = true; + waylandCompositors.hyprland = { + binPath = "/etc/profiles/per-user/toothpick/bin/Hyprland"; + prettyName = "Hyprland"; + comment = "Hyprland managed by UWSM"; + }; + }; + }) # Apply GnomeKeyring PAM Service based on user configuration # security.pam.services.greetd.enableGnomeKeyring = cfg.gnomeKeyring.enable; - }; + ]); }