From 9f233d2d1dced44e76b71571cd700013312eaf1e Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Sat, 14 Sep 2024 22:36:15 +0200 Subject: [PATCH] feat: re-enable disko on ksios --- flake.nix | 3 ++- hosts/ksios/configuration.nix | 1 + hosts/ksios/disk-config.nix | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 hosts/ksios/disk-config.nix diff --git a/flake.nix b/flake.nix index 20c408b..525c9b1 100644 --- a/flake.nix +++ b/flake.nix @@ -112,9 +112,10 @@ inherit nix-colors; }; modules = [ + disko.nixosModules.disko inputs.mailserver.nixosModules.default - ./hosts/ksios/configuration.nix inputs.home-manager.nixosModules.default + ./hosts/ksios/configuration.nix ]; }; }; diff --git a/hosts/ksios/configuration.nix b/hosts/ksios/configuration.nix index 5a7ddcf..c684765 100644 --- a/hosts/ksios/configuration.nix +++ b/hosts/ksios/configuration.nix @@ -8,6 +8,7 @@ [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./disk-config.nix inputs.home-manager.nixosModules.default (modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/profiles/qemu-guest.nix") diff --git a/hosts/ksios/disk-config.nix b/hosts/ksios/disk-config.nix new file mode 100644 index 0000000..a2870b0 --- /dev/null +++ b/hosts/ksios/disk-config.nix @@ -0,0 +1,41 @@ +# Example to create a bios compatible gpt partition +{ lib, ... }: +{ + disko.devices = { + disk.disk1 = { + device = lib.mkDefault "/dev/nvme0n1"; + 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 = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + mountOptions = [ + "defaults" + ]; + }; + }; + }; + }; + }; + }; +}