Migrate from autofs to systemd automount
This commit is contained in:
parent
a74a6c8aa9
commit
50193e5563
|
@ -88,18 +88,34 @@ in {
|
|||
};
|
||||
|
||||
# Automount external storage
|
||||
services.autofs = {
|
||||
enable = true;
|
||||
timeout = 5;
|
||||
autoMaster = let
|
||||
mapConf = pkgs.writeText "auto" ''
|
||||
usb -fstype=auto :/dev/sdb1
|
||||
sdcard -fstype=auto :/dev/mmcblk0p1
|
||||
'';
|
||||
in ''
|
||||
/media file:${mapConf} --timeout=5
|
||||
'';
|
||||
};
|
||||
systemd.mounts = [
|
||||
# USB
|
||||
{
|
||||
what = "/dev/sdb1";
|
||||
where = "/usb";
|
||||
mountConfig = { TimeoutSec = "5"; };
|
||||
}
|
||||
# SD card
|
||||
{
|
||||
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
|
||||
programs.browserpass.enable = true;
|
||||
|
|
Loading…
Reference in New Issue