2023-09-04 21:19:22 +00:00
|
|
|
## Mount
|
|
|
|
##
|
|
|
|
## Mount filesystems
|
|
|
|
|
2025-02-10 21:55:08 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
2023-09-04 20:17:52 +00:00
|
|
|
let
|
|
|
|
inherit (lib) mkOption types;
|
|
|
|
inherit (pkgs) liminix;
|
|
|
|
|
2025-02-10 21:55:08 +00:00
|
|
|
in
|
|
|
|
{
|
2023-09-04 20:17:52 +00:00
|
|
|
options = {
|
|
|
|
system.service.mount = mkOption {
|
|
|
|
type = liminix.lib.types.serviceDefn;
|
|
|
|
};
|
|
|
|
};
|
2025-02-10 21:55:08 +00:00
|
|
|
imports = [
|
|
|
|
../mdevd.nix
|
|
|
|
../uevent-rule
|
|
|
|
];
|
2024-04-17 11:59:13 +00:00
|
|
|
config.system.service.mount =
|
2025-02-10 21:55:08 +00:00
|
|
|
let
|
|
|
|
svc = config.system.callService ./service.nix {
|
|
|
|
partlabel = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
example = "my-usb-stick";
|
2024-04-17 11:59:13 +00:00
|
|
|
};
|
2025-02-10 21:55:08 +00:00
|
|
|
mountpoint = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
example = "/mnt/media";
|
|
|
|
};
|
|
|
|
options = mkOption {
|
|
|
|
type = types.listOf types.str;
|
|
|
|
default = [ ];
|
|
|
|
example = [
|
|
|
|
"noatime"
|
|
|
|
"ro"
|
|
|
|
"sync"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
fstype = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
default = "auto";
|
|
|
|
example = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
svc
|
|
|
|
// {
|
|
|
|
build =
|
|
|
|
args:
|
|
|
|
let
|
|
|
|
args' = args // {
|
|
|
|
dependencies = (args.dependencies or [ ]) ++ [
|
|
|
|
config.services.mdevd
|
|
|
|
config.services.devout
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
svc.build args';
|
2023-09-04 20:17:52 +00:00
|
|
|
};
|
2024-04-17 11:59:13 +00:00
|
|
|
|
2025-02-10 21:55:08 +00:00
|
|
|
config.programs.busybox = {
|
|
|
|
applets = [
|
|
|
|
"blkid"
|
|
|
|
"findfs"
|
|
|
|
];
|
2023-09-04 20:17:52 +00:00
|
|
|
options = {
|
|
|
|
FEATURE_BLKID_TYPE = "y";
|
|
|
|
FEATURE_MOUNT_FLAGS = "y";
|
|
|
|
FEATURE_MOUNT_LABEL = "y";
|
|
|
|
FEATURE_VOLUMEID_EXT = "y";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|