oliverdavies.uk/content/node.9ef5d8d7-15bb-40b1-a6e4-e4cedc5fe214.yml

72 lines
4.6 KiB
YAML

uuid:
- value: 9ef5d8d7-15bb-40b1-a6e4-e4cedc5fe214
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:55+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: 'Experimenting with the Nix package manager'
created:
- value: '2022-09-26T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:55+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2022/09/26/experimenting-with-the-nix-package-manager
langcode: en
body:
- value: |
<p>After seeing it on some recent live streams and YouTube videos, I've recently been trying out the Nix package manager and looking into how I might use it for my local environment setup - potentially replacing some of my current Ansible configuration.</p>
<p>Separate from the NixOS operating system, Nix is a cross-platform package manager, so instead of using <code>apt</code> on Ubuntu and <code>brew</code> on macOS, you could run Nix on both and install from the 80,000 packages listed on https://search.nixos.org/packages.</p>
<p>There is a community project called Home Manager which can be installed alongside Nix which, similar to Stow or what I'm doing with Ansible, can manage your dotfiles or even create them from your Home Manager configuration, and can manage plugins for other tools such as ZSH and tmux.</p>
<p>There's also a Nix feature called "Flakes" which allow you to separate configuration for different operating systems. I currently have a flake for Pop!&#95;OS which installs all of my packages and a minimal flake for my WSL2 environment as some of the packages are installed in Windows instead of Linux.</p>
<p>I can see Ansible still being used to set up my post-setup tasks such as cloning my initial projects, but the majority of my current Ansible setup where I'm installing and configuring packages I think could be moved to Nix.</p>
<p>I have a work-in-progress Nix-based version <a href="https://github.com/opdavies/dotfiles/tree/7c3436c553f8b81f99031e6bcddf385d47b7e785">in my dotfiles repository</a> where you can also see <a href="https://github.com/opdavies/dotfiles/blob/7c3436c553f8b81f99031e6bcddf385d47b7e785/home-manager/modules/git.nix">how I've configured Git with Home Manager</a>.</p>
<p>I may install NixOS on an old laptop to test that out too.</p>
format: full_html
processed: |
<p>After seeing it on some recent live streams and YouTube videos, I've recently been trying out the Nix package manager and looking into how I might use it for my local environment setup - potentially replacing some of my current Ansible configuration.</p>
<p>Separate from the NixOS operating system, Nix is a cross-platform package manager, so instead of using <code>apt</code> on Ubuntu and <code>brew</code> on macOS, you could run Nix on both and install from the 80,000 packages listed on https://search.nixos.org/packages.</p>
<p>There is a community project called Home Manager which can be installed alongside Nix which, similar to Stow or what I'm doing with Ansible, can manage your dotfiles or even create them from your Home Manager configuration, and can manage plugins for other tools such as ZSH and tmux.</p>
<p>There's also a Nix feature called "Flakes" which allow you to separate configuration for different operating systems. I currently have a flake for Pop!_OS which installs all of my packages and a minimal flake for my WSL2 environment as some of the packages are installed in Windows instead of Linux.</p>
<p>I can see Ansible still being used to set up my post-setup tasks such as cloning my initial projects, but the majority of my current Ansible setup where I'm installing and configuring packages I think could be moved to Nix.</p>
<p>I have a work-in-progress Nix-based version <a href="https://github.com/opdavies/dotfiles/tree/7c3436c553f8b81f99031e6bcddf385d47b7e785">in my dotfiles repository</a> where you can also see <a href="https://github.com/opdavies/dotfiles/blob/7c3436c553f8b81f99031e6bcddf385d47b7e785/home-manager/modules/git.nix">how I've configured Git with Home Manager</a>.</p>
<p>I may install NixOS on an old laptop to test that out too.</p>
summary: null
field_daily_email_cta: { }