nichts/modules/programs/gui/bitwarden.mod.nix
Bloxx12 49882fbae8
various: environment.sessionVariables => environment.variables
Signed-off-by: Bloxx12 <charlie@charlieroot.dev>
Change-Id: I6a6a696495dd9b0b531ce319785d337e6f5b173f
2025-07-19 19:29:38 +02:00

34 lines
829 B
Nix

{
config,
lib,
pkgs,
...
}: let
inherit (config.modules.system) isGraphical;
inherit (lib.modules) mkIf;
bitwarden-desktop-wrapped = pkgs.symlinkJoin {
name = "bitwarden-desktop-wrapped";
paths = [pkgs.bitwarden-desktop];
nativeBuildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/bitwarden --set \
BITWARDEN_SSH_AUTH_SOCK /run/user/1000/ssh-agent.sock
'';
};
in {
config = mkIf isGraphical {
environment = {
systemPackages = lib.attrValues {
inherit
(pkgs)
bitwarden-cli
;
inherit bitwarden-desktop-wrapped;
};
# Set the ssh socket globally. This alows all applications and shells to use
# the ssh-agent.
variables."SSH_AUTH_SOCK" = "/run/user/1000/ssh-agent.sock";
};
};
}