summaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorDavid Arnold <david.arnold@iohk.io>2022-11-05 15:17:35 -0500
committerlassulus <lassulus@lassul.us>2022-12-02 08:09:37 +0100
commitefc80d7d89d40f54b76e0efcf83578c6b074906e (patch)
tree28597fea8468438ace7f1b3a1f271a1ddeb6d8d0 /example
parentaca927667acea7bb01dc8e72ee71f6548d9fd41b (diff)
types: init swap
Diffstat (limited to 'example')
-rw-r--r--example/swap.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/example/swap.nix b/example/swap.nix
new file mode 100644
index 0000000..0693caa
--- /dev/null
+++ b/example/swap.nix
@@ -0,0 +1,52 @@
+{ disks ? [ "/dev/vdb" ], ... }: {
+ disk = {
+ vdb = {
+ device = builtins.elemAt disks 0;
+ type = "disk";
+ content = {
+ type = "table";
+ format = "gpt";
+ partitions = [
+ {
+ type = "partition";
+ name = "ESP";
+ start = "1MiB";
+ end = "100MiB";
+ bootable = true;
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ };
+ }
+ {
+ name = "root";
+ type = "partition";
+ start = "100MiB";
+ end = "-1G";
+ part-type = "primary";
+ bootable = true;
+ content = {
+ type = "filesystem";
+ format = "ext4";
+ mountpoint = "/";
+ };
+ }
+ {
+ name = "root";
+ type = "partition";
+ start = "-1G";
+ end = "100%";
+ part-type = "primary";
+ bootable = true;
+ content = {
+ type = "swap";
+ randomEncryption = true;
+ };
+ }
+ ];
+ };
+ };
+ };
+}
+