mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-14 12:20:19 +00:00
deploy: 1ff0e68a91931d15c85aa3d34dcd8f6cf32550be
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<meta property="og:url" content="/blog/2021/09/08/why-i-threw-out-my-dotfiles/">
|
||||
<meta property="og:site_name" content="davegallant">
|
||||
<meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:tag" content="nix"><meta property="article:tag" content="dotfiles"><meta property="article:tag" content="home-manager"><meta property="article:published_time" content="2021-09-08T00:42:33-04:00"><meta property="article:modified_time" content="2021-09-08T00:42:33-04:00"><meta name=twitter:card content="summary">
|
||||
<meta name=generator content="Hugo 0.88.0">
|
||||
<meta name=generator content="Hugo 0.89.4">
|
||||
<title>Why I Threw Out My Dotfiles • davegallant</title>
|
||||
<link rel=canonical href=/blog/2021/09/08/why-i-threw-out-my-dotfiles/>
|
||||
<link rel=icon href=/favicon.ico>
|
||||
@@ -161,9 +161,9 @@ 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>
|
||||
<pre tabindex=0><code class=language-console data-lang=console>❯ ls -lh $(which dig)
|
||||
lrwxr-xr-x 73 root 31 Dec 1969 /run/current-system/sw/bin/dig -> /nix/store/0r4qdyprljd3dki57jn6c6a8dh2rbg9g-bind-9.16.16-dnsutils/bin/dig
|
||||
</code></pre><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>
|
||||
<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
|
||||
</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>
|
||||
<h2 id=setting-up-home-manager>Setting up home-manager</h2>
|
||||
|
Reference in New Issue
Block a user