This repository has been archived on 2024-07-10. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles-nix/nix/systems/phaedra/hardware-configuration.nix

48 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2024-03-24 16:15:15 +01:00
{ config, lib, pkgs, modulesPath, ... }:
{
# imports
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
# bootloader
2024-04-03 23:26:46 +02:00
boot.kernelModules = [ "kvm-amd" "amdgpu" ];
2024-03-24 16:15:15 +01:00
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
# filesystems - boot
fileSystems."/boot" = {
device = "/dev/disk/by-label/boot";
fsType = "vfat";
};
# filesystems - root
fileSystems."/" = {
device = "/dev/disk/by-label/root";
fsType = "ext4";
};
2024-03-24 18:27:46 +01:00
# swap
swapDevices = [ {
device = "/swapfile";
size = 4096;
} ];
2024-03-24 16:15:15 +01:00
# networking
networking.useDHCP = lib.mkDefault true;
# hardware
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
2024-03-26 21:02:14 +01:00
# disable nvidia!
systemd.services.removeNvidia = {
unitConfig.ConditionPathExists = "/sys/bus/pci/devices/0000:01:00.0/remove";
2024-03-26 21:02:14 +01:00
wantedBy = [ "multi-user.target" ];
description = "Remove NVIDIA upon boot";
serviceConfig = {
Type = "oneshot";
User = "root";
RemainAfterExit = true;
ExecStart = ''${pkgs.bash}/bin/bash -c "echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove"'';
};
};
2024-03-24 16:15:15 +01:00
}