mirror of
https://github.com/nix-community/disko
synced 2024-09-20 05:51:54 +00:00
filesystem/nodev: mountpoint can be empty
This commit is contained in:
parent
cf705ee161
commit
2785974eef
2 changed files with 9 additions and 8 deletions
|
@ -17,7 +17,8 @@
|
|||
description = "Options to pass to mount";
|
||||
};
|
||||
mountpoint = lib.mkOption {
|
||||
type = optionTypes.absolute-pathname;
|
||||
type = lib.types.nullOr optionTypes.absolute-pathname;
|
||||
default = null;
|
||||
description = "Path to mount the filesystem to";
|
||||
};
|
||||
format = lib.mkOption {
|
||||
|
@ -41,7 +42,7 @@
|
|||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
inherit config options;
|
||||
default = { dev }: {
|
||||
default = { dev }: lib.optionalAttrs (config.mountpoint != null) {
|
||||
fs.${config.mountpoint} = ''
|
||||
if ! findmnt ${dev} "${rootMountPoint}${config.mountpoint}" > /dev/null 2>&1; then
|
||||
mount ${dev} "${rootMountPoint}${config.mountpoint}" \
|
||||
|
@ -55,13 +56,13 @@
|
|||
_config = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
default = dev: [{
|
||||
default = dev: lib.optional (config.mountpoint != null) {
|
||||
fileSystems.${config.mountpoint} = {
|
||||
device = dev;
|
||||
fsType = config.format;
|
||||
options = config.mountOptions;
|
||||
};
|
||||
}];
|
||||
};
|
||||
description = "NixOS configuration";
|
||||
};
|
||||
_pkgs = lib.mkOption {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
description = "Device to use";
|
||||
};
|
||||
mountpoint = lib.mkOption {
|
||||
type = optionTypes.absolute-pathname;
|
||||
type = lib.types.nullOr optionTypes.absolute-pathname;
|
||||
default = config._module.args.name;
|
||||
description = "Location to mount the file system at";
|
||||
};
|
||||
|
@ -39,7 +39,7 @@
|
|||
};
|
||||
_mount = diskoLib.mkMountOption {
|
||||
inherit config options;
|
||||
default = _: {
|
||||
default = _: lib.optionalAttrs (config.mountpoint != null) {
|
||||
fs.${config.mountpoint} = ''
|
||||
if ! findmnt ${config.fsType} "${rootMountPoint}${config.mountpoint}" > /dev/null 2>&1; then
|
||||
mount -t ${config.fsType} ${config.device} "${rootMountPoint}${config.mountpoint}" \
|
||||
|
@ -52,13 +52,13 @@
|
|||
_config = lib.mkOption {
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
default = [{
|
||||
default = lib.optional (config.mountpoint != null) {
|
||||
fileSystems.${config.mountpoint} = {
|
||||
device = config.device;
|
||||
fsType = config.fsType;
|
||||
options = config.mountOptions;
|
||||
};
|
||||
}];
|
||||
};
|
||||
description = "NixOS configuration";
|
||||
};
|
||||
_pkgs = lib.mkOption {
|
||||
|
|
Loading…
Reference in a new issue