{"id":320876,"date":"2021-04-05T15:00:22","date_gmt":"2021-04-05T15:00:22","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320876"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320876","title":{"rendered":"Nix: \u0427\u0442\u043e \u044d\u0442\u043e \u0438 \u0441 \u0447\u0435\u043c \u044d\u0442\u043e \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0442\u044c?"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j9\/8s\/6i\/j98s6ihkbvnfyxqr_dui7-hmo-m.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0432 Typeable \u0445\u043e\u0442\u0435\u043b\u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a Nix \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 (\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0448\u0430\u0435\u0442) \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u041d\u043e, \u043f\u0440\u043e\u0432\u0435\u0434\u044f \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0437\u0434\u0435\u0441\u044c, \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043d\u0435\u0442 \u0442\u043e\u043b\u043a\u043e\u0432\u043e\u0433\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 Nix, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/en\/post\/281611\/\">\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0442 @snizovtsev<\/a> \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043a\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 C++, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u0438\u0434\u0435\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u0430\u043c \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b\u044b \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/typeable\/blog-posts-ru\/tree\/main\/Nix_Intro\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"gde-eto-vsyo-vzyat\">\u0413\u0434\u0435 \u044d\u0442\u043e \u0432\u0441\u0451 \u0432\u0437\u044f\u0442\u044c?<\/h2>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e NixOS, \u0433\u0434\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e, Nix \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 (\u0438\u043b\u0438 \u043f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u043e\u0439) \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432 Linux. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ sh &lt;(curl -L https:\/\/nixos.org\/nix\/install)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u044c\u0448\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0441\u0430\u043c \u0432\u0441\u0451 \u0441\u0434\u0435\u043b\u0430\u0435\u0442. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 MacOS, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432 \u043d\u0435\u0439 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0441\u043b\u043e\u0436\u043d\u0438\u043b\u0430\u0441\u044c, \u0440\u0430\u043d\u044c\u0448\u0435 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0448\u0435. \u041f\u0440\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 MacOS \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c <a href=\"https:\/\/nixos.org\/manual\/nix\/stable\/#sect-macos-installation\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"yazyk-nix\">\u042f\u0437\u044b\u043a Nix<\/h2>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e Nix, \u0447\u0430\u0441\u0442\u043e \u0438\u043c\u0435\u044e\u0442 \u0432 \u0432\u0438\u0434\u0443 \u0434\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438: Nix \u043a\u0430\u043a \u044f\u0437\u044b\u043a \u0438 nixpkgs \u043a\u0430\u043a \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0441\u043d\u043e\u0432\u0443 NixOS. \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e.<\/p>\n<p>  <\/p>\n<p>Nix \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u0435\u043d\u0438\u0432\u044b\u0439 \u044f\u0437\u044b\u043a \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u044f\u0437\u044b\u043a\u0438 \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 ML (SML, OCaml, Haskell), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u0442\u0435\u0445, \u043a\u0442\u043e \u0441 \u043d\u0438\u043c\u0438 \u0437\u043d\u0430\u043a\u043e\u043c, \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u044f\u0437\u044b\u043a\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ nix repl Welcome to Nix version 2.3.10. Type :? for help.  nix-repl&gt; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 Nix \u043d\u0435\u0442. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435, \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">nix-repl&gt; &quot;Hello &quot; + &quot;World!&quot; &quot;Hello World!&quot;  nix-repl&gt; add = a: b: a + b  nix-repl&gt; add 1 2 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u044f\u0437\u044b\u043a\u0430\u0445, \u043f\u043e\u0432\u043b\u0438\u044f\u0432\u0448\u0438\u0445 \u043d\u0430 Nix, \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u0430\u0440\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">nix-repl&gt; addOne = add 1  nix-repl&gt; addOne 3 4<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0447\u0438\u0441\u043b\u0430 \u0438 \u0441\u0442\u0440\u043e\u043a\u0438, Nix \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043a\u0438 \u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 (attribute sets \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Nix).<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">nix-repl&gt; list = [ 1 2 3 ]  nix-repl&gt; set = { a = 1; b = list; }       nix-repl&gt; set { a = 1; b = [ ... ]; }  nix-repl&gt; set.b [ 1 2 3 ]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>let...in<\/code>. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0430\u044f \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>  <\/p>\n<p><code>fac.nix<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">let   fac = n:     if n == 0     then 1     else n * fac (n - 1); in { inherit fac; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>inherit<\/code> \u0432\u043d\u043e\u0441\u0438\u0442 \u0438\u043b\u0438 &quot;\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442&quot; \u0442\u0435\u0440\u043c\u0438\u043d \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0434\u0430\u0451\u0442 \u0435\u043c\u0443 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0438\u043c\u044f. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0437\u0430\u043f\u0438\u0441\u0438 <code>let fac = ... in { fac = fac; }<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ nix repl fac.nix Welcome to Nix version 2.3.10. Type :? for help.  Loading 'fac.nix'... Added 1 variables.  nix-repl&gt; fac 3  6<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 REPL, Nix \u043e\u0436\u0438\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0443\u0434\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 Nix \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>import<\/code>, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441 \u043a\u043e\u0434\u043e\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<p><code>mul.nix<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">let   mul = a: b: a * b; in { inherit mul; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u044b\u0439 <code>fac.nix<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">let   multMod = import .\/mul.nix;   fac = n:     if n == 0     then 1     else multMod.mul n (fac (n - 1)); in { inherit fac; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u2014 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u0430\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043b\u0435\u043f\u043e, \u043f\u0440\u0430\u0432\u0434\u0430? \u0412 Nix \u0435\u0441\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 <code>with<\/code>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0432 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u0430 \u0438\u0437 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<\/p>\n<p>  <\/p>\n<p><code>fac.nix<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>with<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">with import .\/mul.nix; let   fac = n:     if n == 0     then 1     else mul n (fac (n - 1)); in { inherit fac; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"sborka-programm\">\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c<\/h2>\n<p>  <\/p>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044f\u0437\u044b\u043a\u0430 Nix.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>Derivation<\/code>. \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 <code>Derivation<\/code> \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0440\u0435\u0446\u0435\u043f\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e-\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u043c \u0432\u0438\u0434\u0435. \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 C, \u0432\u044b\u0432\u043e\u0434\u044f\u0449\u0435\u0439 &quot;Hello World!&quot;, derivation \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Derive([(&quot;out&quot;,&quot;\/nix\/store\/1nq46fyv3629slgxnagqn2c01skp7xrq-hello-world&quot;,&quot;&quot;,&quot;&quot;)],[(&quot;\/nix\/store\/60xqp516mkfhf31n6ycyvxppcknb2dwr-build-hello.drv&quot;,[&quot;out&quot;])],[&quot;\/nix\/store\/wiviq2xyz0ylhl0qcgfgl9221nkvvxfj-hello.c&quot;],&quot;x86_64-linux&quot;,&quot;\/nix\/store\/r5lh8zg768swlm9hxxfrf9j8gwyadi72-build-hello&quot;,[],[(&quot;builder&quot;,&quot;\/nix\/store\/r5lh8zg768swlm9hxxfrf9j8gwyadi72-build-hello&quot;),(&quot;name&quot;,&quot;hello-world&quot;),(&quot;out&quot;,&quot;\/nix\/store\/1nq46fyv3629slgxnagqn2c01skp7xrq-hello-world&quot;),(&quot;src&quot;,&quot;\/nix\/store\/wiviq2xyz0ylhl0qcgfgl9221nkvvxfj-hello.c&quot;),(&quot;system&quot;,&quot;x86_64-linux&quot;)])<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0432 \u044d\u0442\u043e\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u0443\u0442\u044c \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u0441\u0431\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0443\u0442\u0438 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c, \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0441\u0431\u043e\u0440\u043a\u0438, \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435: \u0438\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430. \u0421\u0442\u043e\u0438\u0442 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0443\u0442\u0438 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 <code>\/nix\/store<\/code>. \u041f\u0440\u0438 \u0441\u0431\u043e\u0440\u043a\u0435, Nix \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0451 \u043d\u0443\u0436\u043d\u043e\u0435 \u0432 \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 (sandbox). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0438 \u0432\u0441\u0435\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043d\u0438\u043a\u0442\u043e \u0432 \u0437\u0434\u0440\u0430\u0432\u043e\u043c \u0443\u043c\u0435 \u0440\u0443\u043a\u0430\u043c\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442! \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0432 Nix \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>derivation<\/code>, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><code>simple-derivation\/default.nix<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">{ pkgs ? import &lt;nixpkgs&gt; {} }:  derivation {   name = &quot;hello-world&quot;;   builder = pkgs.writeShellScript &quot;build-hello&quot; ''     ${pkgs.coreutils}\/bin\/mkdir -p $out\/bin     ${pkgs.gcc}\/bin\/gcc $src -o $out\/bin\/hello -O2   '';   src = .\/hello.c;   system = builtins.currentSystem; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440. \u0412\u0435\u0441\u044c \u0444\u0430\u0439\u043b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0451\u0442 \u043e\u0434\u0438\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2014 \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u043b\u0435 <code>pkgs<\/code>. \u0415\u0441\u043b\u0438 \u043e\u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e: <code>import &lt;nixpkgs&gt; {}<\/code>.<\/p>\n<p>  <\/p>\n<p><code>derivation<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0438: <code>name<\/code> \u2014 \u0438\u043c\u044f \u043f\u0430\u043a\u0435\u0442\u0430, <code>builder<\/code> \u2014 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, <code>src<\/code> \u2014 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434, <code>system<\/code> \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0438\u0441\u0442\u0435\u043c, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0441\u0431\u043e\u0440\u043a\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.<\/p>\n<p>  <\/p>\n<p><code>writeShellScript<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0437 <code>nixpkgs<\/code>, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u0438\u043c\u044f \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u043a\u043e\u0434 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u044f \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443. \u0414\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0432 Nix \u0435\u0441\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0438 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a.<\/p>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>nix build<\/code>, \u044d\u0442\u043e\u0442 \u0440\u0435\u0446\u0435\u043f\u0442 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ nix build -f .\/simple-derivation\/default.nix [1 built]  $ .\/result\/bin\/hello  Hello World!<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 <code>nix build<\/code>, \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 <code>result<\/code>, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0432 <code>\/nix\/store<\/code> \u043f\u0430\u043a\u0435\u0442.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ ls -l result  lrwxrwxrwx 1 user users 50 Mar 29 17:53 result -&gt; \/nix\/store\/vpcddray35g2jrv40dg1809xrmz73awi-simple  $ find \/nix\/store\/vpcddray35g2jrv40dg1809xrmz73awi-simple \/nix\/store\/vpcddray35g2jrv40dg1809xrmz73awi-simple \/nix\/store\/vpcddray35g2jrv40dg1809xrmz73awi-simple\/bin \/nix\/store\/vpcddray35g2jrv40dg1809xrmz73awi-simple\/bin\/hello<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"sborka-programm-prodvinutaya-versiya\">\u0421\u0431\u043e\u0440\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f<\/h2>\n<p>  <\/p>\n<p><code>derivation<\/code> \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u0430 \u0431\u0430\u0437\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432 Nix \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0449\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u044b. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b <code>cowsay<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">{ lib, stdenv, fetchurl, perl }:  stdenv.mkDerivation rec {   version = &quot;3.03+dfsg2&quot;;   pname = &quot;cowsay&quot;;    src = fetchurl {     url = &quot;http:\/\/http.debian.net\/debian\/pool\/main\/c\/cowsay\/cowsay_${version}.orig.tar.gz&quot;;     sha256 = &quot;0ghqnkp8njc3wyqx4mlg0qv0v0pc996x2nbyhqhz66bbgmf9d29v&quot;;   };    buildInputs = [ perl ];    postBuild = ''     substituteInPlace cowsay --replace &quot;%BANGPERL%&quot; &quot;!${perl}\/bin\/perl&quot; \\       --replace &quot;%PREFIX%&quot; &quot;$out&quot;   '';    installPhase = ''     mkdir -p $out\/{bin,man\/man1,share\/cows}     install -m755 cowsay $out\/bin\/cowsay     ln -s cowsay $out\/bin\/cowthink     install -m644 cowsay.1 $out\/man\/man1\/cowsay.1     ln -s cowsay.1 $out\/man\/man1\/cowthink.1     install -m644 cows\/* -t $out\/share\/cows\/   '';    meta = with lib; {     description = &quot;A program which generates ASCII pictures of a cow with a message&quot;;     homepage = &quot;https:\/\/en.wikipedia.org\/wiki\/Cowsay&quot;;     license = licenses.gpl1;     platforms = platforms.all;     maintainers = [ maintainers.rob ];   }; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/github.com\/NixOS\/nixpkgs\/blob\/master\/pkgs\/tools\/misc\/cowsay\/default.nix\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<p><code>stdenv<\/code> \u2014 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 <code>derivation<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b: \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0444\u043b\u0430\u0433\u0438 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u2014 \u0433\u0438\u0433\u0430\u043d\u0442\u0441\u043a\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u0431\u0430\u0448\u0435 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>setup<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0440\u043e\u043b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 <code>builder<\/code> \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\"> $ nix build nixpkgs.stdenv   $ find result\/ result\/ result\/setup result\/nix-support  $ wc -l result\/setup  1330 result\/setup<\/code><\/pre>\n<p>  <\/p>\n<p><code>mkDerivation<\/code> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0430\u044f <code>derivation<\/code> \u0441 \u044d\u0442\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438 \u0437\u0430\u043e\u0434\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0430\u044f \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438, \u043a\u0442\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0432 Arch Linux \u0438\u043b\u0438 Gentoo, \u043c\u043e\u0433\u0443\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u041a\u0430\u043a \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445, \u0441\u0431\u043e\u0440\u043a\u0430 \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 \u0444\u0430\u0437\u044b, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (<code>buildInputs<\/code>) \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"zaklyuchenie\">\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Nix \u043a\u0430\u043a \u044f\u0437\u044b\u043a\u043e\u043c \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043a\u043e\u0434\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c Nix \u0432 Typeable, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442. Stay tuned!<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 Nix \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/nixos.org\/guides\/nix-pills\/\">Nix pills<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/typeable\/blog\/550860\/\"> https:\/\/habr.com\/ru\/company\/typeable\/blog\/550860\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j9\/8s\/6i\/j98s6ihkbvnfyxqr_dui7-hmo-m.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0432 Typeable \u0445\u043e\u0442\u0435\u043b\u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0446\u0438\u043a\u043b \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a Nix \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 (\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0448\u0430\u0435\u0442) \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. \u041d\u043e, \u043f\u0440\u043e\u0432\u0435\u0434\u044f \u043d\u0435\u043c\u043d\u043e\u0436\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u0430\u0445 \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0437\u0434\u0435\u0441\u044c, \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043d\u0435\u0442 \u0442\u043e\u043b\u043a\u043e\u0432\u043e\u0433\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 Nix, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0441\u043b\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/en\/post\/281611\/\">\u0421\u0442\u0430\u0442\u044c\u044f \u043e\u0442 @snizovtsev<\/a> \u043f\u043e\u0434\u043e\u0439\u0434\u0451\u0442 \u043a\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 C++, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u043e \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0432\u0438\u0434\u0435\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0433\u043e \u0441\u0430\u043c \ud83d\ude42<\/p>\n<p>  <\/p>\n<p>\u0424\u0430\u0439\u043b\u044b \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/github.com\/typeable\/blog-posts-ru\/tree\/main\/Nix_Intro\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320876","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320876","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320876"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320876\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}