<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alejandro Baez</title>
    <description>The latest articles on DEV Community by Alejandro Baez (@a_baez).</description>
    <link>https://dev.to/a_baez</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F226845%2F9cb85f79-ba8c-42e3-af4f-5c2c080064fc.png</url>
      <title>DEV Community: Alejandro Baez</title>
      <link>https://dev.to/a_baez</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/a_baez"/>
    <language>en</language>
    <item>
      <title>Getting Started Using Nix Flakes As An Elixir Development Environment</title>
      <dc:creator>Alejandro Baez</dc:creator>
      <pubDate>Sun, 09 Jan 2022 18:12:28 +0000</pubDate>
      <link>https://dev.to/a_baez/getting-started-using-nix-flakes-as-an-elixir-development-environment-p1e</link>
      <guid>https://dev.to/a_baez/getting-started-using-nix-flakes-as-an-elixir-development-environment-p1e</guid>
      <description>&lt;p&gt;Never is a project started from 'just' the init. You have to take care of packages you use, CI tools for builds you make, database hookups, development tooling, and countless other parts. All of this takes time. With nix flakes, you may be able to start with all the main components you need immediately. Giving way to actually developing that app you been itching to build, without the days/weeks adventure getting everything you need just right.&lt;/p&gt;

&lt;p&gt;Now it doesn't mean that immediately reading this starter guide, you will have everything under the sun set up with &lt;a href="https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html"&gt;Nix Flakes&lt;/a&gt; for your development need. But at least, you won't have to worry about setting up asdf, your weird hacks you need for your machine and the other tiny little things to get elixir started with &lt;a href="https://github.com/elixir-lsp/elixir-ls"&gt;elixir-ls&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;A little background. &lt;a href="https://nixos.org/manual/nix/stable/introduction.html"&gt;Nix&lt;/a&gt;, for the uninitiated, is a purely functional language for package management. What makes Nix interesting is you can use the purely functional aspect to build out artifacts which are entirely idempotent. Meaning, no matter how many times you run the nix expressions you have, the end result will always be the same regardless of external state of a machine. Its build structure as a package manager has evolved the language to build out guaranteed result for all sorts of software. Yet, Nix itself isn't exactly easy to learn. Due in part to the ambitions of the project and difficulties, which arose from those ambitions, complexities crept in. &lt;a href="https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html"&gt;Nix Flakes&lt;/a&gt; is an answer to some of these complexities and more.&lt;/p&gt;

&lt;p&gt;With Nix Flakes, you have the ability to have a very well defined package for a project. Written and using Nix in a way that takes all the learning from its years. Making it easier to define what you want from nix; the build result for a package.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting flakes enabled
&lt;/h2&gt;

&lt;p&gt;So how do you get started with Nix Flakes? The first part that you should probably have is &lt;a href="https://nixos.org/guides/install-nix.html"&gt;nix already installed&lt;/a&gt; and some &lt;a href="https://nixos.wiki/wiki/Nix_Expression_Language"&gt;familiarity with the nix language&lt;/a&gt;. Run through the guide to your platform needs.&lt;/p&gt;

&lt;p&gt;Next is the settings to use nix with flakes. Since flakes is still in development (but relatively stable), you do need to enable the feature on nix. You can do so by enabling the experimental features of both &lt;code&gt;nix-command&lt;/code&gt; and &lt;code&gt;flakes&lt;/code&gt; through the &lt;a href="https://nixos.org/manual/nix/unstable/command-ref/conf-file.html"&gt;nix.conf file&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# make nix config path if not existent
mkdir ~/.config/nix/ -p
# add the settings to the file on config path
echo "experimental-features = nix-command flakes" | tee ~/.config/nix/nix.conf -a

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the settings are applied, you should be able to validate by running &lt;code&gt;show-config&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nix show-config | grep experimental

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If all is successful, you should see an output for the same experimental features you wrote on the &lt;code&gt;nix.conf&lt;/code&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The &lt;code&gt;flake.nix&lt;/code&gt; file
&lt;/h2&gt;

&lt;p&gt;So now to get to use nix flake comes the heart of the project, the &lt;code&gt;flake.nix&lt;/code&gt; file. The file itself needs three defined keys on the set, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;inputs&lt;/code&gt;, and &lt;code&gt;outputs&lt;/code&gt;. Each one of them plays a different role in how to define your package you want to build.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;description&lt;/code&gt; key
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;description&lt;/code&gt; key is a one liner description of what the flake project is. Helps in giving what the flake is for quick review after you have a few hundred of these built out...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;&lt;span class="c"&gt;# flake.nix, ignoring input and output&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"A description of some kind"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;inputs&lt;/code&gt; key
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;inputs&lt;/code&gt; is how you can import external sources of other flakes into the flake project you have. In other words, any project you may need or tools required to get started, this is where you will define their source. Example below is using the standard nixpkgs and a tool called &lt;a href="https://github.com/numtide/flake-utils"&gt;flake-utils&lt;/a&gt;, which provides a set of functions to make flake nix packages simpler to set up without external dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;&lt;span class="c"&gt;# flake.nix, ignoring description and output&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;# using unstable branch for the latest packages of nixpkgs&lt;/span&gt;
    &lt;span class="nv"&gt;nixpkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"github:NixOS/nixpkgs/nixpkgs-unstable"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt; 
    &lt;span class="nv"&gt;flake-utils&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"github:numtide/flake-utils"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;code&gt;outputs&lt;/code&gt; key
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;outputs&lt;/code&gt; is where the bulk of your logic for what you will build with flakes. It has quite &lt;a href="https://nixos.wiki/wiki/Flakes#Output_schema"&gt;a numerous of options&lt;/a&gt;, but in this use case, we only care of the &lt;code&gt;devShell&lt;/code&gt; key, which is what will be used to populate the development environment. While the following may all look like a lot for the output, it's also everything that would be needed for either building out a nix flake package or use for a development environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;&lt;span class="c"&gt;# flake.nix, ignoreing description and input&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;outputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;nixpkgs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;flake-utils&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt;
   &lt;span class="nv"&gt;flake-utils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;eachDefaultSystem&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;system&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt;
        &lt;span class="nv"&gt;pkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="nv"&gt;nixpkgs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kn"&gt;inherit&lt;/span&gt; &lt;span class="nv"&gt;system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

        &lt;span class="nv"&gt;elixir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;beam&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;erlang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;elixir&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;elixir-ls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;beam&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;erlang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;elixir_ls&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;locales&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;glibcLocales&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;in&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;devShell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;mkShell&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nv"&gt;buildInputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="nv"&gt;elixir&lt;/span&gt;
            &lt;span class="nv"&gt;locales&lt;/span&gt;
          &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output key is actually a function which takes the inputs defined on inputs. Hence the set &lt;code&gt;{ self, nixpkgs, flake-utils }&lt;/code&gt;. All the inputs on the function were defined on the input with &lt;code&gt;self&lt;/code&gt; being the &lt;code&gt;flake.nix&lt;/code&gt; file itself. The next portion is using a simple but powerful flake-utils function called &lt;code&gt;eachDefaultSystem&lt;/code&gt;. What the function provides is actually build the development environment for all available platforms currently available for nix as a default. You can see the list by running &lt;code&gt;nix flake show&lt;/code&gt; (after the file is fully written) and you will be provided an output like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;└───devShell
    ├───aarch64-darwin: development environment 'nix-shell'
    ├───aarch64-linux: development environment 'nix-shell'
    ├───i686-linux: development environment 'nix-shell'
    ├───x86_64-darwin: development environment 'nix-shell'
    └───x86_64-linux: development environment 'nix-shell'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Meaning, you do not have to worry about what OS you using, as long as it's linux or macos. You write your nix flake with the ability to use it with all the supported platforms from the start for your environment. In other words, Write once, run on all the machines. No more of that 'it runs on my machine' debacle.&lt;/p&gt;

&lt;p&gt;The last section is a &lt;code&gt;let .. in&lt;/code&gt; pair to both declare what you will use in the system you are building and &lt;code&gt;devShell&lt;/code&gt; itself. The packages use here are simply elixir, &lt;a href="https://github.com/elixir-lsp/elixir-ls"&gt;elixir-ls&lt;/a&gt; for sanity, and locales to make sure elixir is able to use the proper locale settings of the shell environment produced by the nix flake.&lt;/p&gt;

&lt;p&gt;Finally, the &lt;code&gt;devShell&lt;/code&gt; in this case is the buildInputs wanted for the shell environment and nothing more:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;devShell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;mkShell&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nv"&gt;buildInputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="nv"&gt;elixir&lt;/span&gt;
            &lt;span class="nv"&gt;locales&lt;/span&gt;
          &lt;span class="p"&gt;]&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice while &lt;code&gt;elixir-ls&lt;/code&gt; package isn't directly declared in the mkShell buildInput, it is part of the output on &lt;code&gt;let&lt;/code&gt;. Allowing to still have linked access to its packages.&lt;/p&gt;

&lt;h2&gt;
  
  
  The full nix flake development environment
&lt;/h2&gt;

&lt;p&gt;Finally, putting it all together, getting a nix flake project started for your development environment, all falls down to what packages you need on the &lt;code&gt;devShell&lt;/code&gt;. With the &lt;code&gt;flake.nix&lt;/code&gt; file on the root of your project, you have the ability to have the packages you need and ready for you to work with.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nv"&gt;description&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Development environment"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="nv"&gt;inputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;nixpkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"github:NixOS/nixpkgs/nixpkgs-unstable"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nv"&gt;flake-utils&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"github:numtide/flake-utils"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="nv"&gt;outputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;nixpkgs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;flake-utils&lt;/span&gt; &lt;span class="p"&gt;}:&lt;/span&gt;
   &lt;span class="nv"&gt;flake-utils&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;lib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;eachDefaultSystem&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;system&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt;
        &lt;span class="kn"&gt;inherit&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;nixpkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;lib&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nv"&gt;optional&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;pkgs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;import&lt;/span&gt; &lt;span class="nv"&gt;nixpkgs&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kn"&gt;inherit&lt;/span&gt; &lt;span class="nv"&gt;system&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;

        &lt;span class="nv"&gt;elixir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;beam&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;erlang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;elixir&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;elixir-ls&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;beam&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;packages&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;erlang&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;elixir_ls&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nv"&gt;locales&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;glibcLocales&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kn"&gt;in&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;devShell&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;pkgs&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nv"&gt;mkShell&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="nv"&gt;buildInputs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="nv"&gt;elixir&lt;/span&gt;
            &lt;span class="nv"&gt;locales&lt;/span&gt;
          &lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://baez.link/tag:elixir"&gt;#elixir&lt;/a&gt; &lt;a href="https://baez.link/tag:development"&gt;#development&lt;/a&gt; &lt;a href="https://baez.link/tag:nix"&gt;#nix&lt;/a&gt; &lt;a href="https://baez.link/tag:flakes"&gt;#flakes&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Limiting by platform of choice your nix flake
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://baez.link/getting-started-using-nix-flakes-as-an-elixir-development-environment"&gt;Read more...&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elixir</category>
      <category>nix</category>
      <category>flakes</category>
      <category>development</category>
    </item>
    <item>
      <title>Forty Four Keys of Joy</title>
      <dc:creator>Alejandro Baez</dc:creator>
      <pubDate>Wed, 11 Nov 2020 02:19:13 +0000</pubDate>
      <link>https://dev.to/a_baez/forty-four-keys-of-joy-4l1</link>
      <guid>https://dev.to/a_baez/forty-four-keys-of-joy-4l1</guid>
      <description>&lt;p&gt;A keyboard for software developers, system administrators, code junkies, writers, human being, and possibly cats is utmost important in this age. Do yourself a favor and get yourself a decent keyboard. Possibly if you read on, that may just be Keyboardio's Atreus.&lt;/p&gt;

&lt;p&gt;Originally I thought the keyboard was a neat idea. I had a new need for a new keyboard and it's been a awful long while (read two years) since I had something decent. Not to mention, I suffer from what I am calling the Linux terminal syndrome. It is a deadly disease in which you tell everyone you use Linux and happen to also almost exclusively use a keyboard due to some bizarre hatred of mouses. Because of this lifetime choice, I am constantly typing and try as much as possible to take care of my hands. It is also to lessen the suffering from something very real like carpal tunnel or tendinitis. So I gave the team the good ol' funding on kickstarter.&lt;/p&gt;

&lt;p&gt;It's been &lt;a href="https://fosstodon.org/@zeab/104984743773623883"&gt;one month&lt;/a&gt; since my life has changed with &lt;a href="https://shop.keyboard.io/products/keyboardio-atreus?variant=31382379823177"&gt;Keyboardio's Atreus&lt;/a&gt; keyboard. The keyboard itself is forty four hardware keys in total. Take some time to leave that number to sink in... I'll wait....&lt;/p&gt;

&lt;p&gt;Forty four keys.&lt;/p&gt;

&lt;p&gt;FORTY FOUR KEYS.&lt;/p&gt;

&lt;p&gt;OK. Why is the magic number such a big deal? So a normal keyboard has somewhere around 104 keys. What the team at Keyboardio did was look at a normal keyboard and say, “lol, NO.” These people went and cut down by more than half all the keys, yet figured a way to make you have more functionality on your existing keys than you can possibly ever need. Keyboardio went ahead like mad men, saw the potential of shifting to a different layer on a keyboard, and took it up a notch. You see, the keyboard has an ability to shift to different layers of which all the keys can be different to focus on what you need. So the 104 keys can be stuffed in just 3 layers on the keyboard, with spacing to spare.&lt;/p&gt;

&lt;p&gt;Afterwards, Keyboardio went and then said, “You know what? Let's just add more layers, cause why not?” Thus, Atreus keyboard has the ability of holding nine layers of key definitions you can fully customize to whatever your needs or itch running at any time. The crazy people over at Keyboardio also made it so you can import and export the key definitions in structured JSON. Technically giving you endless formatting to your heart's content. So in case you somehow wanted to share your keys (I do and did, &lt;a href="https://hg.sr.ht/~ab/keyboardio-atreus/"&gt;click here&lt;/a&gt;), you can with minimal effort.&lt;/p&gt;

&lt;p&gt;Along with the customization, and there is definite more you can do with this, the Atreus design is what really makes sense for balanced sane typing. Since all the keys are layered on the forty four keys, your hand never reaches to press any key on the keyboard. This means none of that extended stretching to press the ESC key three meters away from the next key. It also features an ergonomic design that just makes sense. So much so that it feels very awkward touching another keyboard, which doesn't use the structure.&lt;/p&gt;

&lt;p&gt;Lastly, and certainly not least, you can use BOX switches to make as much sound as mechanically possible. For me, this means using BOX red switches. Allowing me to keep my tradition of using my keyboard as if I'm playing a piano. Bundle all this in and you got yourself something almost healing to the touch. I dare say, you will probably be typing faster and smoother as time goes on.&lt;/p&gt;

&lt;p&gt;The biggest piece to get and learn is the layout of the layering you set up. There was a lot of thought put into the original formatting. In other words, do fight the urge of customizing Keyboardio's choosing for Atreus layering layout. It will make the curve just that much easier to adapt towards. Then once you get a feel, start making it to your needs.&lt;/p&gt;

&lt;p&gt;I'm still learning this little powerhouse, but I can safely say my typing has only gotten better without sacrificing my hands in the process.&lt;/p&gt;

&lt;p&gt;Disclaimer: this whole article was written with the wondrous forty four keys of Atreus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://baez.link/tag:keyboard"&gt;#keyboard&lt;/a&gt; &lt;a href="https://baez.link/tag:tooling"&gt;#tooling&lt;/a&gt; &lt;a href="https://baez.link/tag:hardware"&gt;#hardware&lt;/a&gt;&lt;/p&gt;

</description>
      <category>atreus</category>
      <category>keyboard</category>
      <category>keyboardio</category>
    </item>
    <item>
      <title>Tiling Managers Are Life</title>
      <dc:creator>Alejandro Baez</dc:creator>
      <pubDate>Sat, 02 May 2020 03:37:29 +0000</pubDate>
      <link>https://dev.to/a_baez/tiling-managers-are-life-3ifk</link>
      <guid>https://dev.to/a_baez/tiling-managers-are-life-3ifk</guid>
      <description>&lt;p&gt;I can't believe I thought I could go back to the window manager ways.&lt;/p&gt;

&lt;p&gt;I don't even know how I convinced myself to try to use a machine without a Tiling manager, but that was the case back when I first tried out &lt;a href="https://system76.com/"&gt;System76&lt;/a&gt;'s &lt;a href="https://pop.system76.com/"&gt;Pop!_OS&lt;/a&gt;. Before I get to the why for Pop, let me give a little back story.&lt;/p&gt;

&lt;p&gt;I been using Tiling Managers for almost a full decade. It all started with an obsession of a small, but definitely strong, embedded language called &lt;a href="http://www.lua.org/"&gt;Lua&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since the moment I learned of the language, I became absolutely obsessed with it. So much so, I wanted my whole software suite to be based on Lua. Everything from what I wrote personally, to what I wrote professionally, was in this language in one shape or another. It became such a large part of my way of being, to this day, Lua is the first thing I have installed on every machine that I can install it to. Be it work, home, servers, or things that compute, Lua is always there ready to help.&lt;/p&gt;

&lt;p&gt;So when I was looking for some sort of desktop environment using the language, I learned of a tiling manager written in Lua; &lt;a href="https://www.rust-lang.org/"&gt;Awesome&lt;/a&gt;. The Awesome tiling manager is what would happen if you tried to mix ease of use with customization you can die for. You end up being in a place where you can make your desktop experience actually function as your desktop experience. A truly custom tailored tiling manager to your precise needs.&lt;/p&gt;

&lt;p&gt;I was happy with Awesome. But being a polyglot by nature, I became in love with a different language in the coming years; &lt;a href="https://www.rust-lang.org/"&gt;Rust&lt;/a&gt;. Very much like my fascination with Lua, I ended up having a Rust written something, &lt;strong&gt;everywhere&lt;/strong&gt;. Thus, when System76 announced Pop!_OS, they also announced it would have parts of its internals written in Rust. Nuff said. I ended up installing it on my machine and wait for it... actually &lt;em&gt;like&lt;/em&gt; Gnome 3.&lt;/p&gt;

&lt;p&gt;With the new love, my heart still ached from missing the tiling manager life of old. Ended up trying all the Gnome tiling manager extensions, but they just didn't feel right. Still, I stuck with &lt;a href="https://extensions.gnome.org/extension/28/gtile/"&gt;gTile&lt;/a&gt; as the extension of choice for imitative Tiling management on Gnome 3.&lt;/p&gt;

&lt;p&gt;However, with Pop's new release of 20.04, a full integrator level extension to gnome 3 has been made by the lovely lovely team in system76 for &lt;a href="https://www.youtube.com/watch?v=-fltwBKsMY0"&gt;tiling management&lt;/a&gt;. Now it's not like Awesome, but I mean how could it be? Awesome is awesome for a reason. No, this released extension for Pop!_OS is based on &lt;a href="https://i3wm.org/"&gt;i3&lt;/a&gt;. But boy is it outstanding. I definitely have a home with System76's work for years to come. Still learning the key bindings and tricks, yet you can very much see there was so much thought put in the tiling manager work. For crying out loud, the crazy team are even &lt;a href="https://blog.system76.com/post/612874398967513088/making-a-keyboard-the-system76-approach"&gt;making a keyboard&lt;/a&gt; designed slightly different to augment the tiling manager use with their &lt;a href="https://www.youtube.com/watch?v=aqj0cRTZaVE"&gt;keyboard shortcuts&lt;/a&gt;. I'm absolutely sold.&lt;/p&gt;

&lt;p&gt;If you still deciding whether you want to run a Tiling manager or not, stop what you doing. Install Pop!_OS. You'll Thank me later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://baez.link/tag:100DaysToOffload"&gt;#100DaysToOffload&lt;/a&gt; &lt;a href="https://baez.link/tag:Day7"&gt;#Day7&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tiling</category>
      <category>system76</category>
      <category>linux</category>
      <category>popos</category>
    </item>
  </channel>
</rss>
