Offset 1, 13 lines modified | Offset 1, 13 lines modified |
1 | <?xml·version="1.0"·encoding="UTF-8"?> | 1 | <?xml·version="1.0"·encoding="UTF-8"?> |
2 | <!DOCTYPE·html·PUBLIC·"-//W3C//DTD·XHTML·1.0·Transitional//EN"·"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html·xmlns="http://www.w3.org/1999/xhtml"><head><meta·http-equiv="Content-Type"·content="text/html;·charset=UTF-8"·/><title>Nix·Package·Manager·Guide</title><meta·name="generator"·content="DocBook·XSL·Stylesheets·V1.79.2"·/></head><body><div·class="book"><div·class="titlepage"><div><div><h1·class="title"><a·id="idm140737349398208"></a>Nix·Package·Manager·Guide</h1></div><div><h2·class="subtitle">Version·3.0pre20200829_f156513</h2></div><div><div·class="author"><h3·class="author"><span·class="firstname">Eelco</span>·<span·class="surname">Dolstra</span></h3></div></div><div><p·class="copyright">Copyright·©·2004-2018·Eelco·Dolstra</p></div></div><hr·/></div><div·class="toc"><dl·class="toc"><dt><span·class="part"><a·href="#chap-introduction">I.·Introduction</a></span></dt><dd><dl><dt><span·class="chapter"><a·href="#ch-about-nix">1.·About·Nix</a></span></dt><dt><span·class="chapter"><a·href="#chap-quick-start">2.·Quick·Start</a></span></dt></dl></dd><dt><span·class="part"><a·href="#chap-installation">II.·Installation</a></span></dt><dd><dl><dt><span·class="chapter"><a·href="#ch-supported-platforms">3.·Supported·Platforms</a></span></dt><dt><span·class="chapter"><a·href="#ch-installing-binary">4.·Installing·a·Binary·Distribution</a></span></dt><dd><dl><dt><span·class="section"><a·href="#sect-single-user-installation">4.1.·Single·User[·...·truncated·by·diffoscope;·len:·6008,·SHA1:·85c1b45e29b90a9f92222d4b918e80a3b5ac42fc·...·]04">18.1.· | 2 | <!DOCTYPE·html·PUBLIC·"-//W3C//DTD·XHTML·1.0·Transitional//EN"·"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html·xmlns="http://www.w3.org/1999/xhtml"><head><meta·http-equiv="Content-Type"·content="text/html;·charset=UTF-8"·/><title>Nix·Package·Manager·Guide</title><meta·name="generator"·content="DocBook·XSL·Stylesheets·V1.79.2"·/></head><body><div·class="book"><div·class="titlepage"><div><div><h1·class="title"><a·id="idm140737349402320"></a>Nix·Package·Manager·Guide</h1></div><div><h2·class="subtitle">Version·3.0pre20200829_f156513</h2></div><div><div·class="author"><h3·class="author"><span·class="firstname">Eelco</span>·<span·class="surname">Dolstra</span></h3></div></div><div><p·class="copyright">Copyright·©·2004-2018·Eelco·Dolstra</p></div></div><hr·/></div><div·class="toc"><dl·class="toc"><dt><span·class="part"><a·href="#chap-introduction">I.·Introduction</a></span></dt><dd><dl><dt><span·class="chapter"><a·href="#ch-about-nix">1.·About·Nix</a></span></dt><dt><span·class="chapter"><a·href="#chap-quick-start">2.·Quick·Start</a></span></dt></dl></dd><dt><span·class="part"><a·href="#chap-installation">II.·Installation</a></span></dt><dd><dl><dt><span·class="chapter"><a·href="#ch-supported-platforms">3.·Supported·Platforms</a></span></dt><dt><span·class="chapter"><a·href="#ch-installing-binary">4.·Installing·a·Binary·Distribution</a></span></dt><dd><dl><dt><span·class="section"><a·href="#sect-single-user-installation">4.1.·Single·User[·...·truncated·by·diffoscope;·len:·6008,·SHA1:·198c8ab6da528ea5e88b2f0edaf3f9e89db3867f·...·]04">18.1.· |
3 | ····Spot-Checking·Build·Determinism | 3 | ····Spot-Checking·Build·Determinism |
4 | ··</a></span></dt><dt><span·class="section"><a·href="#idm140737321134912">18.2.· | 4 | ··</a></span></dt><dt><span·class="section"><a·href="#idm140737321137824">18.2.· |
5 | ····Automatic·and·Optionally·Enforced·Determinism·Verification | 5 | ····Automatic·and·Optionally·Enforced·Determinism·Verification |
6 | ··</a></span></dt></dl></dd><dt><span·class="chapter"><a·href="#chap-post-build-hook">19.·Using·the·<code·class="option"><a·class="option"·href="#conf-post-build-hook">post-build-hook</a></code></a></span></dt><dd><dl><dt><span·class="section"><a·href="#chap-post-build-hook-caveats">19.1.·Implementation·Caveats</a></span></dt><dt><span·class="section"><a·href="#idm140737321121088">19.2.·Prerequisites</a></span></dt><dt><span·class="section"><a·href="#idm140737321118688">19.3.·Set·up·a·Signing·Key</a></span></dt><dt><span·class="section"><a·href="#idm140737321113248">19.4.·Implementing·the·build·hook</a></span></dt><dt><span·class="section"><a·href="#idm140737321106336">19.5.·Updating·Nix·Configuration</a></span></dt><dt><span·class="section"><a·href="#idm140737321103312">19.6.·Testing</a></span></dt><dt><span·class="section"><a·href="#idm140737321098384">19.7.·Conclusion</a></span></dt></dl></dd></dl></dd><dt><span·class="part"><a·href="#part-command-ref">VI.·Command·Reference</a></span></dt><dd><dl><dt><span·class="chapter"><a·href="#sec-common-options">20.·Common·Options</a></span></dt><dt><span·class="chapter"><a·href="#sec-common-env">21.·Common·Environment·Variables</a></span></dt><dt><span·class="chapter"><a·href="#ch-main-commands">22.·Main·Commands</a></span></dt><dd><dl><dt><span·class="refentrytitle"><a·href="#sec-nix-env">nix-env</a></span><span·class="refpurpose">·—·manipulate·or·query·Nix·user·environments</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-build">nix-build</a></span><span·class="refpurpose">·—·build·a·Nix·expression</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-shell">nix-shell</a></span><span·class="refpurpose">·—·start·an·interactive·shell·based·on·a·Nix·expression</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-store">nix-store</a></span><span·class="refpurpose">·—·manipulate·or·query·the·Nix·store</span></dt></dl></dd><dt><span·class="chapter"><a·href="#ch-utilities">23.·Utilities</a></span></dt><dd><dl><dt><span·class="refentrytitle"><a·href="#sec-nix-channel">nix-channel</a></span><span·class="refpurpose">·—·manage·Nix·channels</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-collect-garbage">nix-collect-garbage</a></span><span·class="refpurpose">·—·delete·unreachable·store·paths</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-copy-closure">nix-copy-closure</a></span><span·class="refpurpose">·—·copy·a·closure·to·or·from·a·remote·machine·via·SSH</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-daemon">nix-daemon</a></span><span·class="refpurpose">·—·Nix·multi-user·support·daemon</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-hash">nix-hash</a></span><span·class="refpurpose">·—·compute·the·cryptographic·hash·of·a·path</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-instantiate">nix-instantiate</a></span><span·class="refpurpose">·—·instantiate·store·derivations·from·Nix·expressions</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-prefetch-url">nix-prefetch-url</a></span><span·class="refpurpose">·—·copy·a·file·from·a·URL·into·the·store·and·print·its·hash</span></dt></dl></dd><dt><span·class="chapter"><a·href="#ch-files">24.·Files</a></span></dt><dd><dl><dt><span·class="refentrytitle"><a·href="#sec-conf-file">nix.conf</a></span><span·class="refpurpose">·—·Nix·configuration·file</span></dt></dl></dd></dl></dd><dt><span·class="appendix"><a·href="#part-glossary">A.·Glossary</a></span></dt><dt><span·class="appendix"><a·href="#chap-hacking">B.·Hacking</a></span></dt><dt><span·class="appendix"><a·href="#sec-relnotes">C.·Nix·Release·Notes</a></span></dt><dd><dl><dt><span·class="section"><a·href="#ssec-relnotes-2.3">C.1.·Release·2.3·(2019-09-04)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-2.2">C.2.·Release·2.2·(2019-01-11)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-2.1">C.3.·Release·2.1·(2018-09-02)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-2.0">C.4.·Release·2.0·(2018-02-22)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.11.10">C.5.·Release·1.11.10·(2017-06-12)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.11">C.6.·Release·1.11·(2016-01-19)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.10">C.7.·Release·1.10·(2015-09-03)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.9">C.8.·Release·1.9·(2015-06-12)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.8">C.9.·Release·1.8·(2014-12-14)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.7">C.10.·Release·1.7·(2014-04-11)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.6.1">C.11.·Release·1.6.1·(2013-10-28)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.6.0">C.12.·Release·1.6·(2013-09-10)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.5.2">C.13.·Release·1.5.2·(2013-05-13)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.5">C.14.·Release·1.5·(2013-02-27)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.4">C.15.·Release·1.4·(2013-02-26)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.3">C.16.·Release·1.3·(2013-01-04)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.2">C.17.·Release·1.2·(2012-12-06)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.1">C.18.·Release·1.1·(2012-07-18)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.0">C.19.·Release·1.0·(2012-05-11)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.16">C.20.·Release·0.16·(2010-08-17)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.15">C.21.·Release·0.15·(2010-03-17)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.14">C.22.·Release·0.14·(2010-02-04)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.13">C.23.·Release·0.13·(2009-11-05)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.12">C.24.·Release·0.12·(2008-11-20)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.11">C.25.·Release·0.11·(2007-12-31)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.10.1">C.26.·Release·0.10.1·(2006-10-11)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.10">C.27.·Release·0.10·(2006-10-06)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.9.2">C.28.·Release·0.9.2·(2005-09-21)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.9.1">C.29.·Release·0.9.1·(2005-09-20)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.9">C.30.·Release·0.9·(2005-09-16)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.8.1">C.31.·Release·0.8.1·(2005-04-13)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.8">C.32.·Release·0.8·(2005-04-11)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.7">C.33.·Release·0.7·(2005-01-12)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.6">C.34.·Release·0.6·(2004-11-14)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.5">C.35.·Release·0.5·and·earlier</a></span></dt></dl></dd></dl></div><div·class="part"><div·class="titlepage"><div><div><h1·class="title"><a·id="chap-introduction"></a>Part I. Introduction</h1></div></div></div><div·class="chapter"><div·class="titlepage"><div><div><h2·class="title"><a·id="ch-about-nix"></a>Chapter 1. About·Nix</h2></div></div></div><p>Nix·is·a·<span·class="emphasis"><em>purely·functional·package·manager</em></span>. | 6 | ··</a></span></dt></dl></dd><dt><span·class="chapter"><a·href="#chap-post-build-hook">19.·Using·the·<code·class="option"><a·class="option"·href="#conf-post-build-hook">post-build-hook</a></code></a></span></dt><dd><dl><dt><span·class="section"><a·href="#chap-post-build-hook-caveats">19.1.·Implementation·Caveats</a></span></dt><dt><span·class="section"><a·href="#idm140737321124000">19.2.·Prerequisites</a></span></dt><dt><span·class="section"><a·href="#idm140737321121600">19.3.·Set·up·a·Signing·Key</a></span></dt><dt><span·class="section"><a·href="#idm140737321116112">19.4.·Implementing·the·build·hook</a></span></dt><dt><span·class="section"><a·href="#idm140737321109200">19.5.·Updating·Nix·Configuration</a></span></dt><dt><span·class="section"><a·href="#idm140737321106176">19.6.·Testing</a></span></dt><dt><span·class="section"><a·href="#idm140737321101184">19.7.·Conclusion</a></span></dt></dl></dd></dl></dd><dt><span·class="part"><a·href="#part-command-ref">VI.·Command·Reference</a></span></dt><dd><dl><dt><span·class="chapter"><a·href="#sec-common-options">20.·Common·Options</a></span></dt><dt><span·class="chapter"><a·href="#sec-common-env">21.·Common·Environment·Variables</a></span></dt><dt><span·class="chapter"><a·href="#ch-main-commands">22.·Main·Commands</a></span></dt><dd><dl><dt><span·class="refentrytitle"><a·href="#sec-nix-env">nix-env</a></span><span·class="refpurpose">·—·manipulate·or·query·Nix·user·environments</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-build">nix-build</a></span><span·class="refpurpose">·—·build·a·Nix·expression</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-shell">nix-shell</a></span><span·class="refpurpose">·—·start·an·interactive·shell·based·on·a·Nix·expression</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-store">nix-store</a></span><span·class="refpurpose">·—·manipulate·or·query·the·Nix·store</span></dt></dl></dd><dt><span·class="chapter"><a·href="#ch-utilities">23.·Utilities</a></span></dt><dd><dl><dt><span·class="refentrytitle"><a·href="#sec-nix-channel">nix-channel</a></span><span·class="refpurpose">·—·manage·Nix·channels</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-collect-garbage">nix-collect-garbage</a></span><span·class="refpurpose">·—·delete·unreachable·store·paths</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-copy-closure">nix-copy-closure</a></span><span·class="refpurpose">·—·copy·a·closure·to·or·from·a·remote·machine·via·SSH</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-daemon">nix-daemon</a></span><span·class="refpurpose">·—·Nix·multi-user·support·daemon</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-hash">nix-hash</a></span><span·class="refpurpose">·—·compute·the·cryptographic·hash·of·a·path</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-instantiate">nix-instantiate</a></span><span·class="refpurpose">·—·instantiate·store·derivations·from·Nix·expressions</span></dt><dt><span·class="refentrytitle"><a·href="#sec-nix-prefetch-url">nix-prefetch-url</a></span><span·class="refpurpose">·—·copy·a·file·from·a·URL·into·the·store·and·print·its·hash</span></dt></dl></dd><dt><span·class="chapter"><a·href="#ch-files">24.·Files</a></span></dt><dd><dl><dt><span·class="refentrytitle"><a·href="#sec-conf-file">nix.conf</a></span><span·class="refpurpose">·—·Nix·configuration·file</span></dt></dl></dd></dl></dd><dt><span·class="appendix"><a·href="#part-glossary">A.·Glossary</a></span></dt><dt><span·class="appendix"><a·href="#chap-hacking">B.·Hacking</a></span></dt><dt><span·class="appendix"><a·href="#sec-relnotes">C.·Nix·Release·Notes</a></span></dt><dd><dl><dt><span·class="section"><a·href="#ssec-relnotes-2.3">C.1.·Release·2.3·(2019-09-04)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-2.2">C.2.·Release·2.2·(2019-01-11)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-2.1">C.3.·Release·2.1·(2018-09-02)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-2.0">C.4.·Release·2.0·(2018-02-22)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.11.10">C.5.·Release·1.11.10·(2017-06-12)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.11">C.6.·Release·1.11·(2016-01-19)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.10">C.7.·Release·1.10·(2015-09-03)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.9">C.8.·Release·1.9·(2015-06-12)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.8">C.9.·Release·1.8·(2014-12-14)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.7">C.10.·Release·1.7·(2014-04-11)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.6.1">C.11.·Release·1.6.1·(2013-10-28)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.6.0">C.12.·Release·1.6·(2013-09-10)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.5.2">C.13.·Release·1.5.2·(2013-05-13)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.5">C.14.·Release·1.5·(2013-02-27)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.4">C.15.·Release·1.4·(2013-02-26)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.3">C.16.·Release·1.3·(2013-01-04)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.2">C.17.·Release·1.2·(2012-12-06)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.1">C.18.·Release·1.1·(2012-07-18)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-1.0">C.19.·Release·1.0·(2012-05-11)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.16">C.20.·Release·0.16·(2010-08-17)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.15">C.21.·Release·0.15·(2010-03-17)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.14">C.22.·Release·0.14·(2010-02-04)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.13">C.23.·Release·0.13·(2009-11-05)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.12">C.24.·Release·0.12·(2008-11-20)</a></span></dt><dt><span·class="section"><a·href="#ssec-relnotes-0.11">C.25.·Release·0.11·(2007-12-31)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.10.1">C.26.·Release·0.10.1·(2006-10-11)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.10">C.27.·Release·0.10·(2006-10-06)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.9.2">C.28.·Release·0.9.2·(2005-09-21)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.9.1">C.29.·Release·0.9.1·(2005-09-20)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.9">C.30.·Release·0.9·(2005-09-16)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.8.1">C.31.·Release·0.8.1·(2005-04-13)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.8">C.32.·Release·0.8·(2005-04-11)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.7">C.33.·Release·0.7·(2005-01-12)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.6">C.34.·Release·0.6·(2004-11-14)</a></span></dt><dt><span·class="section"><a·href="#ch-relnotes-0.5">C.35.·Release·0.5·and·earlier</a></span></dt></dl></dd></dl></div><div·class="part"><div·class="titlepage"><div><div><h1·class="title"><a·id="chap-introduction"></a>Part I. Introduction</h1></div></div></div><div·class="chapter"><div·class="titlepage"><div><div><h2·class="title"><a·id="ch-about-nix"></a>Chapter 1. About·Nix</h2></div></div></div><p>Nix·is·a·<span·class="emphasis"><em>purely·functional·package·manager</em></span>. |
7 | This·means·that·it·treats·packages·like·values·in·purely·functional | 7 | This·means·that·it·treats·packages·like·values·in·purely·functional |
8 | programming·languages·such·as·Haskell·—·they·are·built·by·functions | 8 | programming·languages·such·as·Haskell·—·they·are·built·by·functions |
9 | that·don’t·have·side-effects,·and·they·never·change·after·they·have | 9 | that·don’t·have·side-effects,·and·they·never·change·after·they·have |
10 | been·built.··Nix·stores·packages·in·the·<span·class="emphasis"><em>Nix | 10 | been·built.··Nix·stores·packages·in·the·<span·class="emphasis"><em>Nix |
11 | store</em></span>,·usually·the·directory | 11 | store</em></span>,·usually·the·directory |
12 | <code·class="filename">/nix/store</code>,·where·each·package·has·its·own·unique | 12 | <code·class="filename">/nix/store</code>,·where·each·package·has·its·own·unique |
13 | subdirectory·such·as | 13 | subdirectory·such·as |
Offset 15, 23 lines modified | Offset 15, 23 lines modified |
15 | </p><pre·class="programlisting"> | 15 | </p><pre·class="programlisting"> |
16 | /nix/store/b6gvzjyb2pg0kjfwrjmg1vfhh54ad73z-firefox-33.1/ | 16 | /nix/store/b6gvzjyb2pg0kjfwrjmg1vfhh54ad73z-firefox-33.1/ |
17 | </pre><p> | 17 | </pre><p> |
| |
18 | where·<code·class="literal">b6gvzjyb2pg0…</code>·is·a·unique·identifier·for·the | 18 | where·<code·class="literal">b6gvzjyb2pg0…</code>·is·a·unique·identifier·for·the |
19 | package·that·captures·all·its·dependencies·(it’s·a·cryptographic·hash | 19 | package·that·captures·all·its·dependencies·(it’s·a·cryptographic·hash |
20 | of·the·package’s·build·dependency·graph).··This·enables·many·powerful | 20 | of·the·package’s·build·dependency·graph).··This·enables·many·powerful |
21 | features.</p><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322649440"></a>Multiple·versions</h2></div></div></div><p>You·can·have·multiple·versions·or·variants·of·a·package | 21 | features.</p><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322651312"></a>Multiple·versions</h2></div></div></div><p>You·can·have·multiple·versions·or·variants·of·a·package |
22 | installed·at·the·same·time.··This·is·especially·important·when | 22 | installed·at·the·same·time.··This·is·especially·important·when |
23 | different·applications·have·dependencies·on·different·versions·of·the | 23 | different·applications·have·dependencies·on·different·versions·of·the |
24 | same·package·—·it·prevents·the·“DLL·hell”.··Because·of·the·hashing | 24 | same·package·—·it·prevents·the·“DLL·hell”.··Because·of·the·hashing |
25 | scheme,·different·versions·of·a·package·end·up·in·different·paths·in | 25 | scheme,·different·versions·of·a·package·end·up·in·different·paths·in |
26 | the·Nix·store,·so·they·don’t·interfere·with·each·other.</p><p>An·important·consequence·is·that·operations·like·upgrading·or | 26 | the·Nix·store,·so·they·don’t·interfere·with·each·other.</p><p>An·important·consequence·is·that·operations·like·upgrading·or |
27 | uninstalling·an·application·cannot·break·other·applications,·since | 27 | uninstalling·an·application·cannot·break·other·applications,·since |
28 | these·operations·never·“destructively”·update·or·delete·files·that·are | 28 | these·operations·never·“destructively”·update·or·delete·files·that·are |
29 | used·by·other·packages.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322646736"></a>Complete·dependencies</h2></div></div></div><p>Nix·helps·you·make·sure·that·package·dependency·specifications | 29 | used·by·other·packages.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322648608"></a>Complete·dependencies</h2></div></div></div><p>Nix·helps·you·make·sure·that·package·dependency·specifications |
30 | are·complete.··In·general,·when·you’re·making·a·package·for·a·package | 30 | are·complete.··In·general,·when·you’re·making·a·package·for·a·package |
31 | management·system·like·RPM,·you·have·to·specify·for·each·package·what | 31 | management·system·like·RPM,·you·have·to·specify·for·each·package·what |
32 | its·dependencies·are,·but·there·are·no·guarantees·that·this | 32 | its·dependencies·are,·but·there·are·no·guarantees·that·this |
33 | specification·is·complete.··If·you·forget·a·dependency,·then·the | 33 | specification·is·complete.··If·you·forget·a·dependency,·then·the |
34 | package·will·build·and·work·correctly·on·<span·class="emphasis"><em>your</em></span> | 34 | package·will·build·and·work·correctly·on·<span·class="emphasis"><em>your</em></span> |
35 | machine·if·you·have·the·dependency·installed,·but·not·on·the·end | 35 | machine·if·you·have·the·dependency·installed,·but·not·on·the·end |
36 | user's·machine·if·it's·not·there.</p><p>Since·Nix·on·the·other·hand·doesn’t·install·packages·in·“global” | 36 | user's·machine·if·it's·not·there.</p><p>Since·Nix·on·the·other·hand·doesn’t·install·packages·in·“global” |
Offset 41, 32 lines modified | Offset 41, 32 lines modified |
41 | directories·such·as | 41 | directories·such·as |
42 | <code·class="filename">/nix/store/5lbfaxb722zp…-openssl-0.9.8d/include</code>, | 42 | <code·class="filename">/nix/store/5lbfaxb722zp…-openssl-0.9.8d/include</code>, |
43 | so·if·a·package·builds·correctly·on·your·system,·this·is·because·you | 43 | so·if·a·package·builds·correctly·on·your·system,·this·is·because·you |
44 | specified·the·dependency·explicitly.·This·takes·care·of·the·build-time | 44 | specified·the·dependency·explicitly.·This·takes·care·of·the·build-time |
45 | dependencies.</p><p>Once·a·package·is·built,·runtime·dependencies·are·found·by | 45 | dependencies.</p><p>Once·a·package·is·built,·runtime·dependencies·are·found·by |
46 | scanning·binaries·for·the·hash·parts·of·Nix·store·paths·(such·as | 46 | scanning·binaries·for·the·hash·parts·of·Nix·store·paths·(such·as |
47 | <code·class="literal">r8vvq9kq…</code>).··This·sounds·risky,·but·it·works | 47 | <code·class="literal">r8vvq9kq…</code>).··This·sounds·risky,·but·it·works |
48 | extremely·well.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322641520"></a>Multi-user·support</h2></div></div></div><p>Nix·has·multi-user·support.··This·means·that·non-privileged | 48 | extremely·well.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322643392"></a>Multi-user·support</h2></div></div></div><p>Nix·has·multi-user·support.··This·means·that·non-privileged |
49 | users·can·securely·install·software.··Each·user·can·have·a·different | 49 | users·can·securely·install·software.··Each·user·can·have·a·different |
50 | <span·class="emphasis"><em>profile</em></span>,·a·set·of·packages·in·the·Nix·store·that | 50 | <span·class="emphasis"><em>profile</em></span>,·a·set·of·packages·in·the·Nix·store·that |
51 | appear·in·the·user’s·<code·class="envar">PATH</code>.··If·a·user·installs·a | 51 | appear·in·the·user’s·<code·class="envar">PATH</code>.··If·a·user·installs·a |
52 | package·that·another·user·has·already·installed·previously,·the | 52 | package·that·another·user·has·already·installed·previously,·the |
53 | package·won’t·be·built·or·downloaded·a·second·time.··At·the·same·time, | 53 | package·won’t·be·built·or·downloaded·a·second·time.··At·the·same·time, |
54 | it·is·not·possible·for·one·user·to·inject·a·Trojan·horse·into·a | 54 | it·is·not·possible·for·one·user·to·inject·a·Trojan·horse·into·a |
55 | package·that·might·be·used·by·another·user.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322638784"></a>Atomic·upgrades·and·rollbacks</h2></div></div></div><p>Since·package·management·operations·never·overwrite·packages·in | 55 | package·that·might·be·used·by·another·user.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322640656"></a>Atomic·upgrades·and·rollbacks</h2></div></div></div><p>Since·package·management·operations·never·overwrite·packages·in |
56 | the·Nix·store·but·just·add·new·versions·in·different·paths,·they·are | 56 | the·Nix·store·but·just·add·new·versions·in·different·paths,·they·are |
57 | <span·class="emphasis"><em>atomic</em></span>.··So·during·a·package·upgrade,·there·is·no | 57 | <span·class="emphasis"><em>atomic</em></span>.··So·during·a·package·upgrade,·there·is·no |
58 | time·window·in·which·the·package·has·some·files·from·the·old·version | 58 | time·window·in·which·the·package·has·some·files·from·the·old·version |
59 | and·some·files·from·the·new·version·—·which·would·be·bad·because·a | 59 | and·some·files·from·the·new·version·—·which·would·be·bad·because·a |
60 | program·might·well·crash·if·it’s·started·during·that·period.</p><p>And·since·packages·aren’t·overwritten,·the·old·versions·are·still | 60 | program·might·well·crash·if·it’s·started·during·that·period.</p><p>And·since·packages·aren’t·overwritten,·the·old·versions·are·still |
61 | there·after·an·upgrade.··This·means·that·you·can·<span·class="emphasis"><em>roll | 61 | there·after·an·upgrade.··This·means·that·you·can·<span·class="emphasis"><em>roll |
62 | back</em></span>·to·the·old·version:</p><pre·class="screen"> | 62 | back</em></span>·to·the·old·version:</p><pre·class="screen"> |
63 | $·nix-env·--upgrade·<em·class="replaceable"><code>some-packages</code></em> | 63 | $·nix-env·--upgrade·<em·class="replaceable"><code>some-packages</code></em> |
64 | $·nix-env·--rollback | 64 | $·nix-env·--rollback |
65 | </pre></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322634688"></a>Garbage·collection</h2></div></div></div><p>When·you·uninstall·a·package·like·this… | 65 | </pre></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322636560"></a>Garbage·collection</h2></div></div></div><p>When·you·uninstall·a·package·like·this… |
| |
66 | </p><pre·class="screen"> | 66 | </p><pre·class="screen"> |
67 | $·nix-env·--uninstall·firefox | 67 | $·nix-env·--uninstall·firefox |
68 | </pre><p> | 68 | </pre><p> |
| |
69 | the·package·isn’t·deleted·from·the·system·right·away·(after·all,·you | 69 | the·package·isn’t·deleted·from·the·system·right·away·(after·all,·you |
70 | might·want·to·do·a·rollback,·or·it·might·be·in·the·profiles·of·other | 70 | might·want·to·do·a·rollback,·or·it·might·be·in·the·profiles·of·other |
Offset 74, 25 lines modified | Offset 74, 25 lines modified |
74 | <span·class="emphasis"><em>garbage·collector</em></span>: | 74 | <span·class="emphasis"><em>garbage·collector</em></span>: |
| |
75 | </p><pre·class="screen"> | 75 | </p><pre·class="screen"> |
76 | $·nix-collect-garbage | 76 | $·nix-collect-garbage |
77 | </pre><p> | 77 | </pre><p> |
| |
78 | This·deletes·all·packages·that·aren’t·in·use·by·any·user·profile·or·by | 78 | This·deletes·all·packages·that·aren’t·in·use·by·any·user·profile·or·by |
79 | a·currently·running·program.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322631552"></a>Functional·package·language</h2></div></div></div><p>Packages·are·built·from·<span·class="emphasis"><em>Nix·expressions</em></span>, | 79 | a·currently·running·program.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322633424"></a>Functional·package·language</h2></div></div></div><p>Packages·are·built·from·<span·class="emphasis"><em>Nix·expressions</em></span>, |
80 | which·is·a·simple·functional·language.··A·Nix·expression·describes | 80 | which·is·a·simple·functional·language.··A·Nix·expression·describes |
81 | everything·that·goes·into·a·package·build·action·(a·“derivation”): | 81 | everything·that·goes·into·a·package·build·action·(a·“derivation”): |
82 | other·packages,·sources,·the·build·script,·environment·variables·for | 82 | other·packages,·sources,·the·build·script,·environment·variables·for |
83 | the·build·script,·etc.··Nix·tries·very·hard·to·ensure·that·Nix | 83 | the·build·script,·etc.··Nix·tries·very·hard·to·ensure·that·Nix |
84 | expressions·are·<span·class="emphasis"><em>deterministic</em></span>:·building·a·Nix | 84 | expressions·are·<span·class="emphasis"><em>deterministic</em></span>:·building·a·Nix |
85 | expression·twice·should·yield·the·same·result.</p><p>Because·it’s·a·functional·language,·it’s·easy·to·support | 85 | expression·twice·should·yield·the·same·result.</p><p>Because·it’s·a·functional·language,·it’s·easy·to·support |
86 | building·variants·of·a·package:·turn·the·Nix·expression·into·a | 86 | building·variants·of·a·package:·turn·the·Nix·expression·into·a |
87 | function·and·call·it·any·number·of·times·with·the·appropriate | 87 | function·and·call·it·any·number·of·times·with·the·appropriate |
88 | arguments.··Due·to·the·hashing·scheme,·variants·don’t·conflict·with | 88 | arguments.··Due·to·the·hashing·scheme,·variants·don’t·conflict·with |
89 | each·other·in·the·Nix·store.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322627952"></a>Transparent·source/binary·deployment</h2></div></div></div><p>Nix·expressions·generally·describe·how·to·build·a·package·from | 89 | each·other·in·the·Nix·store.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322629824"></a>Transparent·source/binary·deployment</h2></div></div></div><p>Nix·expressions·generally·describe·how·to·build·a·package·from |
90 | source,·so·an·installation·action·like | 90 | source,·so·an·installation·action·like |
| |
91 | </p><pre·class="screen"> | 91 | </p><pre·class="screen"> |
92 | $·nix-env·--install·firefox | 92 | $·nix-env·--install·firefox |
93 | </pre><p> | 93 | </pre><p> |
| |
94 | <span·class="emphasis"><em>could</em></span>·cause·quite·a·bit·of·build·activity,·as·not | 94 | <span·class="emphasis"><em>could</em></span>·cause·quite·a·bit·of·build·activity,·as·not |
Offset 104, 17 lines modified | Offset 104, 17 lines modified |
104 | skip·building·from·source·and·instead·use·a·<span·class="emphasis"><em>binary | 104 | skip·building·from·source·and·instead·use·a·<span·class="emphasis"><em>binary |
105 | cache</em></span>,·a·web·server·that·provides·pre-built·binaries.·For | 105 | cache</em></span>,·a·web·server·that·provides·pre-built·binaries.·For |
106 | instance,·when·asked·to·build | 106 | instance,·when·asked·to·build |
107 | <code·class="literal">/nix/store/b6gvzjyb2pg0…-firefox-33.1</code>·from·source, | 107 | <code·class="literal">/nix/store/b6gvzjyb2pg0…-firefox-33.1</code>·from·source, |
108 | Nix·would·first·check·if·the·file | 108 | Nix·would·first·check·if·the·file |
109 | <code·class="uri">https://cache.nixos.org/b6gvzjyb2pg0….narinfo</code>·exists,·and | 109 | <code·class="uri">https://cache.nixos.org/b6gvzjyb2pg0….narinfo</code>·exists,·and |
110 | if·so,·fetch·the·pre-built·binary·referenced·from·there;·otherwise,·it | 110 | if·so,·fetch·the·pre-built·binary·referenced·from·there;·otherwise,·it |
111 | would·fall·back·to·building·from·source.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322622944"></a>Nix·Packages·collection</h2></div></div></div><p>We·provide·a·large·set·of·Nix·expressions·containing·hundreds·of | 111 | would·fall·back·to·building·from·source.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322624816"></a>Nix·Packages·collection</h2></div></div></div><p>We·provide·a·large·set·of·Nix·expressions·containing·hundreds·of |
112 | existing·Unix·packages,·the·<span·class="emphasis"><em>Nix·Packages | 112 | existing·Unix·packages,·the·<span·class="emphasis"><em>Nix·Packages |
113 | collection</em></span>·(Nixpkgs).</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322621328"></a>Managing·build·environments</h2></div></div></div><p>Nix·is·extremely·useful·for·developers·as·it·makes·it·easy·to | 113 | collection</em></span>·(Nixpkgs).</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322623200"></a>Managing·build·environments</h2></div></div></div><p>Nix·is·extremely·useful·for·developers·as·it·makes·it·easy·to |
114 | automatically·set·up·the·build·environment·for·a·package.·Given·a | 114 | automatically·set·up·the·build·environment·for·a·package.·Given·a |
115 | Nix·expression·that·describes·the·dependencies·of·your·package,·the | 115 | Nix·expression·that·describes·the·dependencies·of·your·package,·the |
116 | command·<span·class="command"><strong>nix-shell</strong></span>·will·build·or·download·those | 116 | command·<span·class="command"><strong>nix-shell</strong></span>·will·build·or·download·those |
117 | dependencies·if·they’re·not·already·in·your·Nix·store,·and·then·start | 117 | dependencies·if·they’re·not·already·in·your·Nix·store,·and·then·start |
118 | a·Bash·shell·in·which·all·necessary·environment·variables·(such·as | 118 | a·Bash·shell·in·which·all·necessary·environment·variables·(such·as |
119 | compiler·search·paths)·are·set.</p><p>For·example,·the·following·command·gets·all·dependencies·of·the | 119 | compiler·search·paths)·are·set.</p><p>For·example,·the·following·command·gets·all·dependencies·of·the |
120 | Pan·newsreader,·as·described·by·<a·class="link"·href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/newsreaders/pan/default.nix"·target="_top">its | 120 | Pan·newsreader,·as·described·by·<a·class="link"·href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/newsreaders/pan/default.nix"·target="_top">its |
Offset 123, 21 lines modified | Offset 123, 21 lines modified |
123 | </pre><p>You’re·then·dropped·into·a·shell·where·you·can·edit,·build·and·test | 123 | </pre><p>You’re·then·dropped·into·a·shell·where·you·can·edit,·build·and·test |
124 | the·package:</p><pre·class="screen"> | 124 | the·package:</p><pre·class="screen"> |
125 | [nix-shell]$·tar·xf·$src | 125 | [nix-shell]$·tar·xf·$src |
126 | [nix-shell]$·cd·pan-* | 126 | [nix-shell]$·cd·pan-* |
127 | [nix-shell]$·./configure | 127 | [nix-shell]$·./configure |
128 | [nix-shell]$·make | 128 | [nix-shell]$·make |
129 | [nix-shell]$·./pan/gui/pan | 129 | [nix-shell]$·./pan/gui/pan |
130 | </pre></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322615792"></a>Portability</h2></div></div></div><p>Nix·runs·on·Linux·and·macOS.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322614736"></a>NixOS</h2></div></div></div><p>NixOS·is·a·Linux·distribution·based·on·Nix.··It·uses·Nix·not | 130 | </pre></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322617664"></a>Portability</h2></div></div></div><p>Nix·runs·on·Linux·and·macOS.</p></div><div·class="simplesect"><div·class="titlepage"><div><div><h2·class="title"·style="clear:·both"><a·id="idm140737322616608"></a>NixOS</h2></div></div></div><p>NixOS·is·a·Linux·distribution·based·on·Nix.··It·uses·Nix·not |
131 | just·for·package·management·but·also·to·manage·the·system | 131 | just·for·package·management·but·also·to·manage·the·system |
132 | configuration·(e.g.,·to·build·configuration·files·in | 132 | configuration·(e.g.,·to·build·configuration·files·in |
133 | <code·class="filename">/etc</code>).··This·means,·among·other·things,·that·it | 133 | <code·class="filename">/etc</code>).··This·means,·among·other·things,·that·it |
134 | is·easy·to·roll·back·the·entire·configuration·of·the·system·to·an | 134 | is·easy·to·roll·back·the·entire·configuration·of·the·system·to·an |
Max diff block lines reached; 192721/235517 bytes (81.83%) of diff not shown.
|