extract "mount filesystem" to module

This commit is contained in:
Daniel Barlow
2023-09-04 21:17:52 +01:00
parent 83092b7b73
commit 3bdc986dd7
4 changed files with 75 additions and 16 deletions

View File

@@ -30,6 +30,7 @@ in rec {
../modules/vlan
../modules/ssh
../modules/watchdog
../modules/mount
];
hostname = "arhcive";
@@ -101,27 +102,18 @@ in rec {
};
programs.busybox = {
applets = ["blkid" "lsusb" "findfs" "tar"];
applets = ["lsusb" "tar"];
options = {
FEATURE_LS_TIMESTAMPS = "y";
FEATURE_LS_SORTFILES = "y";
FEATURE_BLKID_TYPE = "y";
FEATURE_MOUNT_FLAGS = "y";
FEATURE_MOUNT_LABEL = "y";
FEATURE_VOLUMEID_EXT = "y";
};
};
services.mount_external_disk = oneshot {
name = "mount_external_disk";
up = ''
while ! findfs LABEL=backup-disk; do
echo waiting for backup-disk
sleep 1
done
mount -t ext4 LABEL=backup-disk /srv
'';
down = "umount /srv";
services.mount_external_disk = svc.mount.build {
device = "LABEL=backup-disk";
mountpoint = "/srv";
fstype = "ext4";
};
services.rsync =