Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nix/NixOS

Sibi
January 08, 2022

 Nix/NixOS

Sibi

January 08, 2022
Tweet

More Decks by Sibi

Other Decks in Technology

Transcript

  1. MY EXPERIENCE Tried NixOS around 5 years ago Initially used

    nixpkgs in Ubuntu For around ~1.5 years Using NixOS for ~ 1 year Maintainer of various packages
  2. NIX/NIXPKGS/NIXOS Nix: Pure, lazy functional language. Not a general purpose

    language! Used for package description, composition Nixpkgs: Collection of packages. NixOS: Linux + nixpkgs System configuration also managed via Nix
  3. NIX LANGUAGE Lazy, Functional and Pure Functions, Sets, Lists etc.

    Reference: https://nixos.wiki/wiki/Nix_Expression_Language
  4. NIX EXPRESSION Code written in Nix language ❯ nix-instantiate --eval

    --expr "2 + 2" 4 ❯ cat example.nix 2 + 2 ❯ nix-instantiate --eval example.nix 4
  5. NIX DERIVATIONS Recipe to build the end product. Reproducible &

    Deterministic ❯ fd -e drv nix /nix/store | head -n 5 /nix/store/ix9j7fmxpfp7c0b2rn95wyy5y1803mya-nixos- manual.desktop.drv /nix/store/2a6ylyfsxb8knnana40fbnmk8ka7q1na-etc- nixos.conf.drv /nix/store/6r57mn57p9rgijr0lsfihkdkk2djkv86-nixos- manpages.drv /nix/store/ppsdnzviyi9q2xqak9qk0w16hpj30frj-nixos.conf.drv /nix/store/bp7flklzjxhm966b0d0pxi85dg4zbqpa-nix-prefetch- cvs.drv
  6. COMMUNITY 80,000 packages Easy to add package as compared to

    other distributions Images available for cloud providers nix-community organization
  7. DISADVANTAGES No secure boot. Nix specific issues! Learning curve Debugging

    experience Size of user community Things are still changing: Flakes!