1
0
Fork 0

Yank out Disko config. Can't get it to detect its own root filesystem

This commit is contained in:
Aires 2024-07-01 12:47:35 -04:00
parent b2bf8fc419
commit c3589b3a73
6 changed files with 87 additions and 44 deletions

View file

@ -158,11 +158,11 @@
]
},
"locked": {
"lastModified": 1719677234,
"narHash": "sha256-qO9WZsj/0E6zcK4Ht1y/iJ8XfwbBzq7xdqhBh44OP/M=",
"lastModified": 1719827439,
"narHash": "sha256-tneHOIv1lEavZ0vQ+rgz67LPNCgOZVByYki3OkSshFU=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "36317d4d38887f7629876b0e43c8d9593c5cc48d",
"rev": "59ce796b2563e19821361abbe2067c3bb4143a7d",
"type": "github"
},
"original": {
@ -316,11 +316,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1719506693,
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=",
"lastModified": 1719690277,
"narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a",
"rev": "2741b4b489b55df32afac57bc4bfd220e8bf617e",
"type": "github"
},
"original": {

View file

@ -42,16 +42,6 @@ in
tpm2.enable = true;
};
# Use Disko to partition and format disks
disko = {
enable = true;
primaryDiskID = "";
swapFile = {
enable = true;
size = "16G";
};
};
# Change the default text editor. Options are "emacs", "nano", or "vim".
editor = "nano";

View file

@ -1 +1,74 @@
builtins.abort "Need to generate hardware-configuration.nix for Dimaga"
{
config,
lib,
pkgs,
modulesPath,
...
}:
let
primaryDisk = "/dev/disk/by-id/";
luksDevice = "";
standardMountOpts = [
"compress=zstd"
"noatime"
];
in
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [
"xhci_pci"
"nvme"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
luks.devices."luks-${luksDevice}" = {
device = "/dev/disk/by-uuid/${luksDevice}";
crypttabExtraOpts = [ "tpm2-device=auto" ]; # Enable TPM auto-unlocking
};
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems = {
"/" = {
device = primaryDisk;
fsType = "btrfs";
options = [ "subvol=@" ] ++ standardMountOpts;
};
"/home" = {
device = primaryDisk;
fsType = "btrfs";
options = [ "subvol=@home" ] ++ standardMountOpts;
};
"/nix" = {
device = primaryDisk;
fsType = "btrfs";
options = [ "subvol=@nix" ] ++ standardMountOpts;
};
"/swap" = {
device = primaryDisk;
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
"/boot" = {
device = "/dev/disk/by-uuid/AFCB-D880";
fsType = "vfat";
};
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -40,16 +40,6 @@ in
tpm2.enable = true;
};
# Use Disko to partition and format disks
disko = {
enable = false;
primaryDiskID = "nvme-eui.002538da11443b4d";
swapFile = {
enable = true;
size = "16G";
};
};
# Change the default text editor. Options are "emacs", "nano", or "vim".
editor = "nano";

View file

@ -53,16 +53,6 @@ in
tpm2.enable = true;
};
# Partition disks using Disko
disko = {
enable = false;
primaryDiskID = "nvme-eui.ace42e0025b66c912ee4ac0000000001";
swapFile = {
enable = true;
size = "16G";
};
};
# Change the default text editor. Options are "emacs", "nano", or "vim".
editor = "nano";

View file

@ -29,19 +29,19 @@ in
config = lib.mkIf cfg.enable {
# Check for blank values
assertions = [
{
assertion = (cfg.primaryDiskID != "");
message = "aux.system.disko.primaryDiskID is not set. Please enter a valid disk ID.";
}
];
assertions = [
{
assertion = (cfg.primaryDiskID != "");
message = "aux.system.disko.primaryDiskID is not set. Please enter a valid disk ID.";
}
];
# Disk management
disko.enableConfig = true;
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/disk/by-id/${cfg.primaryDisk.id}";
device = "/dev/disk/by-id/${cfg.primaryDiskID}";
content = {
type = "gpt";
partitions = {