aboutsummaryrefslogtreecommitdiff
path: root/profiles/disk
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-10-18 10:39:01 -0700
committerFranck Cuny <franck@fcuny.net>2025-10-18 10:39:01 -0700
commit176141410a00dc8ef4376ea9d67b87a0b96ec68c (patch)
tree8bfb9a85e86f0773ea0fc6ec9ecad69e21a26a9d /profiles/disk
parentintroduce a module for baremetal machines (diff)
downloadinfra-176141410a00dc8ef4376ea9d67b87a0b96ec68c.tar.gz
move the disk configuration for rivendell as a profile
Diffstat (limited to 'profiles/disk')
-rw-r--r--profiles/disk/btrfs-on-luks.nix74
1 files changed, 74 insertions, 0 deletions
diff --git a/profiles/disk/btrfs-on-luks.nix b/profiles/disk/btrfs-on-luks.nix
new file mode 100644
index 0000000..3fe57f7
--- /dev/null
+++ b/profiles/disk/btrfs-on-luks.nix
@@ -0,0 +1,74 @@
+{ ... }:
+let
+ btrfsopt = [
+ "compress=zstd"
+ "noatime"
+ ];
+in
+{
+ services.btrfs.autoScrub.enable = true;
+ services.btrfs.autoScrub.fileSystems = [
+ "/nix"
+ "/data"
+ ];
+
+ disko.devices = {
+ disk = {
+ main = {
+ type = "disk";
+ device = "/dev/nvme0n1";
+ content = {
+ type = "gpt";
+ partitions = {
+ ESP = {
+ size = "2G";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ mountOptions = [
+ "fmask=0022"
+ "dmask=0022"
+ ];
+ };
+ };
+ luks = {
+ size = "100%";
+ content = {
+ type = "luks";
+ name = "nixos";
+ passwordFile = "/tmp/pass";
+ settings = {
+ allowDiscards = true;
+ };
+ content = {
+ type = "btrfs";
+ extraArgs = [ "-f" ];
+ subvolumes = {
+ "@root" = {
+ mountpoint = "/";
+ mountOptions = btrfsopt;
+ };
+ "@home" = {
+ mountpoint = "/home";
+ mountOptions = btrfsopt;
+ };
+ "@nix" = {
+ mountpoint = "/nix";
+ mountOptions = btrfsopt;
+ };
+ "@data" = {
+ mountpoint = "/data";
+ mountOptions = btrfsopt;
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}