Difference between revisions of "NixOS Wiki talk:Contributing"
Line 25: | Line 25: | ||
Btw, Vater it would be great if you could join IRC: freenode#nixos-wiki , a lot of discussion happens here. --[[User:Makefu|Makefu]] ([[User talk:Makefu|talk]]) 21:01, 19 October 2017 (UTC) | Btw, Vater it would be great if you could join IRC: freenode#nixos-wiki , a lot of discussion happens here. --[[User:Makefu|Makefu]] ([[User talk:Makefu|talk]]) 21:01, 19 October 2017 (UTC) | ||
+ | |||
+ | == drafty "small" draft for the [[{{ns:4}}:{{PAGENAME}}#Syntax]] section == | ||
+ | |||
+ | === Syntax === | ||
+ | |||
+ | ; Headings: | ||
+ | |||
+ | Use the secondary MediaWiki header (<code><nowiki>== My Section ==</nowiki></code>) for main sections (the primary header should never be used). | ||
+ | |||
+ | ; Command (on the command-line): | ||
+ | : Please use <code><nowiki><syntaxhighlight lang="console"></nowiki></code>. | ||
+ | : Please use one line for every command-line. | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | |+ Example for single command-line | ||
+ | |- | ||
+ | ! wiki input | ||
+ | ! wiki output | ||
+ | |- | ||
+ | | | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="console"> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | nixos-rebuild switch | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | </syntaxhighlight> | ||
+ | </nowiki> | ||
+ | | | ||
+ | <syntaxhighlight lang="console"> | ||
+ | nixos-rebuild switch | ||
+ | </syntaxhighlight> | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ; Nix configuration code (in a file): | ||
+ | : Please use <code><nowiki><syntaxhighlight lang="nix"></nowiki></code> | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | |+ Example for a whole file | ||
+ | |- | ||
+ | ! wiki input | ||
+ | ! wiki output | ||
+ | |- | ||
+ | | | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="nix"> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | { config, pkgs, ... }: | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | { | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | <nowiki> | ||
+ | imports = | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | | ||
+ | <nowiki> | ||
+ | [ | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | | ||
+ | | ||
+ | <nowiki> | ||
+ | ./hardware-configuration.nix | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | | ||
+ | <nowiki> | ||
+ | ]; | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | } | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | </syntaxhighlight> | ||
+ | </nowiki> | ||
+ | | | ||
+ | <syntaxhighlight lang="nix"> | ||
+ | { config, pkgs, ... }: | ||
+ | { | ||
+ | imports = | ||
+ | [ | ||
+ | ./hardware-configuration.nix | ||
+ | ]; | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | |+ Example for a part of a file | ||
+ | |- | ||
+ | ! wiki input | ||
+ | ! wiki output | ||
+ | |- | ||
+ | | | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="nix"></syntaxhighlight> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="nix"> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | <nowiki> | ||
+ | environment.systemPackages = with pkgs; [ | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | | ||
+ | <nowiki> | ||
+ | home-manager | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | | ||
+ | <nowiki> | ||
+ | ]; | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | </syntaxhighlight> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="nix"></syntaxhighlight> | ||
+ | </nowiki> | ||
+ | | | ||
+ | <syntaxhighlight lang="nix"></syntaxhighlight> | ||
+ | <syntaxhighlight lang="nix"> | ||
+ | environment.systemPackages = with pkgs; [ | ||
+ | home-manager | ||
+ | ]; | ||
+ | </syntaxhighlight> | ||
+ | <syntaxhighlight lang="nix"></syntaxhighlight> | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | |+ Example for the top of a file | ||
+ | |- | ||
+ | ! wiki input | ||
+ | ! wiki output | ||
+ | |- | ||
+ | | | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="nix"> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | { config, pkgs, ... }: | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | </syntaxhighlight> | ||
+ | </nowiki> | ||
+ | <br /> | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="nix"></syntaxhighlight> | ||
+ | </nowiki> | ||
+ | | | ||
+ | <syntaxhighlight lang="nix"> | ||
+ | { config, pkgs, ... }: | ||
+ | </syntaxhighlight> | ||
+ | <syntaxhighlight lang="nix"></syntaxhighlight> | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ; (non Nix Language) code: | ||
+ | : Please use <code><nowiki><syntaxhighlight lang="language"></nowiki></code>, where ''language'' is a supported ([http://pygments.org/docs/lexers/ lexers]) for the [[mediawikiwiki:Extension:SyntaxHighlight]]. | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | |+ Example for an emoty file of C++ code | ||
+ | |- | ||
+ | ! wiki input | ||
+ | ! wiki output | ||
+ | |- | ||
+ | | | ||
+ | <nowiki> | ||
+ | <syntaxhighlight lang="cpp"> | ||
+ | </syntaxhighlight> | ||
+ | </nowiki> | ||
+ | | | ||
+ | <syntaxhighlight lang="cpp"> | ||
+ | </syntaxhighlight> | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ; Formatting file locations and commands as part of a text: | ||
+ | |||
+ | {| | ||
+ | |- | ||
+ | |+ Example | ||
+ | |- | ||
+ | ! wiki input | ||
+ | ! wiki output | ||
+ | |- | ||
+ | <!-- | ||
+ | | | ||
+ | <pre> | ||
+ | You have to edit the file <code>/etc/nixos/configuration.nix</code>. | ||
+ | </pre> | ||
+ | | | ||
+ | You have to edit the file <code>/etc/nixos/configuration.nix</code>. | ||
+ | |- | ||
+ | --> | ||
+ | | | ||
+ | <nowiki> | ||
+ | You have to create a directory <code>~/.config/nixpkgs/</code> because the program <code>home-manager</code> expecting a file <code>~/.config/nixpkgs/home.nix</code> there. | ||
+ | </nowiki> | ||
+ | | | ||
+ | You have to create a directory <code>~/.config/nixpkgs/</code> because the program <code>home-manager</code> expecting a file <code>~/.config/nixpkgs/home.nix</code> there. | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | ; Notation: | ||
+ | * Use the right capitalization for the Nix ecosystem names: | ||
+ | *: ''NixOS'' | ||
+ | *: ''Nix'' | ||
+ | *: ''Nix Language'' | ||
+ | *: ''Nixpkgs'' | ||
+ | *: ''NixOps'' | ||
+ | *: ''Hydra'' |
Revision as of 06:38, 23 January 2019
NixOS Wiki vs. NixOS User Wiki
dear wiki people!
it is nice to have consistent terms.
which one is the better one? NixOS Wiki or NixOS User Wiki?
--Vater (talk) 22:16, 18 October 2017 (UTC)
"NixOS Wiki", matches the domain, no confusion with the GitHub Wiki. --Fadenb (talk) 09:38, 19 October 2017 (UTC)
describing templates, especially for shortcuts
hi wiki people,
probably it is good idea to name and describe all the most useful templates. am i right?
btw: maybe Special:Interwiki links are easier to use (for the most users).
--Vater (talk) 15:34, 19 October 2017 (UTC)
I'd also love to see an overview of all our fancy templates. I also always forget if it is note: or notice: :)
Btw, Vater it would be great if you could join IRC: freenode#nixos-wiki , a lot of discussion happens here. --Makefu (talk) 21:01, 19 October 2017 (UTC)
drafty "small" draft for the NixOS Wiki:Contributing#Syntax section
Syntax
- Headings
Use the secondary MediaWiki header (== My Section ==
) for main sections (the primary header should never be used).
- Command (on the command-line)
- Please use
<syntaxhighlight lang="console">
. - Please use one line for every command-line.
wiki input | wiki output |
---|---|
<syntaxhighlight lang="console">
|
nixos-rebuild switch
|
- Nix configuration code (in a file)
- Please use
<syntaxhighlight lang="nix">
wiki input | wiki output |
---|---|
<syntaxhighlight lang="nix">
|
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
}
|
wiki input | wiki output |
---|---|
<syntaxhighlight lang="nix"></syntaxhighlight>
|
environment.systemPackages = with pkgs; [
home-manager
];
|
wiki input | wiki output |
---|---|
<syntaxhighlight lang="nix">
|
{ config, pkgs, ... }:
|
- (non Nix Language) code
- Please use
<syntaxhighlight lang="language">
, where language is a supported (lexers) for the mediawikiwiki:Extension:SyntaxHighlight.
wiki input | wiki output |
---|---|
<syntaxhighlight lang="cpp"> </syntaxhighlight> |
- Formatting file locations and commands as part of a text
wiki input | wiki output |
---|---|
You have to create a directory <code>~/.config/nixpkgs/</code> because the program <code>home-manager</code> expecting a file <code>~/.config/nixpkgs/home.nix</code> there. |
You have to create a directory |
- Notation
- Use the right capitalization for the Nix ecosystem names:
- NixOS
- Nix
- Nix Language
- Nixpkgs
- NixOps
- Hydra