summaryrefslogtreecommitdiff
path: root/modules/hosts/luna/disko.nix
diff options
context:
space:
mode:
authorDominik Kaiser2026-06-12 18:10:16 +0200
committerDominik Kaiser2026-06-12 18:10:16 +0200
commit2df5bc584899f427495cc20927170de2a2c84b32 (patch)
treed1a87bcd3c17d605e3f25e4bb8d7a6ec060c73ba /modules/hosts/luna/disko.nix
downloadnixos-2df5bc584899f427495cc20927170de2a2c84b32.tar.gz
nixos-2df5bc584899f427495cc20927170de2a2c84b32.zip
Setup luna
Diffstat (limited to 'modules/hosts/luna/disko.nix')
-rw-r--r--modules/hosts/luna/disko.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/modules/hosts/luna/disko.nix b/modules/hosts/luna/disko.nix
new file mode 100644
index 0000000..f0fcc13
--- /dev/null
+++ b/modules/hosts/luna/disko.nix
@@ -0,0 +1,73 @@
+{ self, inputs, ...}: {
+
+flake.nixosModules.lunaDisko = { pkgs, lib, ... }: {
+ fileSystems."/nix".neededForBoot = true;
+ fileSystems."/persistent".neededForBoot = true;
+ disko.devices.nodev = {
+ "/" = {
+ fsType = "tmpfs";
+ mountOptions = [
+ "size=50%"
+ "mode=755"
+ ];
+ };
+ };
+
+ disko.devices.disk.main = {
+ device = "/dev/nvme0n1";
+ type = "disk";
+
+ content.type = "gpt";
+
+ content.partitions.boot = {
+ name = "boot";
+ size = "1M";
+ type = "EF02";
+ };
+
+ content.partitions.esp = {
+ name = "ESP";
+ size = "1G";
+ type = "EF00";
+
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ };
+ };
+
+ content.partitions.swap = {
+ size = "8G";
+
+ content = {
+ type = "swap";
+ resumeDevice = true;
+ };
+ };
+
+ content.partitions.root = {
+ name = "root";
+ size = "100%";
+
+ content = {
+ type = "btrfs";
+ extraArgs = ["-f"];
+
+ subvolumes = {
+ "/persistent" = {
+ mountOptions = ["subvol=persistent" "noatime"];
+ mountpoint = "/persistent";
+ };
+
+ "/nix" = {
+ mountOptions = ["subvol=nix" "noatime"];
+ mountpoint = "/nix";
+ };
+ };
+ };
+ };
+ };
+};
+
+}