From 3fe6911e2d503e4fd83271a7e88d44c2236cf678 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 26 Feb 2023 10:55:36 -0500 Subject: [PATCH] add separate root nix disko config --- disks/root.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 1 + 2 files changed, 45 insertions(+) create mode 100644 disks/root.nix diff --git a/disks/root.nix b/disks/root.nix new file mode 100644 index 0000000..75c70f3 --- /dev/null +++ b/disks/root.nix @@ -0,0 +1,44 @@ +{ disks, ... }: { + disk = { + boot = { + type = "disk"; + device = builtins.elemAt disks 0; + content = { + type = "table"; + format = "gpt"; + partitions = [ + # Boot partition + { + type = "partition"; + name = "ESP"; + start = "0"; + end = "512MiB"; + fs-type = "fat32"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + extraArgs = [ "-n boot" ]; + }; + } + # Root partition ext4 + { + type = "partition"; + name = "root"; + start = "512MiB"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + extraArgs = [ "-L nixos" ]; + }; + } + ]; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix index c6e45a0..7f851c3 100644 --- a/flake.nix +++ b/flake.nix @@ -153,6 +153,7 @@ }; diskoConfigurations = { + root = import ./disks/root.nix; swan = { ... }: (import ./hosts/swan/disks.nix { }).disko.devices; };