From 130e33a4e7698043fc566754d9dda981c2ebb816 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 14 Nov 2017 21:22:34 +0100 Subject: [PATCH] contributing: add basic style guidelines In particular, refer to the Nixpkgs guidelines and add a note about attribute names referencing packages in Nixpkgs. --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index feda8dedb..3a96a7a88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,6 +68,15 @@ description if you wish. In addition to the above commit message guidelines, try to follow the [seven rules][] as much as possible. +### Style guidelines ### + +The code in Home Manager should follow the [Nixpkgs syntax +guidelines][]. Note, we prefer `lowerCamelCase` for variable and +attribute names with the accepted exception of variables directly +referencing packages in Nixpkgs which use a hyphenated style. For +example, the Home Manager option `services.gpg-agent.enableSshSupport` +references the `gpg-agent` package in Nixpkgs. + ### News ### Home Manager includes a system for presenting news to the user. When @@ -125,3 +134,4 @@ If you do have a change worthy of a news entry then please add one in [create a pull request]: https://help.github.com/articles/creating-a-pull-request/ [seven rules]: https://chris.beams.io/posts/git-commit/#seven-rules [`news.nix`]: https://github.com/rycee/home-manager/blob/master/modules/misc/news.nix +[Nixpkgs syntax guidelines]: https://nixos.org/nixpkgs/manual/#sec-syntax