mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-07 09:02:29 +00:00
Re-enable pygments and add copy-code button
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.b242ee667697ab3e792722deba86ca7575ca26cc470cedac147b7fd89e24b22f.css" />
|
||||
<link id="darkModeStyle" rel="stylesheet" type="text/css" href="/css/dark.0b62b6a8c9bc96baf3dd0b8690823918769e50f96220bad87969bb570d1febfe.css" disabled />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="/css/main.3547bd7f78e8240e2e642eaae27e96ba31dec26821aff923eb7ffc098ac3aaee.css" />
|
||||
<link id="darkModeStyle" rel="stylesheet" type="text/css" href="/css/dark.c0351bf49d41b33a222e1a32cc0387e850b010f77ab2d79a9d39c72c03afcfdb.css" disabled />
|
||||
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/custom.2e59ff60a2d9c7e42e3c1af2aff0ba627da46f910a234867e98d178eb05c87dc.css">
|
||||
<link rel="stylesheet" type="text/css" href="/css/custom.d96bfb9e3314a7699144ab6ae7331d424cbd7fb34a2e890b17e7bb7db4e30f3a.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
@@ -91,6 +91,12 @@
|
||||
<span id="dark-mode-toggle" onclick="toggleTheme()"></span>
|
||||
<script src="/js/themetoggle.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="/css/copy-code-button.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<main>
|
||||
@@ -107,10 +113,9 @@
|
||||
<h2 id="what-is-home-manager">What is home-manager?<a href="#what-is-home-manager" class="hanchor" ariaLabel="Anchor">#</a></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><code class="language-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="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-console" data-lang="console"><span style="display:flex;"><span><span style="color:#4c566a;font-weight:bold">$</span> ls -lh <span style="color:#81a1c1;font-weight:bold">$(</span>which dig<span style="color:#81a1c1;font-weight:bold">)</span>
|
||||
</span></span><span style="display:flex;"><span>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></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<a href="#setting-up-home-manager" class="hanchor" ariaLabel="Anchor">#</a></h2>
|
||||
@@ -118,123 +123,119 @@ lrwxr-xr-x 73 root 31 Dec 1969 /run/current-system/sw/bin/dig -> /nix/store/
|
||||
<p>⚠️ If you run this on your main machine, make sure you backup your configuration files first. home-manager is pretty good about not overwriting existing configuration, but it is better to have a backup! Alternatively, you could test this out on a VM or cloud instance.</p>
|
||||
</blockquote>
|
||||
<p>The first thing you should do is <a href="https://nixos.org/guides/install-nix.html">install nix</a>:</p>
|
||||
<pre><code class="language-shell">curl -L https://nixos.org/nix/install | sh
|
||||
</code></pre>
|
||||
<p>It’s generally not a good idea to curl and execute files from the internet (without verifying integrity), so you might want to download the install script first and take a look before executing it!</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>curl -L https://nixos.org/nix/install <span style="color:#eceff4">|</span> sh
|
||||
</span></span></code></pre></div><p>It’s generally not a good idea to curl and execute files from the internet (without verifying integrity), so you might want to download the install script first and take a look before executing it!</p>
|
||||
<p>Open up a new shell in your terminal and running <code>nix</code> <em>should</em> work. If not, run <code>. ~/.nix-profile/etc/profile.d/nix.sh</code></p>
|
||||
<p>Now, <a href="https://github.com/nix-community/home-manager#installation">install home-manager</a>:</p>
|
||||
<pre><code class="language-shell">nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
nix-channel --update
|
||||
nix-shell '<home-manager>' -A install
|
||||
</code></pre>
|
||||
<p>You should see a wave of <code>/nix/store/*</code> paths being displayed on your screen.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-shell" data-lang="shell"><span style="display:flex;"><span>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
</span></span><span style="display:flex;"><span>nix-channel --update
|
||||
</span></span><span style="display:flex;"><span>nix-shell <span style="color:#a3be8c">'<home-manager>'</span> -A install
|
||||
</span></span></code></pre></div><p>You should see a wave of <code>/nix/store/*</code> paths being displayed on your screen.</p>
|
||||
<p>Now, to start off with a basic configuration, open up <code>~/.config/nixpkgs/home.nix</code> in the editor of your choice and paste this in (you will want to change <code>userName</code> and <code>homeDirectory</code>):</p>
|
||||
<pre><code class="language-nix">{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
home = {
|
||||
username = "dave";
|
||||
homeDirectory = "/home/dave";
|
||||
stateVersion = "21.11";
|
||||
packages = with pkgs; [
|
||||
bind
|
||||
exa
|
||||
fd
|
||||
ripgrep
|
||||
];
|
||||
};
|
||||
|
||||
programs = {
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
aliases = {
|
||||
aa = "add -A .";
|
||||
br = "branch";
|
||||
c = "commit -S";
|
||||
ca = "commit -S --amend";
|
||||
cb = "checkout -b";
|
||||
co = "checkout";
|
||||
d = "diff";
|
||||
l =
|
||||
"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
|
||||
};
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
|
||||
options = {
|
||||
features = "line-numbers decorations";
|
||||
whitespace-error-style = "22 reverse";
|
||||
plus-style = "green bold ul '#198214'";
|
||||
decorations = {
|
||||
commit-decoration-style = "bold yellow box ul";
|
||||
file-style = "bold yellow ul";
|
||||
file-decoration-style = "none";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
push = { default = "current"; };
|
||||
pull = { rebase = true; };
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
|
||||
settings = {
|
||||
add_newline = false;
|
||||
scan_timeout = 10;
|
||||
};
|
||||
};
|
||||
|
||||
zsh = {
|
||||
enable = true;
|
||||
enableAutosuggestions = true;
|
||||
enableSyntaxHighlighting = true;
|
||||
history.size = 1000000;
|
||||
|
||||
localVariables = {
|
||||
CASE_SENSITIVE = "true";
|
||||
DISABLE_UNTRACKED_FILES_DIRTY = "true";
|
||||
RPROMPT = ""; # override because macOS defaults to filepath
|
||||
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=#838383,underline";
|
||||
ZSH_DISABLE_COMPFIX = "true";
|
||||
};
|
||||
|
||||
initExtra = ''
|
||||
export PAGER=less
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
".." = "cd ..";
|
||||
grep = "rg --smart-case";
|
||||
ls = "exa -la --git";
|
||||
};
|
||||
|
||||
"oh-my-zsh" = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"gitfast"
|
||||
"last-working-dir"
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
</code></pre>
|
||||
<p>Save the file and run:</p>
|
||||
<pre><code>home-manager switch
|
||||
</code></pre>
|
||||
<p>You should see another wave of <code>/nix/store/*</code> paths. The new configuration should now be active.</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-nix" data-lang="nix"><span style="display:flex;"><span><span style="color:#eceff4">{</span> config<span style="color:#81a1c1">,</span> pkgs<span style="color:#81a1c1">,</span> <span style="color:#81a1c1">...</span> <span style="color:#eceff4">}:</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> programs<span style="color:#81a1c1">.</span>home-manager<span style="color:#81a1c1">.</span>enable <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> home <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> username <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"dave"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> homeDirectory <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"/home/dave"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> stateVersion <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"21.11"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> packages <span style="color:#81a1c1">=</span> <span style="color:#81a1c1;font-weight:bold">with</span> pkgs<span style="color:#eceff4">;</span> <span style="color:#eceff4">[</span>
|
||||
</span></span><span style="display:flex;"><span> bind
|
||||
</span></span><span style="display:flex;"><span> exa
|
||||
</span></span><span style="display:flex;"><span> fd
|
||||
</span></span><span style="display:flex;"><span> ripgrep
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">];</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> programs <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> git <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> enable <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> aliases <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> aa <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"add -A ."</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> br <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"branch"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> c <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"commit -S"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> ca <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"commit -S --amend"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> cb <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"checkout -b"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> co <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"checkout"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> d <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"diff"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> l <span style="color:#81a1c1">=</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#a3be8c">"log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> delta <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> enable <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> options <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> features <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"line-numbers decorations"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> whitespace-error-style <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"22 reverse"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> plus-style <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"green bold ul '#198214'"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> decorations <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> commit-decoration-style <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"bold yellow box ul"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> file-style <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"bold yellow ul"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> file-decoration-style <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"none"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> extraConfig <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> push <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span> default <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"current"</span><span style="color:#eceff4">;</span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span> pull <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span> rebase <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> starship <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> enable <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> enableZshIntegration <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> settings <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> add_newline <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">false</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> scan_timeout <span style="color:#81a1c1">=</span> <span style="color:#b48ead">10</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> zsh <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> enable <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> enableAutosuggestions <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> enableSyntaxHighlighting <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> history<span style="color:#81a1c1">.</span>size <span style="color:#81a1c1">=</span> <span style="color:#b48ead">1000000</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> localVariables <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> CASE_SENSITIVE <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"true"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> DISABLE_UNTRACKED_FILES_DIRTY <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"true"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> RPROMPT <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">""</span><span style="color:#eceff4">;</span> <span style="color:#616e87;font-style:italic"># override because macOS defaults to filepath</span>
|
||||
</span></span><span style="display:flex;"><span> ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"fg=#838383,underline"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> ZSH_DISABLE_COMPFIX <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"true"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> initExtra <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">''
|
||||
</span></span></span><span style="display:flex;"><span><span style="color:#a3be8c"> export PAGER=less
|
||||
</span></span></span><span style="display:flex;"><span><span style="color:#a3be8c"> ''</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> shellAliases <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#a3be8c">".."</span> <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"cd .."</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> grep <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"rg --smart-case"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> ls <span style="color:#81a1c1">=</span> <span style="color:#a3be8c">"exa -la --git"</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#a3be8c">"oh-my-zsh"</span> <span style="color:#81a1c1">=</span> <span style="color:#eceff4">{</span>
|
||||
</span></span><span style="display:flex;"><span> enable <span style="color:#81a1c1">=</span> <span style="color:#8fbcbb">true</span><span style="color:#eceff4">;</span>
|
||||
</span></span><span style="display:flex;"><span> plugins <span style="color:#81a1c1">=</span> <span style="color:#eceff4">[</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#a3be8c">"gitfast"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#a3be8c">"last-working-dir"</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">];</span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span>
|
||||
</span></span><span style="display:flex;"><span> <span style="color:#eceff4">};</span>
|
||||
</span></span><span style="display:flex;"><span><span style="color:#eceff4">}</span>
|
||||
</span></span></code></pre></div><p>Save the file and run:</p>
|
||||
<div class="highlight"><pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>home-manager switch
|
||||
</span></span></code></pre></div><p>You should see another wave of <code>/nix/store/*</code> paths. The new configuration should now be active.</p>
|
||||
<p>If you run <code>zsh</code>, you should see that you have <a href="https://starship.rs/">starship</a> and access to several other utils such as <code>rg</code>, <code>fd</code>, and <code>exa</code>.</p>
|
||||
<p>This basic configuration above is also defining your <code>~/.config/git/config</code> and <code>.zshrc</code>. If you already have either of these files, home-manager will complain about them already existing.</p>
|
||||
<p>If you run <code>cat ~/.zshrc</code>, you will see the way these configuration files are generated.</p>
|
||||
@@ -315,6 +316,9 @@ nix-shell '<home-manager>' -A install
|
||||
<div class="footer-info">
|
||||
2023 Dave Gallant
|
||||
</div>
|
||||
|
||||
<script src="/js/copy-code-button.js"></script>
|
||||
|
||||
</footer>
|
||||
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-V8WJDERTX9"></script>
|
||||
|
Reference in New Issue
Block a user