summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-11-01 23:13:39 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-11-01 23:13:39 +0100
commitf16dc0519398e40524445e42ed5352b12a484467 (patch)
tree85fb6ff5278dc8912e2fce1a360d3bf6ab0f5bf6
parentfeed6f9fb9e2ce27c1100c12d52bd0db472233bc (diff)
downloadnixos-f16dc0519398e40524445e42ed5352b12a484467.tar
nixos-f16dc0519398e40524445e42ed5352b12a484467.tar.gz
nixos-f16dc0519398e40524445e42ed5352b12a484467.tar.bz2
nixos-f16dc0519398e40524445e42ed5352b12a484467.tar.xz
nixos-f16dc0519398e40524445e42ed5352b12a484467.zip
...
-rwxr-xr-xsnap.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/snap.py b/snap.py
index 443b3bdb..bfebbb88 100755
--- a/snap.py
+++ b/snap.py
@@ -52,6 +52,8 @@ def borg_lv(lv, target, archive_prefix, dry_run, **args):
52 bindMounts = ['nix', 'run', 'proc', 'dev', 'sys', pathlib.Path(os.path.expanduser('~')).relative_to('/')] 52 bindMounts = ['nix', 'run', 'proc', 'dev', 'sys', pathlib.Path(os.path.expanduser('~')).relative_to('/')]
53 if 'SSH_AUTH_SOCK' in os.environ: 53 if 'SSH_AUTH_SOCK' in os.environ:
54 bindMounts.append(pathlib.Path(os.environ['SSH_AUTH_SOCK']).parent.relative_to('/')) 54 bindMounts.append(pathlib.Path(os.environ['SSH_AUTH_SOCK']).parent.relative_to('/'))
55 if 'BORG_CACHE_DIR' in os.environ:
56 bindMounts.append(pathlib.Path(os.environ['BORG_CACHE_DIR']).parent.relative_to('/'))
55 for bindMount in bindMounts: 57 for bindMount in bindMounts:
56 (chroot / bindMount).mkdir(parents=True,exist_ok=True) 58 (chroot / bindMount).mkdir(parents=True,exist_ok=True)
57 subprocess.run(['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], check=True) 59 subprocess.run(['mount', '--bind', pathlib.Path('/') / bindMount, chroot / bindMount], check=True)