1
0
Fork 0
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:
Yegor Timoshenko 2017-12-24 23:21:05 +00:00
parent b63e0eb372
commit 5407ba7a52
No known key found for this signature in database
GPG key ID: C34BF9DCC9DF8210
23 changed files with 112 additions and 38 deletions

View file

@ -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";
};
};
}

View file

@ -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" ];
}

View file

@ -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" ];

View file

@ -2,7 +2,8 @@
{
imports = [
../../.
../.
../../../common/pc/laptop/ssd
<nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>
];

View file

@ -0,0 +1,7 @@
{
imports = [
../.
../../common/cpu/intel
../../common/pc/laptop
];
}

2
common/README.org Normal file
View 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.

View file

@ -0,0 +1,3 @@
{
hardware.cpu.amd.updateMicrocode = true;
}

View file

@ -0,0 +1,4 @@
{
hardware.cpu.intel.updateMicrocode = true;
services.xserver.videoDrivers = [ "intel" ];
}

5
common/pc/default.nix Normal file
View file

@ -0,0 +1,5 @@
{ lib, ... }:
{
services.xserver.libinput.enable = lib.mkDefault true;
}

View file

@ -0,0 +1,7 @@
{ lib, ... }:
{
boot.kernel.sysctl = {
"vm.swappiness" = lib.mkDefault 10;
};
}

View file

@ -0,0 +1,11 @@
{ lib, ... }:
{
imports = [ ../. ];
boot.kernel.sysctl = {
"vm.laptop_mode" = lib.mkDefault 5;
};
services.tlp.enable = lib.mkDefault true;
}

View 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
View file

@ -0,0 +1 @@
../ssd

View file

@ -0,0 +1,7 @@
{ lib, ... }:
{
boot.kernel.sysctl = {
"vm.swappiness" = lib.mkDefault 1;
};
}

View file

@ -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;
}

View file

@ -0,0 +1,3 @@
{
imports = [ ../../common/pc/laptop ];
}

View file

@ -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" ];

View file

@ -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;

View file

@ -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" ];
}

View file

@ -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" ];
}

View file

@ -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" ];
}

View file

@ -1,7 +1,10 @@
{ config, lib, pkgs, ... }:
{
imports = [ ../. ];
imports = [
../.
../../../common/cpu/amd
];
boot.extraModprobeConfig = lib.mkDefault ''
options snd_hda_intel enable=0,1

View file

@ -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
];
}