Mattia Gheda

Software Engineer, Ember hacker, Ruby lover, NixOS user.

Using niv to install recent Elixir in your nix-shell

For the last few weeks I've been playing a bit with Nx - the new library for Numeric computation in Elixir. Nx is still offered as a developer build and because of that it ends up having somewhat stringent requirements, in particular the latest version released a few days ago requires the most recent Erlang and Elixir. The nix community does a great job at keeping the nixpkgs-unstable channel up to date but Elixir 12 was not available yet. Nudged by my friend Ben I decided to see what it wou...
Read post

Tutorial: Getting started with Home Manager for Nix

My opinion is that Home Manager provides a radically better way to manage a user's environment for both packages and dotfiles, effectively allowing you to take a configuration as code approach. The goal of this post is to show you how to get started with Home Manager from scratch, install packages, port over some existing configuration and explore more advanced features. This content does not require nor assumes knowledge of the Nix language, although you might find helpful to read some of t...
Read post

A Client-Server development environment

I've been setting up my development environment like described in this post since when I started working from home 6 years ago. It's been great for me and many on my team and I've been recommending this to friends for quite a while but I've never formalized it. I want to thank my colleague Ben who got interested and nudged me into writing this :) What I'm about to describe has additional complexity compared to running everything on a laptop, as most people do, but I think the trade-offs are ...
Read post

An introduction to nix-shell

Short version On June 26th I gave a short talk at our Toronto Elixir Meetup, this post is an extended version of that talk. If you are in a rush, you can skim through the slides here: Long version 👋 A word of warning, there is a fair amount of hand-waving ahead. Suggestions and corrections are welcome and encouraged! Feel free to reach out to me on twitter or via email! Definition: nix-shell nix-shell — start an interactive shell based on a Nix expression The command nix-shell wil...
Read post

So, tell me about Nix

Nix has been around the block for a while but recently, both from outside and from within the Nix community, I've seen several efforts to make Nix more beginner friendly. I have been using NixOS for a year or so, and I had myself to go through what was a somewhat confusing and effortful onboarding process. I was lucky enough to have friends like @shazow to help me on the way but I still feel I have many gaps in my understanding. I'm writing this post is to collect my thoughts on Nix and pres...
Read post

100 Days of meditation

This is a personal post about my relationship with meditation and my life journey so far with respect to this practice. I'm not sure if it will be helpful to anyone else, but I wanted to push myself to reflect a bit on this subject so here we are. The journey so far I discovered meditation ~10 years ago, before moving to Canada I was struggling with anxiety and emotional balance and my therapist at the time suggested that I should give it a try. My journey started attending some groups orga...
Read post

A nix-shell for developing Elixir

Developing with Elixir requires a fair amount of configuration you need Erlang Elixir Hex package manager And usually you want all these to be locked at a specific version. There are several solutions out there, the most popular probably being https://github.com/asdf-vm/asdf but for Nix fans, how do we setup a nix-shell and do this the "nix way"? The Nix community seems to reccomend to nixify your projects, examples exist for Ruby https://github.com/nix-community/bundix Node https://ni...
Read post

Speedy Development environments with Nix and Docker

this is a cross post from PrecisionNutrition's tech blog https://tech.precisionnutrition.com The problem Our stack at PN is composed by one Rails monolith and a plethora of EmberJS frontend apps. We also use PostgreSQL, Redis and NGINX. This means that in order to run our development stack each engineer has to at a minimum run one Rails server, two databases and a web server, usually they will also be running at least one frontend application and possibly a REPL to interact with the Rails ...
Read post