summaryrefslogtreecommitdiff
path: root/disko.nix
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-10-09 18:19:57 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-10-09 18:19:57 +0530
commitf4301e2194ede90f6fe3ab70be5e598a6eb5f2e4 (patch)
tree29490e04e9400ca16be6ee2d16bb4c05a65d7feb /disko.nix
parent55bc8a949a13e0909d05ee1ecaeae0ab3035f37b (diff)
(impermanence): Initial try.
Diffstat (limited to 'disko.nix')
-rw-r--r--disko.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/disko.nix b/disko.nix
new file mode 100644
index 0000000..f8d74a1
--- /dev/null
+++ b/disko.nix
@@ -0,0 +1,81 @@
+{
+ device ? throw "Set this to your disk device, e.g. /dev/sda",
+ ...
+}: {
+ disko.devices = {
+ disk.main = {
+ inherit device;
+ 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";
+ };
+ };
+ swap = {
+ size = "4G";
+ content = {
+ type = "swap";
+ resumeDevice = true;
+ };
+ };
+ root = {
+ name = "root";
+ size = "100%";
+ content = {
+ type = "lvm_pv";
+ vg = "root_vg";
+ };
+ };
+ };
+ };
+ };
+ lvm_vg = {
+ root_vg = {
+ type = "lvm_vg";
+ lvs = {
+ root = {
+ size = "100%FREE";
+ content = {
+ type = "btrfs";
+ extraArgs = ["-f"];
+
+ subvolumes = {
+ "/root" = {
+ mountpoint = "/";
+ };
+
+ "/persist" = {
+ mountOptions = ["subvol=persist" "noatime"];
+ mountpoint = "/persist";
+ };
+
+ "/nix" = {
+ mountOptions = ["subvol=nix" "noatime"];
+ mountpoint = "/nix";
+ };
+
+ "/home" = {
+ mountOptions = ["subvol=home" "noatime"];
+ mountpoint = "/home";
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}