mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-09-11 15:26:03 +03:00
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:
|
||||
|
||||
```nix
|
||||
with lib;
|
||||
let
|
||||
inherit (lib) generators isString;
|
||||
|
||||
customToINI = generators.toINI {
|
||||
# specifies how to format a key/value pair
|
||||
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
|
||||
{ lib, mkCoqDerivation, version ? null
|
||||
, 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 = [ "coq" "mathcomp" ];
|
||||
pname = "multinomials";
|
||||
|
@ -47,9 +47,8 @@ without having to know its implementation details.
|
||||
```nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkOption types;
|
||||
cfg = config.programs.man;
|
||||
in
|
||||
|
||||
|
@ -104,9 +104,8 @@ functions system environment substitution should *not* be disabled explicitly.
|
||||
```nix
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
inherit (lib) concatStringsSep mkIf mkOption optionalString types;
|
||||
cfg = config.services.locate;
|
||||
in {
|
||||
options.services.locate = {
|
||||
@ -163,9 +162,7 @@ in {
|
||||
::: {#exec-escaping-example .example}
|
||||
### Escaping in Exec directives
|
||||
```nix
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
|
||||
with lib;
|
||||
{ config, pkgs, utils, ... }:
|
||||
|
||||
let
|
||||
cfg = config.services.echo;
|
||||
|
Loading…
Reference in New Issue
Block a user