diff --git a/clients/quadraticserver/disko.nix b/clients/quadraticserver/disko.nix new file mode 100644 index 0000000..3b6e713 --- /dev/null +++ b/clients/quadraticserver/disko.nix @@ -0,0 +1,58 @@ +{ + inputs, + lib, +}: { + imports = [inputs.disko.nixosModules.disko]; + disko.devices = { + disk.disk1 = { + device = lib.mkDefault "/dev/sda"; + 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" + ]; + }; + }; + }; + }; + }; + }; +} diff --git a/clients/quadraticserver/hardware-configuration.nix b/clients/quadraticserver/hardware-configuration.nix deleted file mode 100644 index 07d4263..0000000 --- a/clients/quadraticserver/hardware-configuration.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - fileSystems = { - "/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - "/boot" = { - device = "/dev/disk/by-label/boot"; - fsType = "ext4"; - }; - }; - - boot = { - loader.grub = { - enable = true; - device = "/dev/sda"; - }; - initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" "ext4"]; - }; -} diff --git a/flake.lock b/flake.lock index 1b264ed..659343c 100644 --- a/flake.lock +++ b/flake.lock @@ -211,6 +211,26 @@ "type": "github" } }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751854533, + "narHash": "sha256-U/OQFplExOR1jazZY4KkaQkJqOl59xlh21HP9mI79Vc=", + "owner": "nix-community", + "repo": "disko", + "rev": "16b74a1e304197248a1bc663280f2548dbfcae3c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "fenix": { "inputs": { "nixpkgs": [ @@ -839,6 +859,7 @@ "inputs": { "agenix": "agenix", "agenix-cli": "agenix-cli", + "disko": "disko", "firefox-gnome-theme": "firefox-gnome-theme", "grapevine": "grapevine", "home-manager": "home-manager_2", diff --git a/flake.nix b/flake.nix index 8b3fb8a..51ec8df 100755 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,10 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; wrapper-manager.url = "github:viperML/wrapper-manager"; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; firefox-gnome-theme = { url = "github:rafaelmardojai/firefox-gnome-theme"; flake = false;