use hostId for luks disks

Signed-off-by: unexplrd <unexplrd@linerds.us>
This commit is contained in:
2025-06-21 16:28:16 +03:00
parent d135a13a5a
commit 7d0e089e3f
10 changed files with 62 additions and 21 deletions

View File

@ -1,4 +1,9 @@
{inputs, ...}: let
{
config,
inputs,
...
}: let
inherit (config.networking) hostId;
disk-main = "/dev/disk/by-id/nvme-INTEL_SSDPEKKF256G8L_BTHH81460QC2256B";
disk-second = "/dev/disk/by-id/nvme-WDC_PC_SN730_SDBPNTY-1T00-1101_21114D802446";
in {
@ -11,6 +16,6 @@ in {
mountOptions = ["rw" "nosuid" "nodev"];
};
};
disko.devices.disk.main = import ./disk-main.nix {inherit disk-main;};
disko.devices.disk.second = import ./disk-second.nix {inherit disk-second;};
disko.devices.disk.main = import ./disk-main.nix {inherit disk-main hostId;};
disko.devices.disk.second = import ./disk-second.nix {inherit disk-second hostId;};
}

View File

@ -1,4 +1,7 @@
{disk-main}: {
{
disk-main,
hostId,
}: {
type = "disk";
device = disk-main;
content = {
@ -25,7 +28,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-main";
name = "luks-" + hostId;
initrdUnlock = true;
settings.allowDiscards = true;
content = {

View File

@ -1,4 +1,7 @@
{disk-second}: {
{
disk-second,
hostId,
}: {
type = "disk";
device = disk-second;
content = {
@ -8,7 +11,7 @@
size = "100%";
content = {
type = "luks";
name = "luks-second";
name = "luks-${hostId}-second";
initrdUnlock = true;
settings.allowDiscards = true;
content = {