Remove top level with lib;
in docs (#293829)
This commit is contained in:
parent
ff352fc505
commit
86ae7a6243
|
@ -6,8 +6,9 @@ All generators follow a similar call interface: `generatorName configFunctions d
|
||||||
Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses `: ` as separator, the strings `"yes"`/`"no"` as boolean values and requires all string values to be quoted:
|
Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses `: ` as separator, the strings `"yes"`/`"no"` as boolean values and requires all string values to be quoted:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) generators isString;
|
||||||
|
|
||||||
customToINI = generators.toINI {
|
customToINI = generators.toINI {
|
||||||
# specifies how to format a key/value pair
|
# specifies how to format a key/value pair
|
||||||
mkKeyValue = generators.mkKeyValueDefault {
|
mkKeyValue = generators.mkKeyValueDefault {
|
||||||
|
|
|
@ -55,7 +55,13 @@ Here is a simple package example. It is a pure Coq library, thus it depends on C
|
||||||
```nix
|
```nix
|
||||||
{ lib, mkCoqDerivation, version ? null
|
{ lib, mkCoqDerivation, version ? null
|
||||||
, coq, mathcomp, mathcomp-finmap, mathcomp-bigenough }:
|
, coq, mathcomp, mathcomp-finmap, mathcomp-bigenough }:
|
||||||
with lib; mkCoqDerivation {
|
|
||||||
|
let
|
||||||
|
inherit (lib) licenses maintainers switch;
|
||||||
|
inherit (lib.versions) range;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkCoqDerivation {
|
||||||
/* namePrefix leads to e.g. `name = coq8.11-mathcomp1.11-multinomials-1.5.2` */
|
/* namePrefix leads to e.g. `name = coq8.11-mathcomp1.11-multinomials-1.5.2` */
|
||||||
namePrefix = [ "coq" "mathcomp" ];
|
namePrefix = [ "coq" "mathcomp" ];
|
||||||
pname = "multinomials";
|
pname = "multinomials";
|
||||||
|
|
|
@ -47,9 +47,8 @@ without having to know its implementation details.
|
||||||
```nix
|
```nix
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkIf mkOption types;
|
||||||
cfg = config.programs.man;
|
cfg = config.programs.man;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
@ -104,9 +104,8 @@ functions system environment substitution should *not* be disabled explicitly.
|
||||||
```nix
|
```nix
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) concatStringsSep mkIf mkOption optionalString types;
|
||||||
cfg = config.services.locate;
|
cfg = config.services.locate;
|
||||||
in {
|
in {
|
||||||
options.services.locate = {
|
options.services.locate = {
|
||||||
|
@ -163,9 +162,7 @@ in {
|
||||||
::: {#exec-escaping-example .example}
|
::: {#exec-escaping-example .example}
|
||||||
### Escaping in Exec directives
|
### Escaping in Exec directives
|
||||||
```nix
|
```nix
|
||||||
{ config, lib, pkgs, utils, ... }:
|
{ config, pkgs, utils, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.echo;
|
cfg = config.services.echo;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user