Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

The Nix Ecosystem – A brief overview

1 Introduction

1.1 Who am I?

  • About 14 years of Linux desktop experience
  • About 3 years of NixOS experience
  • Has commit/merge access to Nixpkgs

2 Agenda

2.1 Agenda

2.1.1 Agenda

  • Nixpkgs
  • Nix
  • NixOS
  • Nix ecosystem

2.1.2 Nix Logo

./nix-snowflake.png

3 Nixpkgs

3.1 Nixpkgs

It is:

  • A repository that consists of nix code to describe software builds

3.2 Nixpkgs

It is:

  • A repository that consists of nix code to describe software builds
  • One of the worlds largest software repositories

3.3 Nixpkgs – Repology stats

3.3.1 Nixpkgs – Repology stats

./repology-stats.png

3.4 Nixpkgs – Github stats

Past month nixpkgs has seen 1945 merged pull requests, 229 closed issues and in total: 386 authors have published 3288 commits to master. Excluding merges.

3.4.1 Github stats image

./github-stats.png

3.4.2 Github commits image

./github-commits.png

3.4.3 Bottom text

Past year the overall activity per week have peaked at 1239 commits and dipped at 312 commits.

3.5 Nixpkgs

It is:

  • A repository that consists of nix code to describe software builds
  • One of the worlds largest software repositories

It’s not:

  • A software archive for unmaintained or out of date software

4 Nix

4.1 Nix – Agenda

  • Nix project origins
  • Stichting NixOS Foundation
  • Package manager
  • Nix Store
  • Generations

4.2 Nix – Project origins

  • NixOS initial release 2003 by Eelco Dolstra

4.3 Nix – Stichting NixOS Foundation

  • Owns all domains and core server infrastructure
  • Controlled by an elected board
  • The build farm (Hydra builds about 350k builds every week)
  • The binary cache (120+TiB pre-compiled packages)

4.4 Nix – Package manager

  • Aims to be: Reproducible
  • By being: Declarative
  • To achieve: Determinism

4.5 Nix – Nix Store

  • The Nix Store

4.6 Nix – Nix Store

  • The Nix Store
    • Package conflicts doesn’t exist
    • Version conflicts doesn’t exist
    • Circular dependencies doesn’t exist

4.7 Nix – Nix Store

  • The Nix Store
  • Example file system layout
/nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-first-package-name-X.Y.Z/...
/nix/store/yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy-second-package-name-X.Y.Z/...
/nix/store/zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz-third-package-name-X.Y.Z/...

4.8 Nix – Generations

  • What is a generation?

4.9 Nix – Generations

  • What is a generation?
  • Atomic upgrades

4.10 Nix – Generations

  • What is a generation?
  • Atomic upgrades
  • Rollbacks

5 NixOS

5.1 NixOS

  • Linux distribution built on Nix & Nixpkgs

5.2 NixOS

  • Linux distribution built on Nix & Nixpkgs
  • Module system for service configuration

5.3 NixOS – Module example

{ config, pkgs, ... }:

{
  services.openssh.enable = true;
  services.openssh.passwordAuthentication = false;

  # services.openssh.ports = [ 22 ];
  # services.openssh.allowSFTP = true;
  # services.openssh.ciphers = [ ... ];

  # services.openssh.extraConfig = "...";
}

5.4 NixOS

  • Linux distribution built on Nix & Nixpkgs
  • Module system for service configuration
  • Full system generations, deploys, rollbacks and boot generations

6 Nix ecosystem

6.1 Nix ecosystem – Agenda

  • Different platforms
  • Development environments
  • Language tooling
  • Building and deploying Docker images
  • Operations using Nix

6.2 Nix ecosystem – Platform support

  • Platform support
    • Linux
    • Darwin / macOS
    • FreeBSD (early stages)

6.3 Nix ecosystem – Development environments

  • Platform support
  • Nix Shell / Direnv

6.4 Nix ecosystem – Development environment example

with (import <nixpkgs> {});

let
  myTexlive = (texlive.combine {
    inherit (texlive) scheme-basic
      # Needed on top of scheme-basic
      beamer ec etoolbox eurosym translator ulem
      cm-super capt-of wrapfig;
  });

in mkShell {
  buildInputs = [ emacs gnumake myTexlive ];
}

6.5 Nix ecosystem – Language tooling

  • Platform support
  • Nix Shell / Direnv
  • Language tooling
    • node2nix
    • poetry2nix
    • pypi2nix
    • vgo2nix

6.6 Nix ecosystem – Docker

  • Platform support
  • Nix Shell / Direnv
  • Language tooling
  • Nix Docker tools
    • Building Images with pure Nix
    • Nixery (Docker repository)

6.7 Nix ecosystem – Operations

  • Platform support
  • Nix Shell / Direnv
  • Language tooling
  • Nix Docker tools
  • NixOps

7 Conclusions

7.1 Conclusions

  • Nix is a huge ecosystem for building and managing applications
  • Nix has a proven track record and is here to stay
  • Nix is very flexible and can be a good tool for users, developers & operations

8 Contact

8.1 Contact

  • Mastodon: sa0bse@chaos.social
  • IRC: etu @ most big networks
  • GitHub: github.com/etu
  • XMPP/Email: etu@failar.nu
  • Website/Blog: https://elis.nu/
  • Callsign: SAØBSE