From 32b732e5092296c34c42a28570c2c3372171ace3 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 12 Feb 2022 18:08:04 +0100 Subject: [PATCH] bundles/arch-with-gui: add some backup paths --- bundles/arch-with-gui/metadata.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bundles/arch-with-gui/metadata.py b/bundles/arch-with-gui/metadata.py index 852a1a2..ff82a8a 100644 --- a/bundles/arch-with-gui/metadata.py +++ b/bundles/arch-with-gui/metadata.py @@ -1,6 +1,11 @@ assert node.os == 'arch' defaults = { + 'backups': { + 'paths': { + '/etc/netctl', + }, + }, 'pacman': { 'packages': { # fonts @@ -47,3 +52,21 @@ defaults = { }, }, } + +@metadata_reactor.provides( + 'backups/paths', +) +def backup_every_user_home(metadata): + paths = set() + + for user, config in metadata.get('users', {}).items(): + if config.get('delete', False): + continue + + paths.add(config.get('home', f'/home/{user}')) + + return { + 'backups': { + 'paths': paths, + }, + }