nix-config/nixos/workstation/floki/disks.nix

69 lines
2 KiB
Nix
Raw Permalink Normal View History

2023-10-02 16:36:47 +00:00
{ config, disks ? [ "/dev/nvme0n1" ], ... }:
2023-09-28 20:50:54 +00:00
let
hostname = config.networking.hostName;
in
{
disko.devices = {
disk = {
2023-09-28 15:28:32 +00:00
nvme = {
type = "disk";
2023-10-02 16:36:47 +00:00
device = builtins.elementAt disks 0;
content = {
2023-09-28 15:28:32 +00:00
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
2023-09-28 15:28:32 +00:00
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "defaults" ];
};
2023-09-28 15:28:32 +00:00
};
luks = {
size = "100%";
content = {
type = "luks";
name = "${hostname}_crypt";
extraOpenArgs = [ "--allow-discards" ];
# This file contains the key for interactive login which must be
# the secret without a trailing newline.
passwordFile = config.sops.secrets.luks-password.path;
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
2023-09-28 19:29:12 +00:00
"root" = {
2023-09-28 15:28:32 +00:00
mountpoint = "/";
mountOptions = [ "compress=zstd" ];
};
2023-09-28 19:29:12 +00:00
"home" = {
2023-09-28 15:28:32 +00:00
mountpoint = "/home";
mountOptions = [ "compress=zstd" ];
};
2023-09-28 19:29:12 +00:00
"nix" = {
2023-09-28 15:28:32 +00:00
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" ];
};
2023-09-28 19:29:12 +00:00
"persist" = {
2023-09-28 15:28:32 +00:00
mountpoint = "/persist";
mountOptions = [ "compress=zstd" ];
};
2023-09-30 20:13:17 +00:00
"log" = {
mountpoint = "/var/log";
2023-09-28 15:28:32 +00:00
mountOptions = [ "compress=zstd" "noatime" ];
};
};
};
};
};
};
};
};
};
};
2023-09-28 15:28:32 +00:00
2023-09-28 17:15:12 +00:00
fileSystems."/persist".neededForBoot = true;
}