NixOS

Reproducible builds and deployments.

Nix

A powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. Share your development and build environments across different machines.

NixOS

A Linux distribution with a unique approach to package and configuration management. Built on top of the Nix package manager, it is completely declarative, makes upgrading systems reliable, and has many other advantages.

1 │ { pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set 2 │ }: 3 │ pkgs.mkShell { # mkShell is a helper function 4 │ name="dev-environment"; # that requires a name 5 │ buildInputs = [ # and a list of packages 6 │ pkgs.nodejs 7 │ ]; 8 │ shellHook = '' # bash to run when you enter the shell 9 │ echo "Start developing..." 10 │ ''; 11 │ } ────────┴────────────────────────────────────────────────────────────────────$ # Pause the video to understand the default.nix $ # To enter dev-environment simply run: $ nix-shell Start developing... [nix-shell]$ node -e "console.log(1+1)" 2 [nix-shell]$ # Now go ahead commit default.nix to your repository

Why choose Nix or NixOS?

  • It's Reproducible…

    Nix builds packages in isolation from each other. This ensures that they are reproducible and don't have undeclared dependencies, so if a package works on one machine, it will also work on another.

  • Declarative…

    Nix makes it trivial to share development and build environments for your projects, regardless of what programming languages and tools you’re using.

  • And Reliable

    Nix ensures that installing or upgrading one package cannot break other packages. It allows you to roll back to previous versions, and ensures that no package is in an inconsistent state during an upgrade.

Examples

  • $ First example! 1 │ { pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set 2 │ }: 3 │ pkgs.mkShell { # mkShell is a helper function 4 │ name="dev-environment"; # that requires a name 5 │ buildInputs = [ # and a list of packages 6 │ pkgs.nodejs 7 │ ]; 8 │ shellHook = '' # bash to run when you enter the shell 9 │ echo "Start developing..." 10 │ ''; 11 │ } ────────┴────────────────────────────────────────────────────────────────────$ # Pause the video to understand the default.nix $ # To enter dev-environment simply run: $ nix-shell Start developing... [nix-shell]$ node -e "console.log(1+1)" 2 [nix-shell]$ # Now go ahead commit default.nix to your repository [nix-shell]$

    On demand development environments

    Suspendisse ac dolor id ex accumsan mattis in in lacus. Sed eget ultrices diam, et pretium sem.

  • $ Second example! 1 │ { pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set 2 │ }: 3 │ pkgs.mkShell { # mkShell is a helper function 4 │ name="dev-environment"; # that requires a name 5 │ buildInputs = [ # and a list of packages 6 │ pkgs.nodejs 7 │ ]; 8 │ shellHook = '' # bash to run when you enter the shell 9 │ echo "Start developing..." 10 │ ''; 11 │ } ────────┴────────────────────────────────────────────────────────────────────$ # Pause the video to understand the default.nix $ # To enter dev-environment simply run: $ nix-shell Start developing... [nix-shell]$ node -e "console.log(1+1)" 2 [nix-shell]$ # Now go ahead commit default.nix to your repository [nix-shell]$

    Multiple languages support

    Morbi molestie ultrices odio pulvinar posuere. Etiam a est vulputate, convallis tortor auctor.

  • $ Third example! 1 │ { pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set 2 │ }: 3 │ pkgs.mkShell { # mkShell is a helper function 4 │ name="dev-environment"; # that requires a name 5 │ buildInputs = [ # and a list of packages 6 │ pkgs.nodejs 7 │ ]; 8 │ shellHook = '' # bash to run when you enter the shell 9 │ echo "Start developing..." 10 │ ''; 11 │ } ────────┴────────────────────────────────────────────────────────────────────$ # Pause the video to understand the default.nix $ # To enter dev-environment simply run: $ nix-shell Start developing... [nix-shell]$ node -e "console.log(1+1)" 2 [nix-shell]$ # Now go ahead commit default.nix to your repository [nix-shell]$

    Reproducible development environments

    Donec at faucibus diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer at pretium magna.

  • $ Fourth example! 1 │ { pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set 2 │ }: 3 │ pkgs.mkShell { # mkShell is a helper function 4 │ name="dev-environment"; # that requires a name 5 │ buildInputs = [ # and a list of packages 6 │ pkgs.nodejs 7 │ ]; 8 │ shellHook = '' # bash to run when you enter the shell 9 │ echo "Start developing..." 10 │ ''; 11 │ } ────────┴────────────────────────────────────────────────────────────────────$ # Pause the video to understand the default.nix $ # To enter dev-environment simply run: $ nix-shell Start developing... [nix-shell]$ node -e "console.log(1+1)" 2 [nix-shell]$ # Now go ahead commit default.nix to your repository [nix-shell]$

    Build Docker images

    Etiam eget eros et urna tincidunt porttitor.

  • $ Fifth example! 1 │ { pkgs ? import <nixpkgs> {} # here we import the nixpkgs package set 2 │ }: 3 │ pkgs.mkShell { # mkShell is a helper function 4 │ name="dev-environment"; # that requires a name 5 │ buildInputs = [ # and a list of packages 6 │ pkgs.nodejs 7 │ ]; 8 │ shellHook = '' # bash to run when you enter the shell 9 │ echo "Start developing..." 10 │ ''; 11 │ } ────────┴────────────────────────────────────────────────────────────────────$ # Pause the video to understand the default.nix $ # To enter dev-environment simply run: $ nix-shell Start developing... [nix-shell]$ node -e "console.log(1+1)" 2 [nix-shell]$ # Now go ahead commit default.nix to your repository [nix-shell]$

    Build cloud images

    Amazon EC2, and any other cloud.