Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NixOS - Purely Functional Package Management
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
yawnt
June 01, 2016
Programming
1.8k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
NixOS - Purely Functional Package Management
yawnt
June 01, 2016
More Decks by yawnt
See All by yawnt
Fun with Elixir and the Erlang VM
yawnt
2
260
Open Source as A Service
yawnt
0
250
Other Decks in Programming
See All in Programming
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
350
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
1.9k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
170
さぁV100、メモリをお食べ・・・
nilpe
0
130
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
330
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
Agentic UI
manfredsteyer
PRO
0
130
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
5
3.8k
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
150
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
750
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
650
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.3k
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
170
Crafting Experiences
bethany
1
170
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Become a Pro
speakerdeck
PRO
31
6k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
RailsConf 2023
tenderlove
30
1.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Transcript
Nix(OS) purely functional package management Fueled by
f(x)
Why is state evil?
Expensive to keep track of mutation
Which in turns means no rollback
Which in turns means no portability
The Nix language
Why?
$ nix-repl > true true > 1 + 1 2
> (a: a + 1) 1 2
We use Nix to describe how to build packages
{ stdenv, fetchurl, perl }: stdenv.mkDerivation { name = "hello-2.1.1";
builder = ./builder.sh; src = fetchurl { url = “${packageURL}; md5 = “${md5hash}; }; inherit perl; }
Packages are immutable once built
Everything lives inside a single directory, the store
“Live” packages are symlinked
Old packages are still in the store, just not accessible
Rollback for free
Multiple versions for free
Multiple envs for free
Puppies for free
Ok, maybe not puppies
$ nix-repl command not found: nix-repl $ nix-shell -p nix-repl
[nix-shell:~]$ nix-repl -v nix-repl v1.1.2 [nix-shell:~]$ exit $ nix-repl command not found: nix-repl
NixOS is a distribution built around Nix
In Nix, to build a package you write a function
In NixOS, to build a system you write a function
configuration.nix
$ fdisk /dev/sda $ mkfs.ext4 -L nixos /dev/sda1 $ mkswap
-L swap /dev/sda2 $ swapon /dev/sda2 $ mount /dev/disk/by-label/nixos /mnt $ nixos-generate-config --root /mnt $ nano /mnt/etc/nixos/configuration.nix $ nixos-install $ reboot
{ config, pkgs, ... }: { imports = [ ./hardware-configuration.nix
]; boot.loader.grub.device = "/dev/sda"; }
Building your system is purely functional
Upgrading is the same as rebuilding from scratch
No /usr, /sbin/, /share
Just /nix/store
Nix(OS) cryoptographically hashes all build inputs
That means built-in versioning
dotfiles, just store ‘em in /nix/store .emacs.d, *wink* *wink* ;)
;)
More than just a distribution
nixops
(hail) hydra
Questions?