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
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
270
Open Source as A Service
yawnt
0
250
Other Decks in Programming
See All in Programming
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
690
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
120
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
210
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
140
アクセシビリティから考える情報設計
high_g_engineer
0
310
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.5k
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
110
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
160
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
4
590
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
4
3k
Family mrubyの進捗
kishima
1
100
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Skip the Path - Find Your Career Trail
mkilby
1
220
Visualization
eitanlees
152
17k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
490
The Limits of Empathy - UXLibs8
cassininazir
1
640
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
510
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
310
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
470
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?