default.nix (1477B)
1 ## Mount 2 ## 3 ## Mount filesystems 4 5 { 6 lib, 7 pkgs, 8 config, 9 ... 10 }: 11 let 12 inherit (lib) mkOption types; 13 inherit (pkgs) liminix; 14 15 in 16 { 17 options = { 18 system.service.mount = mkOption { 19 type = liminix.lib.types.serviceDefn; 20 }; 21 }; 22 imports = [ 23 ../mdevd.nix 24 ../uevent-rule 25 ]; 26 config.system.service.mount = 27 let 28 svc = config.system.callService ./service.nix { 29 partlabel = mkOption { 30 type = types.str; 31 example = "my-usb-stick"; 32 }; 33 mountpoint = mkOption { 34 type = types.str; 35 example = "/mnt/media"; 36 }; 37 options = mkOption { 38 type = types.listOf types.str; 39 default = [ ]; 40 example = [ 41 "noatime" 42 "ro" 43 "sync" 44 ]; 45 }; 46 fstype = mkOption { 47 type = types.str; 48 default = "auto"; 49 example = "vfat"; 50 }; 51 }; 52 in 53 svc 54 // { 55 build = 56 args: 57 let 58 args' = args // { 59 dependencies = (args.dependencies or [ ]) ++ [ 60 config.services.mdevd 61 config.services.devout 62 ]; 63 }; 64 in 65 svc.build args'; 66 }; 67 68 config.programs.busybox = { 69 applets = [ 70 "blkid" 71 "findfs" 72 ]; 73 options = { 74 FEATURE_BLKID_TYPE = "y"; 75 FEATURE_MOUNT_FLAGS = "y"; 76 FEATURE_MOUNT_LABEL = "y"; 77 FEATURE_VOLUMEID_EXT = "y"; 78 }; 79 }; 80 }