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