diff --git a/flake.nix b/flake.nix index 131919f..bcd520d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,15 @@ description = "System configuration for NixOS"; inputs = { + # General inputs nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; + impermanence.url = "github:nix-community/impermanence"; + + # For Minecraft VM nix-minecraft.url = "github:Jan-Bulthuis/nix-minecraft"; nix-minecraft.inputs.nixpkgs.follows = "nixpkgs"; nix-modpack.url = "github:Jan-Bulthuis/nix-modpack"; diff --git a/profiles/disko/vm.nix b/profiles/disko/vm.nix new file mode 100644 index 0000000..58bfe01 --- /dev/null +++ b/profiles/disko/vm.nix @@ -0,0 +1,48 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "tank"; + }; + }; + }; + }; + }; + }; + zpool = { + tank = { + type = "zpool"; + rootFsOptions = { + compression = "zstd"; + }; + mountpoint = "none"; + postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; + + datasets = { + root = { + type = "zfs_fs"; + mountpoint = "/"; + }; + }; + }; + }; + }; +}