mirror of
https://github.com/davegallant/nix-config
synced 2025-08-09 18:52:28 +00:00
Merge hardware.nix into configuration.nix
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
{ config
|
{ config
|
||||||
|
, lib
|
||||||
|
, modulesPath
|
||||||
, pkgs
|
, pkgs
|
||||||
, unstable
|
, unstable
|
||||||
, ...
|
, ...
|
||||||
@@ -19,15 +21,87 @@ let
|
|||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./hardware.nix ];
|
|
||||||
|
|
||||||
hardware.opengl.enable = true;
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
nixpkgs.config = {
|
boot = {
|
||||||
allowUnfree = true;
|
extraModulePackages = with config.boot.kernelPackages; [
|
||||||
permittedInsecurePackages = [
|
xpadneo
|
||||||
"nix-2.16.2"
|
|
||||||
];
|
];
|
||||||
|
kernelModules = [ "kvm-amd" ];
|
||||||
|
kernelPackages = pkgs.linuxPackages;
|
||||||
|
|
||||||
|
loader = {
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
efi.efiSysMountPoint = "/boot/efi";
|
||||||
|
grub = {
|
||||||
|
enable = true;
|
||||||
|
device = "nodev";
|
||||||
|
efiSupport = true;
|
||||||
|
enableCryptodisk = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
supportedFilesystems = [ "ntfs" ];
|
||||||
|
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"sd_mod"
|
||||||
|
"usb_storage"
|
||||||
|
"usbhid"
|
||||||
|
"xhci_pci"
|
||||||
|
];
|
||||||
|
luks.devices."root" = {
|
||||||
|
allowDiscards = true;
|
||||||
|
device = "/dev/disk/by-uuid/21cd166c-1528-49a4-b31b-0d408d48aa80";
|
||||||
|
preLVM = true;
|
||||||
|
keyFile = "./keyfile0.bin";
|
||||||
|
};
|
||||||
|
secrets = {
|
||||||
|
"keyfile0.bin" = "/etc/secrets/initrd/keyfile0.bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-uuid/a6723178-6f18-428e-b541-9ac901861125";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/home" = {
|
||||||
|
device = "/dev/disk/by-uuid/e3ab2e1a-bddf-4ae0-b00a-bf954c6c182b";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot/efi" = {
|
||||||
|
device = "/dev/disk/by-uuid/3CFD-D749";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/mnt/synology-2b/media" = {
|
||||||
|
device = "192.168.1.178:/volume1/Media";
|
||||||
|
fsType = "nfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/mnt/synology-2b/backups" = {
|
||||||
|
device = "192.168.1.178:/volume1/Backups";
|
||||||
|
fsType = "nfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{ device = "/dev/disk/by-uuid/5d6d0388-2b15-4ff1-9f0f-391818a76090"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs = {
|
||||||
|
hostPlatform = "x86_64-linux";
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
permittedInsecurePackages = [
|
||||||
|
"nix-2.16.2"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
@@ -46,9 +120,6 @@ in
|
|||||||
|
|
||||||
systemd.services.NetworkManager-wait-online.enable = false;
|
systemd.services.NetworkManager-wait-online.enable = false;
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages;
|
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
autoUpgrade.enable = true;
|
autoUpgrade.enable = true;
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.11";
|
||||||
@@ -73,19 +144,21 @@ in
|
|||||||
|
|
||||||
time.timeZone = "America/Toronto";
|
time.timeZone = "America/Toronto";
|
||||||
|
|
||||||
hardware.pulseaudio.enable = true;
|
hardware = {
|
||||||
|
opengl.enable = true;
|
||||||
|
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
pulseaudio.enable = true;
|
||||||
|
# Vulkan
|
||||||
|
opengl.driSupport = true;
|
||||||
|
opengl.driSupport32Bit = true;
|
||||||
|
# Steam
|
||||||
|
opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||||
|
pulseaudio.support32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Vulkan
|
|
||||||
hardware.opengl.driSupport = true;
|
|
||||||
hardware.opengl.driSupport32Bit = true;
|
|
||||||
|
|
||||||
# Steam
|
|
||||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
|
||||||
hardware.pulseaudio.support32Bit = true;
|
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
enable = true;
|
enable = true;
|
||||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
remotePlay.openFirewall = true;
|
||||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
@@ -1,77 +0,0 @@
|
|||||||
{ config
|
|
||||||
, lib
|
|
||||||
, pkgs
|
|
||||||
, modulesPath
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"ahci"
|
|
||||||
"nvme"
|
|
||||||
"sd_mod"
|
|
||||||
"usb_storage"
|
|
||||||
"usbhid"
|
|
||||||
"xhci_pci"
|
|
||||||
];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
|
||||||
xpadneo
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
||||||
|
|
||||||
boot.loader.grub = {
|
|
||||||
enable = true;
|
|
||||||
device = "nodev";
|
|
||||||
efiSupport = true;
|
|
||||||
enableCryptodisk = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
boot.initrd = {
|
|
||||||
luks.devices."root" = {
|
|
||||||
allowDiscards = true;
|
|
||||||
device = "/dev/disk/by-uuid/21cd166c-1528-49a4-b31b-0d408d48aa80";
|
|
||||||
preLVM = true;
|
|
||||||
keyFile = "./keyfile0.bin";
|
|
||||||
};
|
|
||||||
secrets = {
|
|
||||||
"keyfile0.bin" = "/etc/secrets/initrd/keyfile0.bin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-uuid/a6723178-6f18-428e-b541-9ac901861125";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/home" = {
|
|
||||||
device = "/dev/disk/by-uuid/e3ab2e1a-bddf-4ae0-b00a-bf954c6c182b";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot/efi" = {
|
|
||||||
device = "/dev/disk/by-uuid/3CFD-D749";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/synology-2b/media" = {
|
|
||||||
device = "192.168.1.178:/volume1/Media";
|
|
||||||
fsType = "nfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/mnt/synology-2b/backups" = {
|
|
||||||
device = "192.168.1.178:/volume1/Backups";
|
|
||||||
fsType = "nfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [
|
|
||||||
{ device = "/dev/disk/by-uuid/5d6d0388-2b15-4ff1-9f0f-391818a76090"; }
|
|
||||||
];
|
|
||||||
}
|
|
@@ -74,7 +74,6 @@
|
|||||||
modules =
|
modules =
|
||||||
[
|
[
|
||||||
./machines/hephaestus/configuration.nix
|
./machines/hephaestus/configuration.nix
|
||||||
./machines/hephaestus/hardware.nix
|
|
||||||
./services/netdata/default.nix
|
./services/netdata/default.nix
|
||||||
]
|
]
|
||||||
++ defaultModules;
|
++ defaultModules;
|
||||||
|
Reference in New Issue
Block a user