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
23 changed files with 112 additions and 38 deletions

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