gui/bitwarden: init
This commit is contained in:
parent
fa71542fe2
commit
ef617f52db
1 changed files with 34 additions and 0 deletions
34
modules/programs/gui/bitwarden.mod.nix
Normal file
34
modules/programs/gui/bitwarden.mod.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
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.
|
||||
sessionVariables."SSH_AUTH_SOCK" = "/run/user/1000/ssh-agent.sock";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue