mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-13 20:00:20 +00:00
deploy: afef9dd71d
This commit is contained in:
@@ -161,8 +161,8 @@ personal blog
|
||||
<h2 id=what-is-home-manager>What is home-manager?</h2>
|
||||
<p>Before understanding home-manager, it is worth briefly discussing what nix is. <a href=https://nixos.org/>nix</a> is a package manager that originally spawned from a <a href=https://edolstra.github.io/pubs/phd-thesis.pdf>PhD thesis</a>. Unlike other package managers, it uses symbolic links to keep track of the currently installed packages, keeping around the old ones in case you may want to rollback.</p>
|
||||
<p>For example, I have used nix to install the package <a href="https://search.nixos.org/packages?channel=unstable&show=bind&from=0&size=50&sort=relevance&type=packages&query=bind">bind</a> which includes <code>dig</code>. You can see that it is available on multiple platforms. The absolute path of <code>dig</code> can be found by running:</p>
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-console data-lang=console><span style=color:#aaa>❯ ls -lh $(which dig)
|
||||
</span><span style=color:#aaa>lrwxr-xr-x 73 root 31 Dec 1969 /run/current-system/sw/bin/dig -> /nix/store/0r4qdyprljd3dki57jn6c6a8dh2rbg9g-bind-9.16.16-dnsutils/bin/dig
|
||||
<div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-console data-lang=console><span style=color:#009;font-weight:700>$ </span>ls -lh <span style=color:#069;font-weight:700>$(</span>which dig<span style=color:#069;font-weight:700>)</span>
|
||||
<span style=color:#aaa>lrwxr-xr-x 73 root 31 Dec 1969 /run/current-system/sw/bin/dig -> /nix/store/0r4qdyprljd3dki57jn6c6a8dh2rbg9g-bind-9.16.16-dnsutils/bin/dig
|
||||
</span></code></pre></div><p>Notice that there is a hash included in the file path? This is a nix store path and is computed by the nix package manager. This <a href=https://nixos.org/guides/nix-pills/nix-store-paths.html>nix pill</a> does a good job explaining how this hash is computed. All of the nix pills are worth a read, if you are interested in learning more about nix itself. However, using home-manager does not require extensive knowledge of nix.</p>
|
||||
<p>Part of the nix ecosystem includes <a href=https://github.com/NixOS/nixpkgs>nixpkgs</a>. Many popular tools can be found already packaged in this repository. As you can see with these <a href=https://repology.org/repositories/statistics/total>stats</a>, there is a large number of existing packages that are being maintained by the community. Contributing a new package is easy, and anyone can do it!</p>
|
||||
<p>home-manager leverages the nix package manager (and nixpkgs), as well the nix language so that you can declaratively define your system configuration. I store my <a href=https://github.com/davegallant/nix-config>nix-config</a> in git so that I can keep track of my packages and configurations, and retain a clean and informative git commit history so that I can understand what changed and why.</p>
|
||||
|
Reference in New Issue
Block a user