From 3c9f432a7146115b2d0b6200c4c19101c29caaba Mon Sep 17 00:00:00 2001 From: Yegor Timoshenko Date: Fri, 22 Dec 2017 20:17:00 +0300 Subject: [PATCH] treewide: modules -> profiles, separate dirs, list in README (#29) Enforce proper naming: all paths are lowercase and hyphen-separated, if there's a line of models (aspire, macbook-pro, thinkpad) it becomes a subdirectory. Documentation for profiles is moved to README files in respective directories. Add an Org mode table that lists all available profiles and their paths. Instead of fetching repo locally, use a Nix channel. Making hardware profiles read-only should improve quality and amount of participation long-term. --- README.md | 24 ---------- README.org | 47 +++++++++++++++++++ acer/{4810t.wiki => aspire/4810t/README.wiki} | 0 acer/{4810t.nix => aspire/4810t/default.nix} | 0 acer/{c720.wiki => c720/README.wiki} | 0 acer/{c720.nix => c720/default.nix} | 0 airis/{n990.nix => n990/default.nix} | 0 .../10-1/README.wiki} | 0 .../10-1/default.nix} | 0 .../12-1/default.nix} | 0 .../README.wiki} | 0 asus/wireless-ac1300.nix | 2 + .../15-9550/README.wiki} | 0 .../15-9550/default.nix} | 0 .../{configuration.nix => default.nix} | 0 lenovo/ideapad/{z510.nix => z510/default.nix} | 0 lenovo/thinkpad/{general.nix => common.nix} | 0 .../thinkpad/{general-intel.nix => intel.nix} | 0 .../thinkpad/{t410.nix => t410/default.nix} | 2 +- .../thinkpad/{t440p.nix => t440p/default.nix} | 2 +- .../thinkpad/{t460s.nix => t460s/default.nix} | 0 .../thinkpad/{x140e.nix => x140e/default.nix} | 2 +- .../{x220i-tablet.nix => x220/default.nix} | 2 +- .../{hyper-v-guest.md => hyper-v/README.md} | 0 .../3/README.wiki} | 0 .../3/default.nix} | 0 .../rpi2.nix => raspberry-pi/2/default.nix | 0 .../{np900x3c.wiki => np900x3c/README.wiki} | 0 .../{np900x3c.nix => np900x3c/default.nix} | 0 .../default.nix} | 0 .../{x10sll-f.nix => x10sll-f/default.nix} | 0 31 files changed, 53 insertions(+), 28 deletions(-) delete mode 100644 README.md create mode 100644 README.org rename acer/{4810t.wiki => aspire/4810t/README.wiki} (100%) rename acer/{4810t.nix => aspire/4810t/default.nix} (100%) rename acer/{c720.wiki => c720/README.wiki} (100%) rename acer/{c720.nix => c720/default.nix} (100%) rename airis/{n990.nix => n990/default.nix} (100%) rename apple/{macbook-pro-10-1.wiki => macbook-pro/10-1/README.wiki} (100%) rename apple/{macbook-pro-10-1.nix => macbook-pro/10-1/default.nix} (100%) rename apple/{macbook-pro-12-1.nix => macbook-pro/12-1/default.nix} (100%) rename asus/{m60j-jx041v.wiki => m60j-jx041v/README.wiki} (100%) rename dell/{xps-15-9550.wiki => xps/15-9550/README.wiki} (100%) rename dell/{xps-15-9550.nix => xps/15-9550/default.nix} (100%) rename inversepath/usbarmory/{configuration.nix => default.nix} (100%) rename lenovo/ideapad/{z510.nix => z510/default.nix} (100%) rename lenovo/thinkpad/{general.nix => common.nix} (100%) rename lenovo/thinkpad/{general-intel.nix => intel.nix} (100%) rename lenovo/thinkpad/{t410.nix => t410/default.nix} (99%) rename lenovo/thinkpad/{t440p.nix => t440p/default.nix} (82%) rename lenovo/thinkpad/{t460s.nix => t460s/default.nix} (100%) rename lenovo/thinkpad/{x140e.nix => x140e/default.nix} (91%) rename lenovo/thinkpad/{x220i-tablet.nix => x220/default.nix} (93%) rename microsoft/{hyper-v-guest.md => hyper-v/README.md} (100%) rename microsoft/{surface_pro_3.wiki => surface-pro/3/README.wiki} (100%) rename microsoft/{surface_pro_3.nix => surface-pro/3/default.nix} (100%) rename raspberry_pi/rpi2.nix => raspberry-pi/2/default.nix (100%) rename samsung/{np900x3c.wiki => np900x3c/README.wiki} (100%) rename samsung/{np900x3c.nix => np900x3c/default.nix} (100%) rename supermicro/{a1sri-2758f.nix => a1sri-2758f/default.nix} (100%) rename supermicro/{x10sll-f.nix => x10sll-f/default.nix} (100%) diff --git a/README.md b/README.md deleted file mode 100644 index f697a7b..0000000 --- a/README.md +++ /dev/null @@ -1,24 +0,0 @@ -A collection of NixOS modules covering hardware quirks. - -## Usage -The simplest way to use this repo for now is to clone locally and include by path: -``` nix -{ config, pkgs, ... }: - -{ - imports = - [ /home/user/nixos-hardware/acme/thunkpad-2000.nix ]; -} -``` - -Modules should favor usability and stability, so performance hacks -should be activated by an additional a NixOS option or conservative -and performance configs can be declared in seperate modules. - -Because modules can only be tested with the appropriate hardware, -quality assurance is up to **you**. - -## Simple tips and tricks - -### Disable PC speaker -```boot.blacklistedKernelModules = [ "pcspkr" ];``` diff --git a/README.org b/README.org new file mode 100644 index 0000000..97df02c --- /dev/null +++ b/README.org @@ -0,0 +1,47 @@ +NixOS profiles covering hardware quirks. + +Add a new channel: + + : $ sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware + : $ sudo nix-channel --update nixos-hardware + +Then add an appropriate profile path to ~imports~ in +~/etc/nixos/configuration.nix~. Currently available profiles: + +| Model | Path | +|---------------------------+--------------------------------------------| +| Acer Aspire 4810T | ~~ | +| Acer C720 | ~~ | +| Airis N990 | ~~ | +| Apple MacBook Pro 10,1 | ~~ | +| Apple MacBook Pro 12,1 | ~~ | +| Dell XPS 15 9550 | ~~ | +| Inverse Path USB armory | ~~ | +| Lenovo IdeaPad Z510 | ~~ | +| Lenovo ThinkPad T410 | ~~ | +| Lenovo ThinkPad T440p | ~~ | +| Lenovo ThinkPad T460s | ~~ | +| Lenovo ThinkPad X140e | ~~ | +| Lenovo ThinkPad X220 | ~~ | +| Microsoft Surface Pro 3 | ~~ | +| Raspberry Pi 2 | ~~ | +| Samsung Series 9 NP900X3C | ~~ | +| Supermicro A1SRi-2758F | ~~ | +| Supermicro X10SLL-F | ~~ | + +For example, to enable ThinkPad X220 profile, your ~imports~ should look like: + + : imports = [ ./hardware-configuration.nix ]; + +Profiles should favor usability and stability, so performance hacks should be +activated by an additional NixOS option or conservative and performance configs +can be declared in seperate profiles. + +Because profiles can only be tested with the appropriate hardware, quality +assurance is up to *you*. + +** Simple tips and tricks + +*** Disable PC speaker + + : boot.blacklistedKernelModules = [ "pcspkr" ]; diff --git a/acer/4810t.wiki b/acer/aspire/4810t/README.wiki similarity index 100% rename from acer/4810t.wiki rename to acer/aspire/4810t/README.wiki diff --git a/acer/4810t.nix b/acer/aspire/4810t/default.nix similarity index 100% rename from acer/4810t.nix rename to acer/aspire/4810t/default.nix diff --git a/acer/c720.wiki b/acer/c720/README.wiki similarity index 100% rename from acer/c720.wiki rename to acer/c720/README.wiki diff --git a/acer/c720.nix b/acer/c720/default.nix similarity index 100% rename from acer/c720.nix rename to acer/c720/default.nix diff --git a/airis/n990.nix b/airis/n990/default.nix similarity index 100% rename from airis/n990.nix rename to airis/n990/default.nix diff --git a/apple/macbook-pro-10-1.wiki b/apple/macbook-pro/10-1/README.wiki similarity index 100% rename from apple/macbook-pro-10-1.wiki rename to apple/macbook-pro/10-1/README.wiki diff --git a/apple/macbook-pro-10-1.nix b/apple/macbook-pro/10-1/default.nix similarity index 100% rename from apple/macbook-pro-10-1.nix rename to apple/macbook-pro/10-1/default.nix diff --git a/apple/macbook-pro-12-1.nix b/apple/macbook-pro/12-1/default.nix similarity index 100% rename from apple/macbook-pro-12-1.nix rename to apple/macbook-pro/12-1/default.nix diff --git a/asus/m60j-jx041v.wiki b/asus/m60j-jx041v/README.wiki similarity index 100% rename from asus/m60j-jx041v.wiki rename to asus/m60j-jx041v/README.wiki diff --git a/asus/wireless-ac1300.nix b/asus/wireless-ac1300.nix index c60632a..a3122a7 100644 --- a/asus/wireless-ac1300.nix +++ b/asus/wireless-ac1300.nix @@ -1,5 +1,7 @@ # Use this module if you use a realtek 18812au based wifi dongle, like ASUS Wireless-AC1300 + { pkgs, ... }: + { boot.extraModulePackages = [ pkgs.linuxPackages.rtl8812au ]; boot.kernelModules = [ "8812au" ]; diff --git a/dell/xps-15-9550.wiki b/dell/xps/15-9550/README.wiki similarity index 100% rename from dell/xps-15-9550.wiki rename to dell/xps/15-9550/README.wiki diff --git a/dell/xps-15-9550.nix b/dell/xps/15-9550/default.nix similarity index 100% rename from dell/xps-15-9550.nix rename to dell/xps/15-9550/default.nix diff --git a/inversepath/usbarmory/configuration.nix b/inversepath/usbarmory/default.nix similarity index 100% rename from inversepath/usbarmory/configuration.nix rename to inversepath/usbarmory/default.nix diff --git a/lenovo/ideapad/z510.nix b/lenovo/ideapad/z510/default.nix similarity index 100% rename from lenovo/ideapad/z510.nix rename to lenovo/ideapad/z510/default.nix diff --git a/lenovo/thinkpad/general.nix b/lenovo/thinkpad/common.nix similarity index 100% rename from lenovo/thinkpad/general.nix rename to lenovo/thinkpad/common.nix diff --git a/lenovo/thinkpad/general-intel.nix b/lenovo/thinkpad/intel.nix similarity index 100% rename from lenovo/thinkpad/general-intel.nix rename to lenovo/thinkpad/intel.nix diff --git a/lenovo/thinkpad/t410.nix b/lenovo/thinkpad/t410/default.nix similarity index 99% rename from lenovo/thinkpad/t410.nix rename to lenovo/thinkpad/t410/default.nix index 53c731f..53d5515 100644 --- a/lenovo/thinkpad/t410.nix +++ b/lenovo/thinkpad/t410/default.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - imports = [ ./general-intel.nix ]; + imports = [ ../intel.nix ]; boot = { kernelParams = [ diff --git a/lenovo/thinkpad/t440p.nix b/lenovo/thinkpad/t440p/default.nix similarity index 82% rename from lenovo/thinkpad/t440p.nix rename to lenovo/thinkpad/t440p/default.nix index 4d96bbb..5c8699d 100644 --- a/lenovo/thinkpad/t440p.nix +++ b/lenovo/thinkpad/t440p/default.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - imports = [ ./general-intel.nix ]; + imports = [ ../intel.nix ]; boot = { extraModprobeConfig = '' diff --git a/lenovo/thinkpad/t460s.nix b/lenovo/thinkpad/t460s/default.nix similarity index 100% rename from lenovo/thinkpad/t460s.nix rename to lenovo/thinkpad/t460s/default.nix diff --git a/lenovo/thinkpad/x140e.nix b/lenovo/thinkpad/x140e/default.nix similarity index 91% rename from lenovo/thinkpad/x140e.nix rename to lenovo/thinkpad/x140e/default.nix index efa5106..a6fb02a 100644 --- a/lenovo/thinkpad/x140e.nix +++ b/lenovo/thinkpad/x140e/default.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: { - imports = [ ./general.nix ]; + imports = [ ../common.nix ]; boot = { # wireless diff --git a/lenovo/thinkpad/x220i-tablet.nix b/lenovo/thinkpad/x220/default.nix similarity index 93% rename from lenovo/thinkpad/x220i-tablet.nix rename to lenovo/thinkpad/x220/default.nix index 9f9638a..3a9e99b 100644 --- a/lenovo/thinkpad/x220i-tablet.nix +++ b/lenovo/thinkpad/x220/default.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { - imports = [ ./general-intel.nix ]; + imports = [ ../intel.nix ]; # TPM chip countains a RNG security.rngd.enable = true; diff --git a/microsoft/hyper-v-guest.md b/microsoft/hyper-v/README.md similarity index 100% rename from microsoft/hyper-v-guest.md rename to microsoft/hyper-v/README.md diff --git a/microsoft/surface_pro_3.wiki b/microsoft/surface-pro/3/README.wiki similarity index 100% rename from microsoft/surface_pro_3.wiki rename to microsoft/surface-pro/3/README.wiki diff --git a/microsoft/surface_pro_3.nix b/microsoft/surface-pro/3/default.nix similarity index 100% rename from microsoft/surface_pro_3.nix rename to microsoft/surface-pro/3/default.nix diff --git a/raspberry_pi/rpi2.nix b/raspberry-pi/2/default.nix similarity index 100% rename from raspberry_pi/rpi2.nix rename to raspberry-pi/2/default.nix diff --git a/samsung/np900x3c.wiki b/samsung/np900x3c/README.wiki similarity index 100% rename from samsung/np900x3c.wiki rename to samsung/np900x3c/README.wiki diff --git a/samsung/np900x3c.nix b/samsung/np900x3c/default.nix similarity index 100% rename from samsung/np900x3c.nix rename to samsung/np900x3c/default.nix diff --git a/supermicro/a1sri-2758f.nix b/supermicro/a1sri-2758f/default.nix similarity index 100% rename from supermicro/a1sri-2758f.nix rename to supermicro/a1sri-2758f/default.nix diff --git a/supermicro/x10sll-f.nix b/supermicro/x10sll-f/default.nix similarity index 100% rename from supermicro/x10sll-f.nix rename to supermicro/x10sll-f/default.nix