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