Migrate from autofs to systemd automount

This commit is contained in:
coolneng 2020-10-21 23:13:58 +02:00
parent a74a6c8aa9
commit 50193e5563
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 28 additions and 12 deletions

View File

@ -88,18 +88,34 @@ in {
}; };
# Automount external storage # Automount external storage
services.autofs = { systemd.mounts = [
enable = true; # USB
timeout = 5; {
autoMaster = let what = "/dev/sdb1";
mapConf = pkgs.writeText "auto" '' where = "/usb";
usb -fstype=auto :/dev/sdb1 mountConfig = { TimeoutSec = "5"; };
sdcard -fstype=auto :/dev/mmcblk0p1 }
''; # SD card
in '' {
/media file:${mapConf} --timeout=5 what = "/dev/mmcblk0p1";
''; where = "/sdcard";
}; mountConfig = { TimeoutSec = "5"; };
}
];
systemd.automounts = [
# USB
{
where = "/usb";
automountConfig = { TimeoutIdleSec = "5"; };
wantedBy = [ "default.target" ];
}
# SD card
{
where = "/sdcard";
automountConfig = { TimeoutIdleSec = "5"; };
wantedBy = [ "default.target" ];
}
];
# Integrate pass with the browser # Integrate pass with the browser
programs.browserpass.enable = true; programs.browserpass.enable = true;