Skip to content

Instantly share code, notes, and snippets.

@gilligan
Created April 24, 2019 13:35
Show Gist options
  • Save gilligan/dbf416512455c2ceb7ab7ee1d0e17f31 to your computer and use it in GitHub Desktop.
Save gilligan/dbf416512455c2ceb7ab7ee1d0e17f31 to your computer and use it in GitHub Desktop.

small nixpkgs-tungsten workshop

The purpose of this workshop is to give you enough context and information to enable you to build packages from the nixpkgs-tungsten repository - especially the vrouter kernel modules. In this workshop we will:

  • Install & Configure Nix
  • Learn basic commands for building and installing packages
  • Build & Install packages from nixpkgs-tungsten

Installing And Configuring Nix

  • curl https://nixos.org/nix/install | sh
  • Add source ~/.nix-profile/etc/profile.d/nix.sh to .bashrc
  • Restart terminal and try nix doctor
  • Check if bash-completion is installed: dpkg -l | grep bash-completion
  • nix-env -i nix-bash-completions : install nix bash completions
  • Add export XDG_DATA_DIRS="$XDG_DATA_DIRS:$HOME/.nix-profile/share" to .bashrc
  • Start a new terminal session and try nix-env -i<TAB>

Getting nixpkgs-tungsten and configuring caches

  • git clone https://github.com/cloudwatt/nixpkgs-tungsten.git
  • nix-channel --add https://hydra.nix.corp.cloudwatt.com/jobset/nixpkgs-tungsten/trunk/channel/latest contrail
  • nix-channel --update
  • nix-env -qa '.*contrail.*' should work now
  • Update .config/nix/nix.conf with cache settings

Using nixpkgs-tungsten

  • nix repl . --> contrail<TAB> -- here we can discover everything provided
  • nix-env -f default.nix -iA contrailApiCliWithExtra --> nix-env -q --> nix-env -e <TAB>
  • nix-build default.nix -A contrail50.vrouterModuleCentos7_3_10 --> ls ./result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment