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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
230
Other Decks in Programming
See All in Programming
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
950
Fluid Templating in TYPO3 14
s2b
0
120
SourceGeneratorのススメ
htkym
0
180
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
370
Patterns of Patterns
denyspoltorak
0
1.3k
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
CSC307 Lecture 05
javiergs
PRO
0
490
Denoのセキュリティに関する仕組みの紹介 (toranoana.deno #23)
uki00a
0
280
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
0
210
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
430
Vibe codingでおすすめの言語と開発手法
uyuki234
0
210
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
53
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
110
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
0
1.8k
Designing Experiences People Love
moore
144
24k
Testing 201, or: Great Expectations
jmmastey
46
8k
Code Review Best Practice
trishagee
74
20k
Designing for Timeless Needs
cassininazir
0
120
Measuring & Analyzing Core Web Vitals
bluesmoon
9
750
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Getting science done with accelerated Python computing platforms
jacobtomlinson
1
110
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?