fork/home-manager

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

Damien Cassouborgmatic: improve support for version 1.8.0d4a5076e

master
927 B40 linesraw
1{ config, pkgs, ... }:
2
3let
4
5  backups = config.programs.borgmatic.backups;
6  excludeFile = builtins.toFile "excludeFile.txt" "/foo/bar";
7
8in {
9  programs.borgmatic = {
10    enable = true;
11    backups = {
12      main = {
13        location = {
14          sourceDirectories = [ "/my-stuff-to-backup" ];
15          repositories = [ "/mnt/disk1" ];
16          excludeHomeManagerSymlinks = true;
17        };
18      };
19    };
20  };
21
22  test.stubs.borgmatic = { };
23
24  nmt.script = ''
25    config_file=$TESTED/home-files/.config/borgmatic.d/main.yaml
26    assertFileExists $config_file
27
28    yq=${pkgs.yq-go}/bin/yq
29
30    hmExclusionsFile=$($yq '.exclude_from[0]' $config_file)
31    expected_content='/home/hm-user/.config/borgmatic.d/main.yaml'
32
33    grep --quiet "$expected_content" "$hmExclusionsFile"
34
35    if [[ $? -ne 0 ]]; then
36      echo "Expected to find $expected_content in file $hmExclusionsFile but didn't" >&2
37      exit 1
38    fi
39  '';
40}