Nix at Mozilla

Jan 2017

London Nixos Usergroup

@garbas

What is Nix?

  • a build tool
  • a language
  • a package manager
  • extends to whole Linux distro

How to introduce Nix at work?

  • Solve your own problem first (eg. your own development environment)
  • Teach nix
  • Start to package projects as you come by them
  • Put infrastructure in place (Travis + S3 bucket is enough)
  • Teach nix
  • Volunteer to solve hard problems only Nix can solve
  • Teach nix
  • Point out problems (laud) which other tools are not considering
  • Create default.nix for all your projects
  • Time to create first PRs to share default.nix with others
  • Talk with coworkers about Nix (to remove the fear)
  • In worse case you can keep you default.nix and people will eventually look at it.

Solve your own problems first

Start to package other projects

Put infrastructure in place

Volunteer to solve hard problems

Teach Nix

Bonus: Updating sources

(coming soon to nixpkgs - partially is already in)

{ stdenv, ... }:

stdenv.mkDerivation {
  name
  src = fetchFromGithubWithUpdate {
    owner = "gutschke";
    repo = "pdf2odt";
    branch = "master";
    path = "pkgs/tools/typesetting/pdf2odt/src.json";
  };
  ... or ...
  src = fetchFromGitHub (stdenv.lib.importJSON ./src.json);
  passthru.updateScript = updateFromGitHub {
    owner = "gutschke";
    repo = "pdf2odt";
    branch = "master";
    path = "pkgs/tools/typesetting/pdf2odt/src.json";
  };
}

----

nix-shell maintainers/scripts/update.nix --argstr package pdf2odt

Bonus: NixOS weekly

Help shape next release (07.02.2017)

Bonus: Python + Nix

pypi2nix -r requirements.txt

nix-build -A requirements.nix -A interpreter

TODO: copy how pelican set was integrated in nixos-weekly

Thank you

@garbas

Nix at Mozilla

By Rok Garbas

Nix at Mozilla

  • 2,405