Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NixOS - Purely Functional Package Management
Search
yawnt
June 01, 2016
Programming
0
1.8k
NixOS - Purely Functional Package Management
yawnt
June 01, 2016
Tweet
Share
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
220
Other Decks in Programming
See All in Programming
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
0
180
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
110
Cap'n Webについて
yusukebe
0
140
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
210
TestingOsaka6_Ozono
o3
0
170
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
170
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
120
Pythonではじめるオープンデータ分析〜書籍の紹介と書籍で紹介しきれなかった事例の紹介〜
welliving
2
440
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
390
クラウドに依存しないS3を使った開発術
simesaba80
0
130
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
160
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
25
Automating Front-end Workflow
addyosmani
1371
200k
Music & Morning Musume
bryan
46
7k
How to build a perfect <img>
jonoalderson
0
4.6k
Navigating Team Friction
lara
191
16k
Designing for Performance
lara
610
69k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
180
4 Signs Your Business is Dying
shpigford
186
22k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
400
A Tale of Four Properties
chriscoyier
162
23k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
0
22
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
83
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?