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": null,
|
|
|
|
"email": "name@example.com",
|
|
|
|
"identity_url": null,
|
|
|
|
"lock_timeout": 3600,
|
2024-03-10 11:24:45 +01:00
|
|
|
"pinentry": null
|
2021-06-06 02:09:02 +02:00
|
|
|
}
|
|
|
|
'';
|
|
|
|
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"; };
|
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
|
|
|
}
|