diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index 6a4d7c5..f4023f7 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -22,6 +22,7 @@ in ./swayosd.nix ./sway-notification-center.nix ./ntfy-sh.nix + ./gnome-keyring.nix ]; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ diff --git a/home/modules/hyprland/gnome-keyring.nix b/home/modules/hyprland/gnome-keyring.nix new file mode 100644 index 0000000..821f18f --- /dev/null +++ b/home/modules/hyprland/gnome-keyring.nix @@ -0,0 +1,27 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.profile.hyprland; + inherit (lib) mkIf; + inherit (lib.meta) getExe; + secretKey = "gnome-keyring/${config.home.username}"; +in +{ + config = mkIf cfg.enable { + home.packages = with pkgs; [ + gnome.gnome-keyring + ]; + + sops.secrets.${secretKey} = { }; + wayland.windowManager.hyprland.settings.exec-once = + let + scriptFile = getExe (pkgs.writeShellScriptBin "gnome-keyring.sh" /*sh*/ '' + cat "${config.sops.secrets.${secretKey}.path}" | gnome-keyring-daemon --unlock + gnome-keyring-daemon --start --components=pkcs11,secrets,ssh + ''); + in + [ + ''${scriptFile}'' + ]; + }; +} + diff --git a/home/modules/hyprland/hyprland.nix b/home/modules/hyprland/hyprland.nix index 0ac962f..b69db7d 100644 --- a/home/modules/hyprland/hyprland.nix +++ b/home/modules/hyprland/hyprland.nix @@ -1,4 +1,4 @@ -{ lib, inputs, pkgs, config, ... }: +{ lib, pkgs, config, ... }: let cfg = config.profile.hyprland; select-window = rec { @@ -11,11 +11,6 @@ let script = pkgs.writeScriptBin filename (builtins.readFile (./scripts/init-wallpaper.sh)); path = "${script}/bin/${filename}"; }; - gnome-keyring = rec { - filename = "gnome-keyring.sh"; - script = pkgs.writeScriptBin filename (builtins.readFile (./scripts/gnome-keyring.sh)); - path = "${script}/bin/${filename}"; - }; in { config = lib.mkIf cfg.enable { @@ -211,7 +206,6 @@ in }; extraConfig = /*hyprlang*/ '' exec-once=dbus-update-activation-environment --all - exec-once=${gnome-keyring.path} ${config.sops.secrets."gnome-keyring/${config.home.username}".path} exec-once=foot --server exec-once=${init-wallpaper.path} ${./wallpaper.jpeg}