mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
39 lines
926 B
Nix
39 lines
926 B
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
|
|
|
path =
|
|
if isDarwin then "Library/Application Support/rbw/config.json" else ".config/rbw/config.json";
|
|
|
|
expected = builtins.toFile "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
|
|
{
|
|
programs.rbw = {
|
|
enable = true;
|
|
settings = {
|
|
email = "name@example.com";
|
|
base_url = "bitwarden.example.com";
|
|
identity_url = "identity.example.com";
|
|
lock_timeout = 300;
|
|
pinentry = config.lib.test.mkStubPackage {
|
|
name = "pinentry";
|
|
outPath = "@pinentry-gnome3@";
|
|
};
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists "home-files/${path}"
|
|
assertFileContent "home-files/${path}" '${expected}'
|
|
'';
|
|
}
|