mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
doc: update Nix code snippets format
Command: `mdcr --config doc/tests/mdcr-config.toml doc/`
This commit is contained in:
parent
5d979e79ce
commit
bcea0cf344
86 changed files with 2485 additions and 1478 deletions
|
@ -63,17 +63,27 @@ For example, the `fetchFromGitHub` is commonly used within Nixpkgs but should be
|
|||
`nix:fod` properties may be extracted and evaluated to a derivation using code similar to the following, assuming a fictitious function `filterPropertiesToAttrs`:
|
||||
|
||||
```nix
|
||||
{ pkgs, filterPropertiesToAttrs, properties }:
|
||||
{
|
||||
pkgs,
|
||||
filterPropertiesToAttrs,
|
||||
properties,
|
||||
}:
|
||||
let
|
||||
fodProps = filterPropertiesToAttrs "nix:fod:" properties;
|
||||
|
||||
methods = {
|
||||
fetchzip =
|
||||
{ name, url, sha256, ... }:
|
||||
{
|
||||
name,
|
||||
url,
|
||||
sha256,
|
||||
...
|
||||
}:
|
||||
pkgs.fetchzip {
|
||||
inherit name url sha256;
|
||||
};
|
||||
};
|
||||
|
||||
in methods.${fodProps.method} fodProps
|
||||
in
|
||||
methods.${fodProps.method} fodProps
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue