]> git.dkaiser.de - config/nixos.git/commitdiff
Fix some errors on antares config
authorDominik Kaiser <dominik-kaiser@mailbox.org>
Sat, 15 Feb 2025 20:03:46 +0000 (21:03 +0100)
committerDominik Kaiser <dominik-kaiser@mailbox.org>
Sat, 15 Feb 2025 20:03:46 +0000 (21:03 +0100)
flake.lock
flake.nix
hosts/antares/disk-config.nix [new file with mode: 0644]

index 8c1a41a0f49340266c3694e41440872281f358fc..420128eec2fd6240046b2e70e796dd599419afba 100644 (file)
@@ -1,5 +1,25 @@
 {
   "nodes": {
+    "disko": {
+      "inputs": {
+        "nixpkgs": [
+          "nixpkgs"
+        ]
+      },
+      "locked": {
+        "lastModified": 1739634831,
+        "narHash": "sha256-xFnU+uUl48Icas2wPQ+ZzlL2O3n8f6J2LrzNK9f2nng=",
+        "owner": "nix-community",
+        "repo": "disko",
+        "rev": "fa5746ecea1772cf59b3f34c5816ab3531478142",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-community",
+        "repo": "disko",
+        "type": "github"
+      }
+    },
     "home-manager": {
       "inputs": {
         "nixpkgs": [
@@ -39,6 +59,7 @@
     },
     "root": {
       "inputs": {
+        "disko": "disko",
         "home-manager": "home-manager",
         "nixpkgs": "nixpkgs"
       }
index b6feaf56f887e37fe90857703f37cc405f88f716..bb2e35c2dd7cc02b67f11bae6294b95787245cd6 100644 (file)
--- a/flake.nix
+++ b/flake.nix
@@ -18,6 +18,7 @@
     self,
     nixpkgs,
     home-manager,
+    disko,
     ...
   } @ inputs: let
     inherit (self) outputs;
diff --git a/hosts/antares/disk-config.nix b/hosts/antares/disk-config.nix
new file mode 100644 (file)
index 0000000..88e17e5
--- /dev/null
@@ -0,0 +1,56 @@
+# Example to create a bios compatible gpt partition
+{ lib, ... }:
+{
+  disko.devices = {
+    disk.disk1 = {
+      device = lib.mkDefault "/dev/vda";
+      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%";
+            content = {
+              type = "lvm_pv";
+              vg = "pool";
+            };
+          };
+        };
+      };
+    };
+    lvm_vg = {
+      pool = {
+        type = "lvm_vg";
+        lvs = {
+          root = {
+            size = "100%FREE";
+            content = {
+              type = "filesystem";
+              format = "ext4";
+              mountpoint = "/";
+              mountOptions = [
+                "defaults"
+              ];
+            };
+          };
+        };
+      };
+    };
+  };
+}