A puppet pro decides to
learn nix
Michael Stahnke
VP Engineering at Flox (flox.dev)
@stahnma
Slide 2
Slide 2 text
2
Obsessed with Automation
@stahnma
Slide 3
Slide 3 text
3
Speed
@stahnma
Slide 4
Slide 4 text
4
Consistency
@stahnma
Slide 5
Slide 5 text
5
Variance is the Enemy
@stahnma
Slide 6
Slide 6 text
Edu
Career
6
9 Years
8 Years
4 Years
About a Year
@stahnma
Slide 7
Slide 7 text
7
@stahnma
Slide 8
Slide 8 text
8
@stahnma
Slide 9
Slide 9 text
9
@stahnma
Slide 10
Slide 10 text
10
Founded Extra Packages for Enterprise Linux,
largely to ensure Puppet was available
@stahnma
Slide 11
Slide 11 text
11
Ported Ruby AIX
@stahnma
Slide 12
Slide 12 text
12
Packaged Passenger for usage by Caterpillar
(and eventually Reductive Labs)
@stahnma
Slide 13
Slide 13 text
13
Things I love(d) about Puppet
@stahnma
Slide 14
Slide 14 text
14
Nouns not Verbs
@stahnma
Slide 15
Slide 15 text
15
State not Action
@stahnma
Slide 16
Slide 16 text
16
Abstraction of OS differences
@stahnma
Slide 17
Slide 17 text
17
Several great integration points
(facter, hiera, ldap schema, more)
@stahnma
Slide 18
Slide 18 text
18
I had done a lot of packaging
@stahnma
Slide 19
Slide 19 text
19
Somebody told me to check out nix
@stahnma
Slide 20
Slide 20 text
20
Slide 21
Slide 21 text
21
@stahnma
Slide 22
Slide 22 text
22
First impressions
with nix:
This seems very grounded in
academics.
Why do I want n versions of a
library on a system?
Holy cow, the complete
disregard for FHS is a crime
against all things unix.
@stahnma
Slide 23
Slide 23 text
23
Slide 24
Slide 24 text
24
Result: Didn’t touch it again for years.
@stahnma
Slide 25
Slide 25 text
25
I went to Puppet
@stahnma
Slide 26
Slide 26 text
26
Packaging All the Things
@stahnma
Slide 27
Slide 27 text
27
Wrote our own tooling
@stahnma
Slide 28
Slide 28 text
28
Built our own CI system from the ground up
@stahnma
Slide 29
Slide 29 text
29
We were packaging for more than 100
OS/architecture combinations
@stahnma
Slide 30
Slide 30 text
30
Slide 31
Slide 31 text
31
Upgrades:
Difficult to test
Feared by customers
@stahnma
Slide 32
Slide 32 text
32
People smarter than me were using nix to
solve local development problems
@stahnma
Slide 33
Slide 33 text
33
I <3 packaging
I <3 developer productivity
Let’s do this.
@stahnma
Slide 34
Slide 34 text
34
The next time, Nix wasn’t even 1 thing.
@stahnma
Slide 35
Slide 35 text
35
It’s an OS, a package manager, a programming
language
@stahnma
Slide 36
Slide 36 text
36
It’s slices, it dices, it purees
Slide 37
Slide 37 text
37
A skit from the first season of Saturday
Night Live in 1975.
@stahnma
Slide 38
Slide 38 text
38
I <3 packaging
I <3 developer productivity
Let’s do this.
@stahnma
Slide 39
Slide 39 text
39
Why is this so complicated?
@stahnma
Slide 40
Slide 40 text
40
Why is this so complicated?
This is Avril Lavigne. She was
kind of a big deal in like 2002.
She had a history song titled
“Complicated”
@stahnma
Slide 41
Slide 41 text
41
WTFs/Min
@stahnma
Slide 42
Slide 42 text
42
There are debates about what
“install” means…
@stahnma
Slide 43
Slide 43 text
43
People smarter than me were using nix to
solve local development problems
@stahnma
52
Other problems
Can’t find
headers
Can’t find
libraries
Shell vs develop
Experimental
Features
Is this a package manager, a
package repository, an OS, or a
tool?
@stahnma
Slide 53
Slide 53 text
53
So, let’s take a step back
@stahnma
Slide 54
Slide 54 text
54
Recommended learning via
NixOS
@stahnma
Slide 55
Slide 55 text
55
NixOS
@stahnma
Slide 56
Slide 56 text
No content
Slide 57
Slide 57 text
@stahnma
Slide 58
Slide 58 text
58
NixOS
Slide 59
Slide 59 text
59
Enter the second machine
problem
@stahnma
Slide 60
Slide 60 text
60
Ok, so there’s a catalog, but I can’t load
variables into it.
Nix
@stahnma
Slide 61
Slide 61 text
61
NixOS
So, like a puppet apply…
without facter sending over
info.
@stahnma
Slide 62
Slide 62 text
62
Purity
@stahnma
Slide 63
Slide 63 text
63
What’s nix awesome at?
@stahnma
Slide 64
Slide 64 text
64
Same package, different distro
Nix
@stahnma
Slide 65
Slide 65 text
65
Reproducibility
@stahnma
Slide 66
Slide 66 text
66
Cross Platform
@stahnma
Slide 67
Slide 67 text
67
Trying out new software
@stahnma
Slide 68
Slide 68 text
68
Less time in CI
@stahnma
Slide 69
Slide 69 text
69
Giant Package Repository
@stahnma
Slide 70
Slide 70 text
70
People smarter than me were using nix to
solve local development problems
@stahnma
Puppet
103
• Better when you have existing
systems to manage
• Enforce state if you have manual drift
@stahnma
Slide 104
Slide 104 text
Least Favorite Things
104
• The complexity of the server stack. (JDK, Ruby, 13
configuration grammars, etc)
• SSL…fun
• Company…changes
@stahnma
Slide 105
Slide 105 text
Least Favorite Things
105
• Nixpkgs naming of packages
• Docs for some things non-existent
(read the source)
• Version not really being a first-class
piece of metadata
• Experimental features
@stahnma
Slide 106
Slide 106 text
Should you change?
106
@stahnma
Slide 107
Slide 107 text
Only if you’ve declared your
intention ahead of time
107
@stahnma