fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert Helgessontests: add option `test.stubs`cb09a968

master
668 B32 linesraw
1{ pkgs, ... }:
2
3let
4  inherit (pkgs.stdenv.hostPlatform) isDarwin;
5
6  path = if isDarwin then
7    "Library/Application Support/rbw/config.json"
8  else
9    ".config/rbw/config.json";
10
11  expected = pkgs.writeText "rbw-expected.json" ''
12    {
13      "base_url": null,
14      "email": "name@example.com",
15      "identity_url": null,
16      "lock_timeout": 3600,
17      "pinentry": "@pinentry-gtk2@/bin/pinentry"
18    }
19  '';
20in {
21  imports = [ ./rbw-stubs.nix ];
22
23  programs.rbw = {
24    enable = true;
25    settings = { email = "name@example.com"; };
26  };
27
28  nmt.script = ''
29    assertFileExists home-files/${path}
30    assertFileContent home-files/${path} '${expected}'
31  '';
32}