NixOS Wiki talk:Contributing

From NixOS Wiki
Jump to: navigation, search

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.
Example for single command-line
wiki input wiki output

<syntaxhighlight lang="console">
nixos-rebuild switch
</syntaxhighlight>

nixos-rebuild switch
Nix configuration code (in a file)
Please use <syntaxhighlight lang="nix">
Example for a whole file
wiki input wiki output

<syntaxhighlight lang="nix">
{ config, pkgs, ... }:
{
   imports =
      [
         ./hardware-configuration.nix
      ];
}
</syntaxhighlight>

{ config, pkgs, ... }:
{
  imports =
    [
      ./hardware-configuration.nix
    ];
}
Example for a part of a file
wiki input wiki output

<syntaxhighlight lang="nix"></syntaxhighlight>
<syntaxhighlight lang="nix">
   environment.systemPackages = with pkgs; [
      home-manager
   ];
</syntaxhighlight>
<syntaxhighlight lang="nix"></syntaxhighlight>

  environment.systemPackages = with pkgs; [
    home-manager
  ];
Example for the top of a file
wiki input wiki output

<syntaxhighlight lang="nix">
{ config, pkgs, ... }:
</syntaxhighlight>
<syntaxhighlight lang="nix"></syntaxhighlight>

{ config, pkgs, ... }:
(non Nix Language) code
Please use <syntaxhighlight lang="language">, where language is a supported (lexers) for the mediawikiwiki:Extension:SyntaxHighlight.
Example for an emoty file of C++ code
wiki input wiki output

<syntaxhighlight lang="cpp"> </syntaxhighlight>

Formatting file locations and commands as part of a text
Example
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 ~/.config/nixpkgs/ because the program home-manager expecting a file ~/.config/nixpkgs/home.nix there.

Notation
  • Use the right capitalization for the Nix ecosystem names:
    NixOS
    Nix
    Nix Language
    Nixpkgs
    NixOps
    Hydra