baremetal install, cleaned up code

This commit is contained in:
2023-04-30 15:23:40 -06:00
parent 194ebe7d01
commit 92a2b959d7
9 changed files with 729 additions and 1337 deletions

View File

@@ -1,55 +1,134 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
plymouth = { enable = true; };
loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
enable = true;
version = 2;
device = "nodev";
efiSupport = true;
enableCryptodisk = true;
};
};
initrd.luks.devices = {
root = {
device = "/dev/disk/by-uuid/2dc90b31-2a37-46a9-92e5-a648cd74a860";
preLVM = true;
};
root2 = {
device = "/dev/disk/by-uuid/b0414af9-bca9-44d0-9fe3-a6e4f0b1c28c";
preLVM = true;
};
disk1 = {
device = "/dev/disk/by-uuid/a9b0f346-7e38-40a6-baf6-3ad80cafc842";
preLVM = true;
};
disk2 = {
device = "/dev/disk/by-uuid/0ed12b83-4c56-4ba8-b4ea-75a9e927d771";
preLVM = true;
};
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
initrd = {
availableKernelModules =
[ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ ];
};
};
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
fileSystems."/" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [
"subvol=nix"
"ssd"
"compress=zstd:3"
"x-systemd.device-timeout=0"
"space_cache=v2"
"commit=120"
"datacow"
];
};
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/home" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [
"subvol=home"
"ssd"
"compress=zstd:3"
"x-systemd.device-timeout=0"
"space_cache=v2"
"commit=120"
"datacow"
];
};
fileSystems."/mnt/disk1" = {
device = "/dev/mapper/disk1";
fsType = "btrfs";
options = [ "compress=zstd:3" "space_cache=v2" "commit=120" "datacow" ];
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/3061620b-35eb-4b5f-b4e8-0e208404a749";
fsType = "btrfs";
options = [ "subvol=@" "compress=zstd:3" "ssd" "space_cache=v2" "commit=120" ];
};
fileSystems."/mnt/disk2" = {
device = "/dev/mapper/disk2";
fsType = "btrfs";
options = [ "compress=zstd:3" "space_cache=v2" "commit=120" "datacow" ];
};
fileSystems."/mnt/parity" = {
device = "/dev/disk/by-uuid/643b727a-555d-425c-943c-62f5b93631c9";
fsType = "xfs";
options = [ "defaults" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/3061620b-35eb-4b5f-b4e8-0e208404a749";
fsType = "btrfs";
options = [ "subvol=@home" "compress=zstd:3" "ssd" "space_cache=v2" "commit=120" ];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/eb5b3650-f709-46a1-8d63-7f05ffd5e6d4";
fsType = "ext4";
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/3061620b-35eb-4b5f-b4e8-0e208404a749";
fsType = "btrfs";
options = [ "subvol=@nix" "compress=zstd:3" "ssd" "space_cache=v2" "commit=120" "noatime" ];
};
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/78B5-4717";
fsType = "vfat";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/FF77-8AB3";
fsType = "vfat";
};
fileSystems."/swap" =
{ device = "/dev/disk/by-uuid/3061620b-35eb-4b5f-b4e8-0e208404a749";
fsType = "btrfs";
options = [ "subvol=@swap" "noatime" ];
};
swapDevices = [ { device = "/swap/swapfile"; } ];
swapDevices =
[{ device = "/dev/disk/by-uuid/7b9f7369-d24d-4b54-95a6-853626eb45a7"; }];
# 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.enp1s0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware = {
cpu.intel.updateMicrocode = lib.mkDefault true;
bluetooth.enable = true;
# huion driver
opentabletdriver = {
enable = true;
daemon.enable = true;
};
# nvidia driver
nvidia.modesetting.enable = true;
opengl = {
enable = true;
driSupport32Bit = true;
};
};
# hardware.cpu.intel.updateMicrocode =
# lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}