nixos-servers/modules/custom/data-disk.nix
2023-11-24 13:52:51 +01:00

19 lines
405 B
Nix

{ lib, config, ... }:
let cfg = config.custom.dataDisk;
in {
options = {
custom = {
dataDisk.enable = lib.mkOption {
default = false;
type = lib.types.bool;
description = ''
Whether to automatically mount /dev/sda1 on /mnt/data
'';
};
};
};
config = lib.mkIf cfg.enable {
fileSystems."/mnt/data" = { device = "/dev/sda1"; };
};
}