Commit a67021417e73

Vincent Demeester <vincent@sbr.pm>
2020-05-28 10:52:09
nix: add nixos-hardware and update hardware/*
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent b283bd6
hardware/lenovo-p50.nix
@@ -13,6 +13,7 @@
       intelBusId = "PCI:0:2:0";
     };
   };
+  services.throttled.enable = lib.mkDefault true;
   services = {
     tlp = {
       extraConfig = ''
hardware/thinkpad-t460s.nix
@@ -1,7 +1,11 @@
 { config, pkgs, ... }:
 
 {
-  imports = [ ./thinkpad.nix ];
+  imports = [
+    <nixos-hardware/lenovo/thinkpad/t460s>
+    <nixos-hardware/ssd>
+    ./thinkpad.nix
+  ];
   services = {
     tlp = {
       extraConfig = ''
hardware/thinkpad-x220.nix
@@ -1,7 +1,11 @@
 { config, pkgs, ... }:
 
 {
-  imports = [ ./thinkpad.nix ];
+  imports = [
+    <nixos-hardware/lenovo/thinkpad/x220>
+    <nixos-hardware/ssd>
+    ./thinkpad.nix
+  ];
   boot = {
     kernelParams = [ "i915.enable_psr=1" ];
     extraModprobeConfig = ''
hardware/thinkpad.nix
@@ -1,6 +1,7 @@
 { config, pkgs, ... }:
 
 {
+  imports [ <nixos-hardware/lenovo/thinkpad> ];
   boot = {
     blacklistedKernelModules = [
       # Kernel GPU Savings Options (NOTE i915 chipset only)
@@ -27,30 +28,13 @@
     ];
     loader.efi.canTouchEfiVariables = true;
   };
-  environment.systemPackages = with pkgs; [
-    linuxPackages.tp_smapi
-  ];
   hardware = {
     trackpoint.enable = false;
     cpu.intel.updateMicrocode = true;
-    opengl = {
-      #enable = true;
-      extraPackages = [ pkgs.vaapiIntel ];
-      #driSupport32Bit = true;
-    };
   };
   services = {
     acpid = {
       enable = true;
-      lidEventCommands = ''
-        if grep -q closed /proc/acpi/button/lid/LID/state; then
-          date >> /tmp/i3lock.log
-          DISPLAY=":0.0" XAUTHORITY=/home/fadenb/.Xauthority ${pkgs.i3lock}/bin/i3lock &>> /tmp/i3lock.log
-        fi
-      '';
-    };
-    tlp = {
-      enable = true;
     };
     xserver = {
       synaptics.enable = false;
nix/default.nix
@@ -9,4 +9,6 @@ rec {
   pkgs-unstable = import sources.nixos-unstable;
   nixpkgs = import sources.nixpkgs;
   emacs = import sources.emacs-overlay;
+  gitignore = import sources.gitignore;
+  nixos-hardware = import sources.nixos-hardware;
 }
nix/sources.json
@@ -59,6 +59,18 @@
         "url": "https://github.com/NixOS/nixpkgs-channels/archive/48723f48ab92381f0afd50143f38e45cf3080405.tar.gz",
         "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
     },
+    "nixos-hardware": {
+        "branch": "master",
+        "description": "A collection of NixOS modules covering hardware quirks.",
+        "homepage": "",
+        "owner": "NixOS",
+        "repo": "nixos-hardware",
+        "rev": "2f2c2d9ef5dcc663a504819ad73cc98a4cd26458",
+        "sha256": "159qnxmy720jqhg4zm8di0my1r56ya94m6kd117n8kng8hdsmvgi",
+        "type": "tarball",
+        "url": "https://github.com/NixOS/nixos-hardware/archive/2f2c2d9ef5dcc663a504819ad73cc98a4cd26458.tar.gz",
+        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
+    },
     "nixos-unstable": {
         "branch": "nixos-unstable",
         "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
systems/hokkaido.nix
@@ -10,6 +10,7 @@ in
 {
   imports = [
     (import ../nix).home-manager
+    (import ../nix).nixos-hardware
     ../modules/module-list.nixos.nix
     # hardware
     ../hardware/thinkpad-x220.nix
@@ -68,6 +69,7 @@ in
     "nixos-config=${dummyConfig}"
     "nixpkgs=/run/current-system/nixpkgs"
     "nixpkgs-overlays=/run/current-system/overlays/compat"
+    "nixos-hardware=${nixos-hardware}"
   ];
 
   nixpkgs = {