liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

service.nix (396B)


      1 {
      2   liminix
      3 , lib
      4 }:
      5 { device, mountpoint, options, fstype }:
      6 let
      7   inherit (liminix.services) oneshot;
      8 in oneshot {
      9   name = "mount.${lib.escapeURL mountpoint}";
     10   up = ''
     11     while ! findfs ${device}; do
     12       echo waiting for device ${device}
     13       sleep 1
     14     done
     15     mount -t ${fstype} -o ${lib.concatStringsSep "," options} ${device} ${mountpoint}
     16   '';
     17   down = "umount ${mountpoint}";
     18 }