1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39:46 +01:00
home-manager/tests/modules/programs/rbw/settings.nix
Bruno BELANYI 1ab3cec3a1
rbw: simplify 'pinentry' type
Following some upstream changes [1], it's now possible to use a simplified
package type for the option.

[1]: https://github.com/NixOS/nixpkgs/pull/133542
2024-03-14 08:29:43 +01:00

38 lines
865 B
Nix

{ pkgs, ... }:
let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
path = if isDarwin then
"Library/Application Support/rbw/config.json"
else
".config/rbw/config.json";
expected = pkgs.writeText "rbw-expected.json" ''
{
"base_url": "bitwarden.example.com",
"email": "name@example.com",
"identity_url": "identity.example.com",
"lock_timeout": 300,
"pinentry": "@pinentry-gnome3@/bin/dummy"
}
'';
in {
imports = [ ./rbw-stubs.nix ];
programs.rbw = {
enable = true;
settings = {
email = "name@example.com";
base_url = "bitwarden.example.com";
identity_url = "identity.example.com";
lock_timeout = 300;
pinentry = pkgs.pinentry-gnome3;
};
};
nmt.script = ''
assertFileExists home-files/${path}
assertFileContent home-files/${path} '${expected}'
'';
}