2021-06-06 02:09:02 +02:00
|
|
|
{ pkgs, ... }:
|
2021-09-26 11:08:45 +02:00
|
|
|
|
2021-06-06 02:09:02 +02:00
|
|
|
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/pinentry"
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
in {
|
2021-09-26 11:08:45 +02:00
|
|
|
imports = [ ./rbw-stubs.nix ];
|
2021-06-06 02:09:02 +02:00
|
|
|
|
2021-09-26 11:08:45 +02:00
|
|
|
programs.rbw = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
email = "name@example.com";
|
|
|
|
base_url = "bitwarden.example.com";
|
|
|
|
identity_url = "identity.example.com";
|
|
|
|
lock_timeout = 300;
|
|
|
|
pinentry = "gnome3";
|
|
|
|
};
|
2021-06-06 02:09:02 +02:00
|
|
|
};
|
2021-09-26 11:08:45 +02:00
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
assertFileExists home-files/${path}
|
|
|
|
assertFileContent home-files/${path} '${expected}'
|
|
|
|
'';
|
2021-06-06 02:09:02 +02:00
|
|
|
}
|