summaryrefslogtreecommitdiff
path: root/hosts/cloud/jeet/disk-config.nix
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2024-07-21 01:09:48 +0700
committerpolwex <polwex@sortug.com>2024-07-21 01:09:48 +0700
commit78907aa98c1af8624a62ca123d088c6c16424f41 (patch)
tree477fe923810522acc211b7514e4931af80f33ed7 /hosts/cloud/jeet/disk-config.nix
init
Diffstat (limited to 'hosts/cloud/jeet/disk-config.nix')
-rw-r--r--hosts/cloud/jeet/disk-config.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/hosts/cloud/jeet/disk-config.nix b/hosts/cloud/jeet/disk-config.nix
new file mode 100644
index 0000000..d1a1d90
--- /dev/null
+++ b/hosts/cloud/jeet/disk-config.nix
@@ -0,0 +1,52 @@
+# Example to create a bios compatible gpt partition
+{ lib, ... }:
+{
+# Disk /dev/sda: 200 GiB, 214748364800 bytes, 419430400 sectors
+# Disk model: QEMU HARDDISK
+# Units: sectors of 1 * 512 = 512 bytes
+# Sector size (logical/physical): 512 bytes / 512 bytes
+# I/O size (minimum/optimal): 512 bytes / 512 bytes
+# Disklabel type: gpt
+# Disk identifier: CED6435C-56EF-4699-BEE9-19280C444BCA
+#
+# Device Start End Sectors Size Type
+# /dev/sda1 2048 4095 2048 1M BIOS boot
+# /dev/sda2 4096 4194303 4190208 2G Linux filesystem
+# /dev/sda3 4194304 419428351 415234048 198G Linux filesystem
+#
+ disko.devices = {
+ disk.disk1 = {
+ device = lib.mkDefault "/dev/sda";
+ type = "disk";
+ content = {
+ type = "gpt";
+ partitions = {
+ boot = {
+ name = "boot";
+ size = "1M";
+ type = "EF02";
+ };
+ esp = {
+ name = "ESP";
+ size = "500M";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ };
+ };
+ root = {
+ name = "root";
+ size = "100%"; # Allocates the remainder of the disk, minus the sizes of the other partitions
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/";
+ };
+ };
+ };
+ };
+ };
+ };
+}