summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorMichael Peyton Jones <me@michaelpj.com>2018-07-17 13:39:49 +0100
committerJörg Thalheim <joerg@thalheim.io>2018-08-31 20:16:33 +0100
commite9d8b30995f4bc361bffae3c2dec5d15a6afa86f (patch)
treea0f726200bcc3dfeb9a1ce439f6488b07bf1b4d8 /CONTRIBUTING.md
parentcfc72f6c9b4348aa9952730c52c44cf8460fbc40 (diff)
Suggestions for CONTRIBUTING
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md35
1 files changed, 30 insertions, 5 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fc6ed8a..ea46892 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,6 +1,31 @@
-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 separate profiles.
+# Writing profiles
-Because profiles can only be tested with the appropriate hardware, quality
-assurance is up to *you*.
+When setting an option, use `lib.mkDefault` unless:
+- 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*.