nixos/modules/tank-nvme.nix
2024-07-31 00:18:30 -05:00

27 lines
777 B
Nix

{config,...}:
# to use this, you must have created the lvm devices for the host
# in this example, my hostname is sobble and the disk is /dev/sda:
#
# fdisk /dev/sda
# n # new partition, assuming this is a blank disk.
# # (enter for all defauls until you're back at the prompt)
# t # set type
# 1 # first partition, again assuming this was a blank disk
# 8e # lvm
# w # write and quit
#
# pvcreate /dev/nvme5n7p9
# vgcreate sobble-tank-nvme /dev/nvme5n7p9
# lvcreate -l 100%FREE -n sobble-tank-nvme sobble-tank-nvme
# mkfs.ext4 /dev/sobble-tank-nvme/sobble-tank-nvme
let n = "${config.networking.hostName}-tank-nvme";
in
{
fileSystems."/tank/nvme" = {
device = "/dev/${n}/${n}";
fsType = "ext4";
};
}