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