Kardorf: remove disko config to reuse running ssd

This commit is contained in:
2026-10-02 17:04:26 +02:00
parent 970bc466e3
commit c49fe8e2d9
3 changed files with 39 additions and 89 deletions
-4
View File
@@ -1,13 +1,9 @@
{ {
pwd, pwd,
pkgs, pkgs,
inputs,
... ...
}: { }: {
imports = [ imports = [
inputs.disko.nixosModules.disko
./disko.nix
./hardware-configuration.nix ./hardware-configuration.nix
"${pwd}/features-nixos/global" "${pwd}/features-nixos/global"
-73
View File
@@ -1,73 +0,0 @@
# https://github.com/nix-community/disko/blob/master/example/btrfs-subvolumes.nix
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
start = "1M";
end = "128M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = ["-f"]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
"/rootfs" = {
mountpoint = "/";
};
"/home" = {
mountOptions = ["compress=zstd"];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [
"compress=zstd"
"noatime"
];
mountpoint = "/nix";
};
# Subvolume for the swapfile
"/swap" = {
mountpoint = "/.swapvol";
swap = {
swapfile.size = "20M";
swapfile2.size = "20M";
swapfile2.path = "rel-path";
};
};
};
mountpoint = "/partition-root";
swap = {
swapfile = {
size = "20M";
};
swapfile1 = {
size = "20M";
};
};
};
};
};
};
};
};
};
}
+36 -9
View File
@@ -3,23 +3,50 @@
lib, lib,
modulesPath, modulesPath,
... ...
}: }: {
{
imports = [ imports = [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usbhid" "sd_mod"];
"xhci_pci"
"ahci"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = []; boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"]; boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = []; boot.extraModulePackages = [];
boot.loader.efi.efiSysMountPoint = "/boot/efi";
fileSystems."/" = {
device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = ["subvol=root"];
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = ["subvol=nix"];
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = ["subvol=swap"];
};
fileSystems."/home" = {
device = "/dev/disk/by-uuid/97a9342e-0be0-4193-9a25-03400fc7da94";
fsType = "btrfs";
options = ["subvol=home"];
};
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/7D48-A59C";
fsType = "vfat";
options = ["fmask=0022" "dmask=0022"];
};
swapDevices = [];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
} }