wiki/_next/data/Ie9t5zutrXP6Of75Cb5xF/tools.nix.derivations.json

1 line
4.6 KiB
JSON
Raw Permalink Normal View History

2022-07-29 15:41:17 +00:00
{"pageProps":{"metadata":{"date":"2021-07-18 23:16:39 +08:00","date_modified":"2021-12-28 00:16:07 +08:00","language":"en","source":""},"title":"Nix derivations","hast":{"type":"root","children":[{"type":"element","tagName":"nav","properties":{"className":"toc"},"children":[{"type":"element","tagName":"ol","properties":{"className":"toc-level toc-level-1"},"children":[]}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Derivations are recipes for the Nix build daemon how to build the package.\nAt a glance, this is the equivalent to manifests from "},{"type":"element","tagName":"a","properties":{"href":"/packages.flatpak"},"children":[{"type":"text","value":"Flatpak packages"}]},{"type":"text","value":" or Guix packages.\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The following code block shows what a derivation looks like.\n"}]},{"type":"element","tagName":"pre","properties":{"className":["src-block"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-bash"]},"children":[{"type":"text","value":"nix show-derivation nixpkgs#hello\n"}]}]},{"type":"element","tagName":"div","properties":{"className":["exampe"]},"children":[{"type":"text","value":"{\n \"/nix/store/vvb4wxmnjixmrkhmj2xb75z62hrr41i7-hello-2.10.drv\": {\n \"outputs\": {\n \"out\": {\n \"path\": \"/nix/store/xcp9cav49dmsjbwdjlmkjxj10gkpx553-hello-2.10\"\n }\n },\n \"inputSrcs\": [\n \"/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh\"\n ],\n \"inputDrvs\": {\n \"/nix/store/127p1886lb1q7x02wyy77ib9ghhc324v-hello-2.10.tar.gz.drv\": [\n \"out\"\n ],\n \"/nix/store/4lzwc3wzbqjq973psxkph8jjq4g6cssr-stdenv-linux.drv\": [\n \"out\"\n ],\n \"/nix/store/js6ib8zv84knb7kwnjdrqgwf86djjblk-bash-5.1-p12.drv\": [\n \"out\"\n ]\n },\n \"system\": \"x86_64-linux\",\n \"builder\": \"/nix/store/a54wrar1jym1d8yvlijq0l2gghmy8szz-bash-5.1-p12/bin/bash\",\n \"args\": [\n \"-e\",\n \"/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh\"\n ],\n \"env\": {\n \"buildInputs\": \"\",\n \"builder\": \"/nix/store/a54wrar1jym1d8yvlijq0l2gghmy8szz-bash-5.1-p12/bin/bash\",\n \"configureFlags\": \"\",\n \"depsBuildBuild\": \"\",\n \"depsBuildBuildPropagated\": \"\",\n \"depsBuildTarget\": \"\",\n \"depsBuildTargetPropagated\": \"\",\n \"depsHostHost\": \"\",\n \"depsHostHostPropagated\": \"\",\n \"depsTargetTarget\": \"\",\n \"depsTargetTargetPropagated\": \"\",\n \"doCheck\": \"1\",\n \"doInstallCheck\": \"\",\n \"name\": \"hello-2.10\",\n \"nativeBuildInputs\": \"\",\n \"out\": \"/nix/store/xcp9cav49dmsjbwdjlmkjxj10gkpx553-hello-2.10\",\n \"outputs\": \"out\",\n \"patches\": \"\",\n \"pname\": \"hello\",\n \"propagatedBuildInputs\": \"\",\n \"propagatedNativeBuildInputs\": \"\",\n \"src\": \"/nix/store/3x7dwzq014bblazs7kq20p9hyzz0qh8g-hello-2.10.tar.gz\",\n \"stdenv\": \"/nix/store/xcmlbsqabmckx42p8w18ri5zq8v2iiav-stdenv-linux\",\n \"strictDeps\": \"\",\n \"system\": \"x86_64-linux\",\n \"version\": \"2.10\"\n }\n }\n}\n"}]},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"While we can create derivations with the "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"derivations"}]},{"type":"text","value":" builtin from the "},{"type":"element","tagName":"a","properties":{"href":"/lang.nix"},"children":[{"type":"text","value":"Nix language"}]},{"type":"text","value":", in practice you'll use "},{"type":"element","tagName":"code","properties":{"className":["inline-verbatim"]},"children":[{"type":"text","value":"stdenv.mkDerivation"}]},{"type":"text","value":" from nixpkgs standard library.\n"}]},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"element","tagName":"li","properties":{},"children