refractor hardware configuration

This commit is contained in:
Mohamed Chrayed 2024-08-10 12:02:25 +02:00
parent 1edfeccebd
commit b1c898d13c
7 changed files with 30 additions and 47 deletions

View File

@ -17,7 +17,7 @@
./system/set-controller.nix
./system/set-desktop.nix
./system/set-dev.nix
./system/set-hardware-configuration.nix
./system/set-filesystems.nix
./system/set-hardware.nix
./system/set-locale.nix
./system/set-networking.nix

View File

@ -1,10 +1,14 @@
{ ... }:
{
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.initrd.verbose = false;
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.plymouth.enable = true;
boot.plymouth.theme = "bgrt";
boot.initrd.verbose = false;
boot.consoleLogLevel = 0;
boot.kernelParams = [ "quiet" "udev.log_level=0" "amd_pstate=guided" ];
boot.extraModprobeConfig = ''

View File

@ -0,0 +1,18 @@
{ ... }:
{
fileSystems."/" =
{ device = "/dev/disk/by-partlabel/root";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-partlabel/EFI";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ {
device = "/var/lib/swapfile";
size = 16*1024;
}];
}

View File

@ -1,42 +0,0 @@
# 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, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-partlabel/root";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-partlabel/EFI";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ {
device = "/var/lib/swapfile";
size = 16*1024;
}];
# 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.enp11s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp10s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,5 +1,6 @@
{ pkgs, ... }:
{ lib, config,... }:
{
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
services.fwupd.enable = true;
services.printing.enable = true;
hardware.bluetooth.enable = true;

View File

@ -1,5 +1,6 @@
{ ... }:
{ lib, ... }:
{
networking.useDHCP = lib.mkDefault true;
networking.hostName = "computer-mo";
networking.networkmanager.enable = true;
}

View File

@ -1,5 +1,6 @@
{ ... }:
{ lib, ... }:
{
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}