From 39eb0b807403c7745c2edc6024e0e713155662bc Mon Sep 17 00:00:00 2001 From: tzlil Date: Sun, 12 Mar 2023 16:29:17 +0200 Subject: bunch of stuff --- hosts/vm/cfg.nix | 1 + hosts/vm/disko.nix | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 hosts/vm/disko.nix (limited to 'hosts/vm') diff --git a/hosts/vm/cfg.nix b/hosts/vm/cfg.nix index 9fb84ee..5ceba52 100644 --- a/hosts/vm/cfg.nix +++ b/hosts/vm/cfg.nix @@ -16,6 +16,7 @@ # ../../mixins/hyprland.nix ../../mixins/sway.nix (modulesPath + "/profiles/qemu-guest.nix") + (modulesPath + "/virtualisation/qemu-vm.nix") ]; config = { diff --git a/hosts/vm/disko.nix b/hosts/vm/disko.nix new file mode 100644 index 0000000..6affd39 --- /dev/null +++ b/hosts/vm/disko.nix @@ -0,0 +1,52 @@ +{inputs, ...}: let + device = "/dev/vda"; +in { + imports = [ + inputs.disko.nixosModules.disko + ]; + + disko.devices = { + disk.${baseNameOf device} = { + inherit device; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "ESP"; + start = "1MiB"; + end = "512MiB"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "nix"; + type = "partition"; + start = "512M"; + end = "100%"; + part-type = "primary"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/nix"; + }; + } + ]; + }; + }; + nodev."/" = { + fsType = "tmpfs"; + mountOptions = [ + "size=3G" + "defaults" + "mode=755" + ]; + }; + }; +} -- cgit 1.4.1