nixos/modules/tank-ssd-luks.nix

29 lines
802 B
Nix
Raw Permalink Normal View History

2024-07-26 19:29:08 +00:00
{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/sda1
# vgcreate sobble-tank-ssd /dev/sda1
# lvcreate -l 100%FREE -n sobble-tank-ssd sobble-tank-ssd
# mkfs.ext4 /dev/sobble-tank-ssd/sobble-tank-ssd
let
m = "${config.networking.hostName}-luks";
n = "${config.networking.hostName}-tank-ssd";
in
{
fileSystems."/tank/ssd" = {
device = "/dev/${m}/${n}";
fsType = "ext4";
};
}