From d5700c543a8ba15fd9f16da2a2ce5d2e7f8b24cc Mon Sep 17 00:00:00 2001 From: Don Harper Date: Tue, 28 Jan 2025 20:54:46 -0600 Subject: [PATCH] depoly-host config | update diskio.nox --- nixos-anywhere/configuration.nix | 28 +----------- nixos-anywhere/disk-config.nix | 75 ++++++++++++++------------------ 2 files changed, 33 insertions(+), 70 deletions(-) diff --git a/nixos-anywhere/configuration.nix b/nixos-anywhere/configuration.nix index 8d43d60..9b6af89 100644 --- a/nixos-anywhere/configuration.nix +++ b/nixos-anywhere/configuration.nix @@ -4,33 +4,7 @@ (modulesPath + "/profiles/qemu-guest.nix") ./disk-config.nix ]; - # boot = { - # kernelPackages = pkgs.linuxPackages_latest; - # kernelParams = [ "consoleblank=60" ]; - # loader = { - # timeout = 10; - # /* systemd-boot = { - # enable = true; - # }; */ - # grub = { - # device = "nodev"; - # efiSupport = true; - # efiInstallAsRemovable = true; - # forceInstall = true; - # }; - # efi = { - # #canTouchEfiVariables = true; - # efiSysMountPoint = "/boot"; - # }; - # }; - # plymouth = { - # enable = true; - # theme = "breeze"; - # }; - # kernel = { - # sysctl = { "vm.swappiness" = 10;}; - # }; - # }; + disko.devices.disk.main.device = "/dev/nvme0n1"; boot = { kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ "consoleblank=60" ]; diff --git a/nixos-anywhere/disk-config.nix b/nixos-anywhere/disk-config.nix index d50a504..115f2cd 100644 --- a/nixos-anywhere/disk-config.nix +++ b/nixos-anywhere/disk-config.nix @@ -1,49 +1,38 @@ -# Example to create a bios compatible gpt partition -{ lib, ... }: { +# USAGE in your configuration.nix. +# Update devices to match your hardware. +# { +# imports = [ ./disko-config.nix ]; +# disko.devices.disk.main.device = "/dev/sda"; +# } +{ 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"; + disk = { + main = { + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR }; - }; - root = { - name = "root"; - size = "100%"; - content = { - type = "lvm_pv"; - vg = "pool"; + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; }; - }; - }; - }; - }; - lvm_vg = { - pool = { - type = "lvm_vg"; - lvs = { - root = { - size = "100%FREE"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - mountOptions = [ "defaults" ]; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; }; }; };