Remove top level with lib; in docs (#293829)

This commit is contained in:
Philip Taron 2024-03-06 13:35:43 -08:00 committed by GitHub
parent ff352fc505
commit 86ae7a6243
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 9 deletions

View file

@ -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 {

View file

@ -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";

View file

@ -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

View file

@ -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;