mirror of
https://github.com/nix-community/home-manager
synced 2024-08-20 11:06:30 +02:00
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
33 lines
642 B
Nix
33 lines
642 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": null,
|
|
"email": "name@example.com",
|
|
"identity_url": null,
|
|
"lock_timeout": 3600,
|
|
"pinentry": null
|
|
}
|
|
'';
|
|
in {
|
|
imports = [ ./rbw-stubs.nix ];
|
|
|
|
programs.rbw = {
|
|
enable = true;
|
|
settings = { email = "name@example.com"; };
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/${path}
|
|
assertFileContent home-files/${path} '${expected}'
|
|
'';
|
|
}
|