mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-27 05:19:43 +01:00
Suggestions for CONTRIBUTING
This commit is contained in:
parent
cfc72f6c9b
commit
e9d8b30995
1 changed files with 30 additions and 5 deletions
|
@ -1,6 +1,31 @@
|
||||||
Profiles should favor usability and stability, so performance hacks should be
|
# Writing profiles
|
||||||
activated by an additional NixOS option or conservative and performance configs
|
|
||||||
can be declared in separate profiles.
|
|
||||||
|
|
||||||
Because profiles can only be tested with the appropriate hardware, quality
|
When setting an option, use `lib.mkDefault` unless:
|
||||||
assurance is up to *you*.
|
- The option *must* be set and the user should get an error if they try to override it.
|
||||||
|
- The setting should merge with the user's settings (typical for list or set options).
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
{ lib }: {
|
||||||
|
# Using mkDefault, because the user might want to disable tlp
|
||||||
|
services.tlp.enable = lib.mkDefault true;
|
||||||
|
# No need to use mkDefault, because the setting will merge with the user's setting
|
||||||
|
boot.kernelModules = [ "tmp_smapi" ];
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Try to avoid "opinionated" settings relating to optional features like sound, bluetooth, choice of bootloader etc.
|
||||||
|
|
||||||
|
Where possible, use module imports to share code between similar hardware variants.
|
||||||
|
|
||||||
|
# Performance
|
||||||
|
|
||||||
|
Profiles should favor usability and stability, so performance improvements should either be conservative or
|
||||||
|
be guarded behind additional NixOS module options.
|
||||||
|
|
||||||
|
If it makes sense to have a performance-focussed config, it can be declared in a separate profile.
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
|
||||||
|
Because profiles can only be tested with the appropriate hardware, quality assurance is up to *you*.
|
||||||
|
|
Loading…
Reference in a new issue