oliverdavies.uk/content/node.49ef1a05-b415-4537-b2c7-285827e27463.yml

76 lines
3.8 KiB
YAML

uuid:
- value: 49ef1a05-b415-4537-b2c7-285827e27463
langcode:
- value: en
type:
- target_id: daily_email
target_type: node_type
target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7
revision_timestamp:
- value: '2025-05-11T09:00:04+00:00'
revision_uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
revision_log: { }
status:
- value: true
uid:
- target_type: user
target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849
title:
- value: 'Managing dotfiles with Nix'
created:
- value: '2024-11-29T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:04+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2024/11/29/managing-dotfiles-with-nix
langcode: en
body:
- value: |
<p><a href="/daily/2024/11/25/nix-the-package-manager">As well as Nix managing packages</a> and <a href="/daily/2024/11/27/nix-as-an-operating-system">NixOS as your operating system</a>, you can use Nix to manage your user configuration and dotfiles.</p>
<p>Enter, Home Manager.</p>
<p>Home Manager is available as a module for NixOS and a standalone package for other Linux distributions and macOS.</p>
<p>With it, you can install and configure programs for specific users and create and manage dotfiles such as .gitconfig, .tmux.conf and .zshrc instead of using a tool like Stow.</p>
<p>There's also the extra benefit that <a href="/daily/2024/11/21/one-configuration-language-to-rule-them-all">you can write these files in the Nix language</a> and only focus on one configuration language.</p>
<p>Nix and Home Manager will create the desired output file in whatever the program wants, whether it's JSON, ini, YAML or something else.</p>
<p>A good example is <a href="https://github.com/opdavies/dotfiles/blob/3acd73f6a2e19eadcc16baf22afad5dfad5e049b/nix/modules/home-manager/features/cli/git.nix">my .gitconfig configuration</a>. It includes settings for Git itself, aliases, global excludes, adds extra packages such as <a href="https://zet.oliverdavies.uk/notes/10">git-instafix</a> and some environment variables.</p>
<p>All in one file and all in one language.</p>
format: full_html
processed: |
<p><a href="http://default/daily/2024/11/25/nix-the-package-manager">As well as Nix managing packages</a> and <a href="http://default/daily/2024/11/27/nix-as-an-operating-system">NixOS as your operating system</a>, you can use Nix to manage your user configuration and dotfiles.</p>
<p>Enter, Home Manager.</p>
<p>Home Manager is available as a module for NixOS and a standalone package for other Linux distributions and macOS.</p>
<p>With it, you can install and configure programs for specific users and create and manage dotfiles such as .gitconfig, .tmux.conf and .zshrc instead of using a tool like Stow.</p>
<p>There's also the extra benefit that <a href="http://default/daily/2024/11/21/one-configuration-language-to-rule-them-all">you can write these files in the Nix language</a> and only focus on one configuration language.</p>
<p>Nix and Home Manager will create the desired output file in whatever the program wants, whether it's JSON, ini, YAML or something else.</p>
<p>A good example is <a href="https://github.com/opdavies/dotfiles/blob/3acd73f6a2e19eadcc16baf22afad5dfad5e049b/nix/modules/home-manager/features/cli/git.nix">my .gitconfig configuration</a>. It includes settings for Git itself, aliases, global excludes, adds extra packages such as <a href="https://zet.oliverdavies.uk/notes/10">git-instafix</a> and some environment variables.</p>
<p>All in one file and all in one language.</p>
summary: null
field_daily_email_cta: { }