forked from DGNum/infrastructure
Tom Hubrecht
88d9b8c3e3
Signed-off-by: Tom Hubrecht <tom.hubrecht@dgnum.eu> Acked-by: Ryan Lahfa <ryan.lahfa@dgnum.eu> Acked-by: Maurice Debray <maurice.debray@dgnum.eu> Acked-by: Lubin Bailly <lubin.bailly@dgnum.eu> Acked-by: Jean-Marc Gailis <jean-marc.gailis@dgnum.eu> as the legal authority, at the time of writing, in DGNum. Acked-by: Elias Coppens <elias.coppens@dgnum.eu> as a member, at the time of writing, of the DGNum executive counsel.
86 lines
2.3 KiB
Nix
86 lines
2.3 KiB
Nix
# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
|
|
#
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
_:
|
|
|
|
let
|
|
luksName = "mainfs";
|
|
in
|
|
{
|
|
boot.initrd.luks.devices.${luksName} = {
|
|
keyFile = "/dev/zero";
|
|
keyFileSize = 1;
|
|
};
|
|
disko.devices = {
|
|
disk = {
|
|
vdb = {
|
|
device = "/dev/vdb";
|
|
type = "disk";
|
|
content = {
|
|
type = "gpt";
|
|
partitions = {
|
|
ESP = {
|
|
start = "1MiB";
|
|
label = "ESP";
|
|
end = "512MiB";
|
|
type = "EF00";
|
|
priority = 1;
|
|
content = {
|
|
type = "filesystem";
|
|
format = "vfat";
|
|
mountpoint = "/boot";
|
|
};
|
|
};
|
|
luks = {
|
|
start = "512MiB";
|
|
end = "-4GiB";
|
|
content = rec {
|
|
type = "luks";
|
|
name = luksName;
|
|
extraOpenArgs = [ "--keyfile-size=1" ];
|
|
extraFormatArgs = extraOpenArgs;
|
|
settings.keyFile = "/dev/zero";
|
|
content = {
|
|
type = "btrfs";
|
|
mountpoint = "/mnt/btrfs-root";
|
|
subvolumes = {
|
|
"/rootfs" = {
|
|
mountpoint = "/";
|
|
mountOptions = [ "compress=zstd" ];
|
|
};
|
|
"/home" = {
|
|
mountOptions = [ "compress=zstd" ];
|
|
mountpoint = "/home";
|
|
};
|
|
"/var-log" = {
|
|
mountOptions = [ "compress=zstd" ];
|
|
mountpoint = "/var/log";
|
|
};
|
|
"/nix" = {
|
|
mountOptions = [
|
|
"noatime"
|
|
"compress=zstd"
|
|
];
|
|
mountpoint = "/nix";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
swap = {
|
|
label = "swap";
|
|
start = "-4GiB";
|
|
end = "100%";
|
|
priority = 3;
|
|
content = {
|
|
type = "swap";
|
|
randomEncryption = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|