Skip to content

Commit

Permalink
docs/src: fix arguments and style in nix codeblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
yunfachi committed Oct 9, 2024
1 parent 056d641 commit 84df8a9
Show file tree
Hide file tree
Showing 14 changed files with 51 additions and 10 deletions.
4 changes: 4 additions & 0 deletions docs/src/hosts/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
An example of a minimal host module configuration that serves as a baseline for all further settings:

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand All @@ -26,6 +27,7 @@ delib.module {
The `type` option **is very** useful for default values in your modules. For example, the option `enable = boolOption host.isDesktop` can be used for some GUI programs. This simplifies configuration management based on the type of device.

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down Expand Up @@ -55,6 +57,7 @@ delib.module {
This option can be useful for configuring monitors; however, it can be implemented as a separate module.

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down Expand Up @@ -96,6 +99,7 @@ delib.module {
Using `delib.hostNamesAssertions` is strongly recommended, but it can also be omitted.

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down
1 change: 1 addition & 0 deletions docs/src/hosts/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ For hosts to work, the configuration must include the options `${myconfigName}.h
Here is an example of a minimal recommended host configuration:

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down
8 changes: 8 additions & 0 deletions docs/src/modules/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Constants {#constants}
```nix
{delib, ...}:
delib.module {
name = "constants";
Expand All @@ -16,6 +17,7 @@ delib.module {
## Hosts {#hosts}
Without `type` option:
```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand All @@ -35,6 +37,7 @@ delib.module {
```
With `type` option:
```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down Expand Up @@ -62,6 +65,7 @@ delib.module {

## Rices {#rices}
```nix
{delib, ...}:
delib.module {
name = "rices";
Expand All @@ -83,6 +87,7 @@ delib.module {
## Home Manager {#home-manager}
With [constants](#constants):
```nix
{delib, ...}:
delib.module {
name = "home";
Expand All @@ -100,6 +105,7 @@ delib.module {
## User {#user}
With [constants](#constants):
```nix
{delib, ...}:
delib.module {
name = "user";
Expand All @@ -120,6 +126,7 @@ delib.module {
## Git {#git}
With [constants](#constants):
```nix
{delib, ...}:
delib.module {
name = "programs.git";
Expand All @@ -140,6 +147,7 @@ delib.module {

## Alejandra {#alejandra}
```nix
{delib, ...}:
delib.module {
name = "programs.alejandra";
Expand Down
2 changes: 1 addition & 1 deletion docs/src/modules/introduction-nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Denix uses a different approach to options, although both methods can be used si
An example of a module with options using Denix:

```nix
{denix, ...}:
{delib, ...}:
delib.module {
name = "coolmodule";
Expand Down
9 changes: 5 additions & 4 deletions docs/src/modules/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ This means that you can use all three types of modules simultaneously, although

### Denix Module
```nix
{delib, ...}: delib.module {
{delib, ...}:
delib.module {
name = "...";
}
```

### Denix Module with NixOS/Home Manager Module
```nix
{delib, ...}: delib.module {
{delib, ...}:
delib.module {
name = "...";
}
// {
} // {
}
```
Expand Down
2 changes: 2 additions & 0 deletions docs/src/rices/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
An example of a minimal rice module configuration that serves as a baseline for all further settings:

```nix
{delib, ...}:
delib.module {
name = "rices";
Expand All @@ -26,6 +27,7 @@ delib.module {
Using `delib.riceNamesAssertions` is strongly recommended, but it can also be omitted.

```nix
{delib, ...}:
delib.module {
name = "rices";
Expand Down
4 changes: 4 additions & 0 deletions docs/src/rices/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ A rice can inherit all configurations of another rice via the `inherits` attribu
Example of three rices, where the first two inherit all configurations from the "rounded" rice:

```nix
{delib, ...}:
delib.rice {
name = "black";
inherits = ["rounded"];
Expand All @@ -19,6 +20,7 @@ delib.rice {
```

```nix
{delib, ...}:
delib.rice {
name = "light";
inherits = ["rounded"];
Expand All @@ -27,6 +29,7 @@ delib.rice {
```

```nix
{delib, ...}:
delib.rice {
name = "rounded";
inheritanceOnly = true;
Expand All @@ -40,6 +43,7 @@ For rices to work, your configuration must include the options `${myconfigName}.
Example of a minimal recommended configuration for rices:

```nix
{delib, ...}:
delib.module {
name = "rices";
Expand Down
4 changes: 4 additions & 0 deletions docs/src/ru/hosts/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Пример минимальной конфигурации модуля хостов, который является базовой точкой для всех дальнейших настроек:

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand All @@ -26,6 +27,7 @@ delib.module {
Опция `type` **очень** полезна для задания значений по умолчанию в своих модулях. Например, опция `enable = boolOption host.isDesktop` может использоваться для какой-нибудь GUI программы. Это упрощает управление конфигурациями в зависимости от типа устройства.

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down Expand Up @@ -55,6 +57,7 @@ delib.module {
Эта опция может быть полезна для настройки мониторов, однако её можно реализовать как отдельный модуль.

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down Expand Up @@ -96,6 +99,7 @@ delib.module {
Использование `delib.hostNamesAssertions` настоятельно рекомендуется, но можно обойтись и без него:

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down
1 change: 1 addition & 0 deletions docs/src/ru/hosts/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Пример минимальной рекомендуемой конфигурации хостов:

```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down
8 changes: 8 additions & 0 deletions docs/src/ru/modules/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Константы {#constants}
```nix
{delib, ...}:
delib.module {
name = "constants";
Expand All @@ -16,6 +17,7 @@ delib.module {
## Хосты {#hosts}
Без опции `type`:
```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand All @@ -35,6 +37,7 @@ delib.module {
```
С опцией `type`:
```nix
{delib, ...}:
delib.module {
name = "hosts";
Expand Down Expand Up @@ -62,6 +65,7 @@ delib.module {

## Райсы {#rices}
```nix
{delib, ...}:
delib.module {
name = "rices";
Expand All @@ -83,6 +87,7 @@ delib.module {
## Home Manager {#home-manager}
С [константами](#constants):
```nix
{delib, ...}:
delib.module {
name = "home";
Expand All @@ -100,6 +105,7 @@ delib.module {
## Пользователь {#user}
С [константами](#constants):
```nix
{delib, ...}:
delib.module {
name = "user";
Expand All @@ -120,6 +126,7 @@ delib.module {
## Git {#git}
С [константами](#constants):
```nix
{delib, ...}:
delib.module {
name = "programs.git";
Expand All @@ -140,6 +147,7 @@ delib.module {

## Alejandra {#alejandra}
```nix
{delib, ...}:
delib.module {
name = "programs.alejandra";
Expand Down
3 changes: 2 additions & 1 deletion docs/src/ru/modules/introduction-nixos.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ optionName = lib.mkOption {
Пример модуля с опциями в Denix:

```nix
{denix, ...}: delib.module {
{delib, ...}:
delib.module {
name = "coolmodule";
options.coolmodule = with delib; {
Expand Down
9 changes: 5 additions & 4 deletions docs/src/ru/modules/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

### Denix модуль
```nix
{delib, ...}: delib.module {
{delib, ...}:
delib.module {
name = "...";
}
```

### Denix модуль, дополненный NixOS/Home Manager модулем
```nix
{delib, ...}: delib.module {
{delib, ...}:
delib.module {
name = "...";
}
// {
} // {
}
```
Expand Down
2 changes: 2 additions & 0 deletions docs/src/ru/rices/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Пример минимальной конфигурации модуля райсов, который является базовой точкой для всех дальнейших настроек:

```nix
{delib, ...}:
delib.module {
name = "rices";
Expand All @@ -26,6 +27,7 @@ delib.module {
Использование `delib.riceNamesAssertions` настоятельно рекомендуется, но можно обойтись и без него:

```nix
{delib, ...}:
delib.module {
name = "rices";
Expand Down
4 changes: 4 additions & 0 deletions docs/src/ru/rices/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Пример трех райсов, где первые два наследуют все конфигурации райса "rounded":

```nix
{delib, ...}:
delib.rice {
name = "black";
inherits = ["rounded"];
Expand All @@ -19,6 +20,7 @@ delib.rice {
```

```nix
{delib, ...}:
delib.rice {
name = "light";
inherits = ["rounded"];
Expand All @@ -27,6 +29,7 @@ delib.rice {
```

```nix
{delib, ...}:
delib.rice {
name = "rounded";
inheritanceOnly = true;
Expand All @@ -40,6 +43,7 @@ delib.rice {
Пример минимальной рекомендуемой конфигурации для райсов:

```nix
{delib, ...}:
delib.module {
name = "rices";
Expand Down

0 comments on commit 84df8a9

Please sign in to comment.