mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-23 03:19:42 +01:00
treewide: abstract away common configs into common/
This commit is contained in:
parent
b63e0eb372
commit
5407ba7a52
23 changed files with 112 additions and 38 deletions
|
@ -1,6 +1,11 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/pc/laptop
|
||||
];
|
||||
|
||||
boot = {
|
||||
initrd.kernelModules = [ "ata_piix" ];
|
||||
kernelParams = [
|
||||
|
@ -8,6 +13,7 @@
|
|||
"acpi=on"
|
||||
"vga=0x317"
|
||||
"video=vesafb:ywrap"
|
||||
|
||||
# Important, to disable Kernel Mode Setting for the graphics card
|
||||
# This will allow backlight regulation
|
||||
"nomodeset"
|
||||
|
@ -17,13 +23,6 @@
|
|||
hardware.opengl.driSupport = false;
|
||||
|
||||
services.xserver = {
|
||||
enable = lib.mkDefault true;
|
||||
defaultDepth = lib.mkDefault 24;
|
||||
videoDrivers = [ "intel" ];
|
||||
autorun = lib.mkDefault true;
|
||||
synaptics = {
|
||||
enable = lib.mkDefault true;
|
||||
dev = "/dev/input/event8";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../../common/pc/laptop ];
|
||||
|
||||
boot = {
|
||||
initrd.kernelModules = [ "pata_via" ];
|
||||
|
||||
|
@ -15,8 +17,5 @@
|
|||
|
||||
hardware.firmware = with pkgs; [ intel2200BGFirmware ];
|
||||
|
||||
services.xserver = {
|
||||
synaptics.enable = lib.mkDefault true;
|
||||
videoDrivers = [ "unichrome" ];
|
||||
};
|
||||
services.xserver.videoDrivers = [ "openchrome" ];
|
||||
}
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../../. ];
|
||||
imports = [
|
||||
../.
|
||||
../../../common/pc/laptop/ssd
|
||||
];
|
||||
|
||||
# TODO: boot loader
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# TODO: drop
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
services.xserver = {
|
||||
libinput.enable = lib.mkDefault true;
|
||||
|
||||
# TODO: we should not enable unfree drivers
|
||||
# when there is an alternative (i.e. nouveau)
|
||||
videoDrivers = [ "nvidia" ];
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
../../.
|
||||
../.
|
||||
../../../common/pc/laptop/ssd
|
||||
<nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>
|
||||
];
|
||||
|
||||
|
|
7
apple/macbook-pro/default.nix
Normal file
7
apple/macbook-pro/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
../.
|
||||
../../common/cpu/intel
|
||||
../../common/pc/laptop
|
||||
];
|
||||
}
|
2
common/README.org
Normal file
2
common/README.org
Normal file
|
@ -0,0 +1,2 @@
|
|||
*NB!* This subtree is subject to change. Please don't import from here directly
|
||||
for now, unless you're OK that things might break at any point in time.
|
3
common/cpu/amd/default.nix
Normal file
3
common/cpu/amd/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
}
|
4
common/cpu/intel/default.nix
Normal file
4
common/cpu/intel/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
}
|
5
common/pc/default.nix
Normal file
5
common/pc/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
services.xserver.libinput.enable = lib.mkDefault true;
|
||||
}
|
7
common/pc/hdd/default.nix
Normal file
7
common/pc/hdd/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
boot.kernel.sysctl = {
|
||||
"vm.swappiness" = lib.mkDefault 10;
|
||||
};
|
||||
}
|
11
common/pc/laptop/default.nix
Normal file
11
common/pc/laptop/default.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ];
|
||||
|
||||
boot.kernel.sysctl = {
|
||||
"vm.laptop_mode" = lib.mkDefault 5;
|
||||
};
|
||||
|
||||
services.tlp.enable = lib.mkDefault true;
|
||||
}
|
8
common/pc/laptop/hdd/default.nix
Normal file
8
common/pc/laptop/hdd/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../../hdd ];
|
||||
|
||||
# Hard disk protection if the laptop falls:
|
||||
services.hdapsd.enable = lib.mkDefault true;
|
||||
}
|
1
common/pc/laptop/ssd
Symbolic link
1
common/pc/laptop/ssd
Symbolic link
|
@ -0,0 +1 @@
|
|||
../ssd
|
7
common/pc/ssd/default.nix
Normal file
7
common/pc/ssd/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
boot.kernel.sysctl = {
|
||||
"vm.swappiness" = lib.mkDefault 1;
|
||||
};
|
||||
}
|
|
@ -1,11 +1,15 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../../../common/pc/laptop
|
||||
];
|
||||
|
||||
# TODO: boot loader
|
||||
boot.loader.systemd-boot.enable = lib.mkDefault true;
|
||||
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||
|
||||
# To just use Intel integrated graphics with Intel's open source driver
|
||||
# hardware.nvidiaOptimus.disable = true;
|
||||
|
||||
services.xserver.libinput.enable = lib.mkDefault true;
|
||||
}
|
||||
|
|
3
lenovo/ideapad/default.nix
Normal file
3
lenovo/ideapad/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
imports = [ ../../common/pc/laptop ];
|
||||
}
|
|
@ -1,7 +1,10 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault true;
|
||||
imports = [
|
||||
../.
|
||||
../../../common/cpu/intel
|
||||
];
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/18356
|
||||
boot.blacklistedKernelModules = [ "nouveau" ];
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{ lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../../common/pc/laptop ];
|
||||
|
||||
hardware.trackpoint.enable = lib.mkDefault true;
|
||||
services.tlp.enable = lib.mkDefault true;
|
||||
services.xserver.libinput.enable = lib.mkDefault true;
|
||||
services.thinkfan.enable = lib.mkDefault true;
|
||||
|
||||
# Fingerprint reader: login and unlock with fingerprint (if you add one with `fprintd-enroll`)
|
||||
# services.fprintd.enable = true;
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ../tp-smapi.nix ];
|
||||
imports = [
|
||||
../.
|
||||
../tp-smapi.nix
|
||||
../../../common/cpu/intel
|
||||
];
|
||||
|
||||
boot = {
|
||||
kernelParams = [
|
||||
|
@ -27,8 +31,4 @@
|
|||
"sierra_net" "cdc_mbim" "cdc_ncm" "btusb"
|
||||
];
|
||||
};
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault true;
|
||||
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ];
|
||||
imports = [
|
||||
../.
|
||||
../../../common/cpu/intel
|
||||
];
|
||||
|
||||
boot = {
|
||||
extraModprobeConfig = lib.mkDefault ''
|
||||
|
@ -9,6 +12,4 @@
|
|||
'';
|
||||
kernelModules = [ "tpm-rng" ];
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ];
|
||||
imports = [
|
||||
../../../common/cpu/intel
|
||||
../.
|
||||
];
|
||||
|
||||
# Use the gummiboot efi boot loader. (From default generated configuration.nix)
|
||||
# TODO: boot loader
|
||||
boot.loader.systemd-boot.enable = lib.mkDefault true;
|
||||
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ];
|
||||
imports = [
|
||||
../.
|
||||
../../../common/cpu/amd
|
||||
];
|
||||
|
||||
boot.extraModprobeConfig = lib.mkDefault ''
|
||||
options snd_hda_intel enable=0,1
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [ ../. ../tp-smapi.nix ];
|
||||
|
||||
# hard disk protection if the laptop falls
|
||||
services.hdapsd.enable = lib.mkDefault true;
|
||||
services.xserver.videoDrivers = [ "intel" ];
|
||||
imports = [
|
||||
../.
|
||||
../../../common/cpu/intel
|
||||
../../../common/pc/laptop/hdd
|
||||
../tp-smapi.nix
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue