hyprland: split off gnome-keyring to its own module

This commit is contained in:
Tigor Hutasuhut 2024-10-17 07:58:29 +07:00
parent 8af4513dcf
commit 71732127de
3 changed files with 29 additions and 7 deletions

View file

@ -22,6 +22,7 @@ in
./swayosd.nix ./swayosd.nix
./sway-notification-center.nix ./sway-notification-center.nix
./ntfy-sh.nix ./ntfy-sh.nix
./gnome-keyring.nix
]; ];
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [

View file

@ -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}''
];
};
}

View file

@ -1,4 +1,4 @@
{ lib, inputs, pkgs, config, ... }: { lib, pkgs, config, ... }:
let let
cfg = config.profile.hyprland; cfg = config.profile.hyprland;
select-window = rec { select-window = rec {
@ -11,11 +11,6 @@ let
script = pkgs.writeScriptBin filename (builtins.readFile (./scripts/init-wallpaper.sh)); script = pkgs.writeScriptBin filename (builtins.readFile (./scripts/init-wallpaper.sh));
path = "${script}/bin/${filename}"; 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 in
{ {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -211,7 +206,6 @@ in
}; };
extraConfig = /*hyprlang*/ '' extraConfig = /*hyprlang*/ ''
exec-once=dbus-update-activation-environment --all 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=foot --server
exec-once=${init-wallpaper.path} ${./wallpaper.jpeg} exec-once=${init-wallpaper.path} ${./wallpaper.jpeg}