NixOS/home/modules/hyprland/gnome-keyring.nix
Tigor Hutasuhut df38983ef5 nixos: update to 24.11
Notes:

- Hyprland now uses the Nixpkgs version to minimize building.
- Java is broken on build, disabled all java apps for now.
2024-11-24 11:02:56 +07:00

31 lines
710 B
Nix

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