Skip to content

Commit

Permalink
Gate nix --help sections based on stability
Browse files Browse the repository at this point in the history
This frequent unescaping might not be so nice looking, but we can do it
a different way. The behavior I think is good.
  • Loading branch information
Ericson2314 committed Apr 2, 2023
1 parent c09784e commit 913888f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/nix/nix.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
R""(
(!experimentalFeatureSettings.isEnabled(Xp::Flakes) ? "" : (std::string) R""(

# Examples

Expand Down Expand Up @@ -39,28 +39,35 @@ R""(
Hello, world!
```

)"") + R""(

# Description

Nix is a tool for building software, configurations and other
artifacts in a reproducible and declarative way. For more information,
see the [Nix homepage](https://nixos.org/) or the [Nix
manual](https://nixos.org/manual/nix/stable/).

)"" + (!experimentalFeatureSettings.isEnabled(Xp::NixCommand) ? "" : ((std::string) R""(

# Installables

Many `nix` subcommands operate on one or more *installables*.
These are command line arguments that represent something that can be realised in the Nix store.

The following types of installable are supported by most commands:

)"" + (!experimentalFeatureSettings.isEnabled(Xp::Flakes) ? "" : (std::string) R""(
- [Flake output attribute](#flake-output-attribute)
)"") + R""(
- [Store path](#store-path)
- [Nix file](#nix-file), optionally qualified by an attribute path
- [Nix expression](#nix-expression), optionally qualified by an attribute path

For most commands, if no installable is specified, `.` as assumed.
That is, Nix will operate on the default flake output attribute of the flake in the current directory.

)"" + (!experimentalFeatureSettings.isEnabled(Xp::Flakes) ? "" : (std::string) R""(
### Flake output attribute

Example: `nixpkgs#hello`
Expand Down Expand Up @@ -119,6 +126,8 @@ subcommands, these are `packages.`*system*,
attributes `packages.x86_64-linux.hello`,
`legacyPackages.x86_64-linux.hello` and `hello`.

)"") + R""(

### Store path

Example: `/nix/store/v5sv61sszx301i0x6xysaqzla09nksnd-hello-2.10`
Expand Down Expand Up @@ -218,6 +227,8 @@ operate are determined as follows:

* Otherwise, Nix will use all outputs of the derivation.

)"")) + R""(

# Nix stores

Most `nix` subcommands operate on a *Nix store*. These are documented
Expand Down

0 comments on commit 913888f

Please sign in to comment.