diff options
Diffstat (limited to 'hosts/vidhar/borg/copy.py')
-rwxr-xr-x | hosts/vidhar/borg/copy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index 809184a3..c839194c 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py | |||
@@ -101,7 +101,11 @@ def copy_archive(src_repo_path, dst_repo_path, entry): | |||
101 | for path in [chroot,upper,work]: | 101 | for path in [chroot,upper,work]: |
102 | path.mkdir() | 102 | path.mkdir() |
103 | subprocess.run(['mount', '-t', 'overlay', 'overlay', '-o', f'lowerdir=/,upperdir={upper},workdir={work}', chroot], check=True) | 103 | subprocess.run(['mount', '-t', 'overlay', 'overlay', '-o', f'lowerdir=/,upperdir={upper},workdir={work}', chroot], check=True) |
104 | bindMounts = ['nix', 'run', 'run/secrets.d', 'var/lib/borg', 'proc', 'dev', 'sys', pathlib.Path(os.path.expanduser('~')).relative_to('/')] | 104 | bindMounts = ['nix', 'run', 'proc', 'dev', 'sys', pathlib.Path(os.path.expanduser('~')).relative_to('/')] |
105 | if os.environ.get('BORG_BASE_DIR'): | ||
106 | bindMounts.append(os.environ['BORG_BASE_DIR']) | ||
107 | if os.environ.get('CREDENTIALS_DIRECTORY'): | ||
108 | bindMounts.append(os.environ['CREDENTIALS_DIRECTORY']) | ||
105 | if not ":" in src_repo_path: | 109 | if not ":" in src_repo_path: |
106 | bindMounts.append(pathlib.Path(src_repo_path).relative_to('/')) | 110 | bindMounts.append(pathlib.Path(src_repo_path).relative_to('/')) |
107 | if 'SSH_AUTH_SOCK' in os.environ: | 111 | if 'SSH_AUTH_SOCK' in os.environ: |