This commit is contained in:
parent
cc3d5090ac
commit
e02d86dffd
21 changed files with 270 additions and 241 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
@ -40,30 +40,20 @@ let
|
|||
'';
|
||||
in
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
options.dotfiles.hardware.amd-desktop.enable =
|
||||
lib.mkEnableOption "Enable AMD Desktop Setup Support";
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"virtio-pci"
|
||||
"igb"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [
|
||||
"kvm-amd"
|
||||
"uhid"
|
||||
];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.kernelParams = [ "acpi_enforce_resources=lax" ];
|
||||
config = lib.mkIf config.dotfiles.hardware.amd-desktop.enable {
|
||||
|
||||
environment.systemPackages = [ thunderboltDockRestart ];
|
||||
dotfiles.hardware.ecc-memory.enable = true;
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
nix.settings.max-jobs = lib.mkDefault 24;
|
||||
boot.kernelParams = [ "acpi_enforce_resources=lax" ];
|
||||
|
||||
powerManagement.powerUpCommands = "${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
|
||||
# The Thunderbolt card in combination with a Thinkpad Dock has power issues after suspend and boot.
|
||||
# These scripts help with some cases.
|
||||
environment.systemPackages = [ thunderboltDockRestart ];
|
||||
powerManagement.powerUpCommands = "${forceThunderboltOnScript}/bin/force-thunderbolt-power-on";
|
||||
|
||||
nix.settings.max-jobs = lib.mkDefault 24;
|
||||
};
|
||||
}
|
|
@ -1,7 +1,75 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ inputs.nixos-facter-modules.nixosModules.facter ];
|
||||
|
||||
imports = [
|
||||
inputs.nixos-facter-modules.nixosModules.facter
|
||||
./ecc-memory.nix
|
||||
./amd-desktop.nix
|
||||
./modem-em120r-gl.nix
|
||||
./thinkpad-x1-gen9.nix
|
||||
./printing.nix
|
||||
];
|
||||
|
||||
# Enable touchpad support.
|
||||
services.libinput.enable = true;
|
||||
|
||||
services.fwupd.enable = true;
|
||||
|
||||
services.blueman.enable = true;
|
||||
|
||||
# Enable sound.
|
||||
nixpkgs.config.pulseaudio = true;
|
||||
|
||||
services.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
security.rtkit.enable = true;
|
||||
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
intel-compute-runtime
|
||||
intel-media-driver
|
||||
libvdpau-va-gl
|
||||
vaapiVdpau
|
||||
];
|
||||
|
||||
};
|
||||
acpilight.enable = true;
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
package = pkgs.bluez;
|
||||
};
|
||||
logitech.wireless = {
|
||||
enable = true;
|
||||
enableGraphical = true;
|
||||
};
|
||||
};
|
||||
|
||||
services.hardware.bolt.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
services.upower.enable = config.powerManagement.enable;
|
||||
|
||||
programs.light.enable = true;
|
||||
programs.adb.enable = true;
|
||||
|
||||
services.fprintd = lib.mkIf config.facter.detected.fingerprint.enable {
|
||||
enable = true;
|
||||
package = pkgs.fprintd-tod;
|
||||
tod = {
|
||||
enable = true;
|
||||
driver = pkgs.libfprint-2-tod1-vfs0090;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
hardware.rasdaemon = {
|
||||
enable = true;
|
||||
options.dotfiles.hardware.ecc-memory.enable = lib.mkEnableOption "Enable ECC Memory Support";
|
||||
|
||||
config = lib.mkIf config.dotfiles.hardware.ecc-memory.enable {
|
||||
|
||||
hardware.rasdaemon.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
24
nixos-modules/hardware/modem-em120r-gl.nix
Normal file
24
nixos-modules/hardware/modem-em120r-gl.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.dotfiles.hardware.modem-em120r-gl.enable = lib.mkEnableOption "Enable EM120R GL Support";
|
||||
|
||||
config = lib.mkIf config.dotfiles.hardware.modem-em120r-gl.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
modemmanager
|
||||
libmbim
|
||||
];
|
||||
|
||||
environment.etc."ModemManager/fcc-unlock.d/1eac:1001".source =
|
||||
let
|
||||
package = inputs.fcc-unlock.packages.${config.nixpkgs.hostPlatform.system}.default;
|
||||
in
|
||||
"${package}/bin/fcc-unlock";
|
||||
};
|
||||
}
|
18
nixos-modules/hardware/printing.nix
Normal file
18
nixos-modules/hardware/printing.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# TODO: Revive when needed.
|
||||
#services.printing = {
|
||||
# enable = true;
|
||||
# drivers = with pkgs; [
|
||||
# gutenprint
|
||||
# hplip
|
||||
# splix
|
||||
# ];
|
||||
#};
|
||||
|
||||
#services.system-config-printer.enable = true;
|
||||
#programs.system-config-printer.enable = true;
|
||||
}
|
|
@ -1,42 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
hardwareModules,
|
||||
pkgFccUnlock,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
imports = with hardwareModules; [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
hardwareModules.lenovo-thinkpad-x1-9th-gen
|
||||
];
|
||||
options.dotfiles.hardware.thinkpad-x1-gen9.enable =
|
||||
lib.mkEnableOption "Enable ThinkPad X1 Gen9 Support";
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
config = lib.mkIf config.dotfiles.hardware.thinkpad-x1-gen9.enable {
|
||||
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ]; # TODO: This should be moved to defaults
|
||||
dotfiles.hardware.modem-em120r-gl.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
modemmanager
|
||||
libmbim
|
||||
];
|
||||
|
||||
environment.etc."ModemManager/fcc-unlock.d/1eac:1001" = {
|
||||
source = "${pkgFccUnlock}/bin/fcc-unlock";
|
||||
# CPU Configuration
|
||||
services.throttled.enable = true;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
};
|
||||
|
||||
# CPU Configuration
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
services.throttled.enable = true;
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue