nix-gently/nix-gently.org

1.8 KiB

Nix: a gentle introduction

Introduction

What is this?

Who is it for?

Who is it not for?

Why write it?

Why me?

First steps

Installing nix

Ways to install packages

Ad hoc: nix-shell -p

  nix-shell -p hello --command hello 2>&1
these 2 paths will be fetched (0.09 MiB download, 0.47 MiB unpacked):
  /nix/store/544psc5aqpbmyffi7c6pgf8bhkkabkry-hello-2.10
  /nix/store/y2g5n52pljrmi7sy771njs1s8n58fjz3-bash-interactive-4.4-p23-dev
copying path '/nix/store/y2g5n52pljrmi7sy771njs1s8n58fjz3-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/544psc5aqpbmyffi7c6pgf8bhkkabkry-hello-2.10' from 'https://cache.nixos.org'...
Hello, world!

What happens if we do that again?

  nix-shell -p hello --command hello 2>&1
Hello, world!

Project environments: shell.nix

Declarative user environments: home-manager

Declarative operating system: nixos

Imperative: nix-env -i (but don't do this!)

What does "installing" a package with nix mean?

Oh S**t, I messed up!

Rolling back

Pinning dependencies

Advanced topics

What the heck are "nix flakes"?