<?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>Forem: Dorian D.</title>
    <description>The latest articles on Forem by Dorian D. (@doriancodes).</description>
    <link>https://forem.com/doriancodes</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%2F906022%2Fce351ad2-a1e2-4a5a-a325-e21fed40cba0.jpeg</url>
      <title>Forem: Dorian D.</title>
      <link>https://forem.com/doriancodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/doriancodes"/>
    <language>en</language>
    <item>
      <title>Declarative and reproducible environments with colima, nix and k8s</title>
      <dc:creator>Dorian D.</dc:creator>
      <pubDate>Tue, 16 Apr 2024 17:56:53 +0000</pubDate>
      <link>https://forem.com/doriancodes/colima-k8s-nix-setup-mpn</link>
      <guid>https://forem.com/doriancodes/colima-k8s-nix-setup-mpn</guid>
      <description>&lt;h2&gt;
  
  
  Table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
Motivation

&lt;ul&gt;
&lt;li&gt;Why colima and not docker?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Download and install &lt;code&gt;nix&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Usage

&lt;ul&gt;
&lt;li&gt;How to use this guide&lt;/li&gt;
&lt;li&gt;Commands&lt;/li&gt;
&lt;li&gt;Garbage collection commands&lt;/li&gt;
&lt;li&gt;Important&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
About &lt;code&gt;nix&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;What's &lt;code&gt;nix&lt;/code&gt;?&lt;/li&gt;
&lt;li&gt;What were you sayng about isolation?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Container tools: &lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;containerd&lt;/code&gt; and &lt;code&gt;nerdctl&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Advanced usage (optional)

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Lorri&lt;/code&gt; + &lt;code&gt;direnv&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Environment isolation&lt;/li&gt;
&lt;li&gt;Run with &lt;code&gt;--pure&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Using a &lt;code&gt;virtual machine&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Installing an OS inside the &lt;code&gt;nix-shell&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Nix user profiles&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Improving the development experience&lt;/li&gt;
&lt;li&gt;Code repository&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Motivation
&lt;/h2&gt;

&lt;p&gt;Having reproducible environments heavily impacts productivity and developer experience. Being able to test on local machines allows developers to "fail fast" and prevent possible bugs or incidents in production environments. &lt;br&gt;
In an attempt to make my life easier I've studied nix combined with container tools like Colima and k8s. &lt;/p&gt;
&lt;h3&gt;
  
  
  Why colima and not docker?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/abiosoft/colima"&gt;Colima&lt;/a&gt; is a container runtime which can be use to run containers. There is no need to use docker to run container images and since it now requires you to buy a license I thought it would be more accessible to people who can't afford it. &lt;/p&gt;
&lt;h2&gt;
  
  
  Download and install &lt;code&gt;nix&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Download and install the &lt;a href="https://nixos.org/download"&gt;&lt;code&gt;nix&lt;/code&gt; package manager&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;Before running the commands below make sure you wiped out all your global dependencies. &lt;/p&gt;

&lt;p&gt;Here is an example in case you used &lt;code&gt;homebrew&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;which kubectl
&lt;span class="go"&gt;/opt/homebrew/bin/kubernetes-cli
&lt;/span&gt;&lt;span class="gp"&gt;my-computer:~$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;brew uninstall kubectl
&lt;span class="gp"&gt;Uninstalling /opt/homebrew/Cellar/kubernetes-cli/&amp;lt;version&amp;gt;&lt;/span&gt;...
&lt;span class="gp"&gt;my-computer:~$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;which colima
&lt;span class="go"&gt;/opt/homebrew/bin/colima
&lt;/span&gt;&lt;span class="gp"&gt;my-computer:~$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;brew uninstall colima
&lt;span class="gp"&gt;Uninstalling /opt/homebrew/Cellar/colima/&amp;lt;version&amp;gt;&lt;/span&gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you also have &lt;code&gt;docker&lt;/code&gt; installed globally on your machine, you should also uninstall it if you want a clean slate, because in the &lt;code&gt;shell.nix&lt;/code&gt; file there is an &lt;code&gt;alias&lt;/code&gt; for &lt;code&gt;docker&lt;/code&gt; that could mess up your configuration.&lt;/p&gt;

&lt;p&gt;Make sure that &lt;code&gt;colima&lt;/code&gt; config files are deleted as well (they are usually in the &lt;code&gt;~&lt;/code&gt; directory under &lt;code&gt;~/.config/colima&lt;/code&gt;).&lt;br&gt;
You can proceed without deleting these dependencies, but global configuration could clash with the local one and some of the commands may not work properly.&lt;/p&gt;

&lt;p&gt;There is a way to make this work in any case without uninstalling your global packages, but it's less simple.&lt;/p&gt;
&lt;h3&gt;
  
  
  How to read this guide
&lt;/h3&gt;

&lt;p&gt;There are commands that you will need to run inside your &lt;code&gt;shell&lt;/code&gt;, these are prefixed by &lt;code&gt;my-computer:~/colima-k8s-nix$&lt;/code&gt; assuming you clone this repo in your home directory &lt;code&gt;~&lt;/code&gt; or &lt;code&gt;/Users/&amp;lt;your-username&amp;gt;&lt;/code&gt; on Mac and &lt;code&gt;/users/&amp;lt;your-username&amp;gt;&lt;/code&gt; on Linux.&lt;/p&gt;

&lt;p&gt;The commands that you need to run in the &lt;code&gt;nix-shell&lt;/code&gt; are prefixed with &lt;code&gt;[nix-shell:~/colima-k8s-nix]$&lt;/code&gt; instead.&lt;/p&gt;
&lt;h3&gt;
  
  
  Commands
&lt;/h3&gt;

&lt;p&gt;Start a &lt;code&gt;nix-shell&lt;/code&gt; with colima and k8s:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nix-shell
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the shell type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;colima start &lt;span class="nt"&gt;--cpu&lt;/span&gt; 4 &lt;span class="nt"&gt;--memory&lt;/span&gt; 8 &lt;span class="nt"&gt;--network-address&lt;/span&gt; &lt;span class="nt"&gt;--kubernetes&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; containerd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pulling docker images:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;docker pull nginx
&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;docker pull openjdk:alpine
&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;docker pull mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verifying that colima is in kubernetes mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;kubectl run &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;--tty&lt;/span&gt; busybox &lt;span class="nt"&gt;--image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;busybox &lt;span class="nt"&gt;--&lt;/span&gt; sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit from k8s mode: &lt;code&gt;ctrl + d&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Stop colima runtime to free CPU and memory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;colima stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete and tear down colima instances:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;colima delete default &lt;span class="c"&gt;#colima delete &amp;lt;name-of-the-instance&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exit from &lt;code&gt;nix-shell&lt;/code&gt; by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Garbage collection commands
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Nix&lt;/code&gt; is really powerful, but in its raw state it generates a lot of garbage. There are some ways to handle this gracefully, but for now just run commands that handle garbage collection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nix-env &lt;span class="nt"&gt;--delete-generations&lt;/span&gt; old
&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nix-store &lt;span class="nt"&gt;--gc&lt;/span&gt;
&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nix-collect-garbage &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also run &lt;code&gt;nix-collect-garbage&lt;/code&gt; if you're not sure which packages you should get rid of.&lt;/p&gt;

&lt;p&gt;More on &lt;code&gt;nix&lt;/code&gt; garbage collection can be found &lt;a href="https://nixos.org/manual/nix/stable/package-management/garbage-collection"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important
&lt;/h3&gt;

&lt;p&gt;Before leaving the &lt;code&gt;nix-shell&lt;/code&gt; make sure that you stopped and deleted all the instances of &lt;code&gt;colima&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;In fact although the local dependencies of the shell are separated from the one on your local machine (you can find more about this topic here here) you still share your file system, user groups etc. with the &lt;code&gt;nix-shell&lt;/code&gt;. In this way the shell is the closest environment to your local without messing up your installed dependencies. This approach has advantages and disadvantages.&lt;/p&gt;

&lt;p&gt;❗❗&lt;strong&gt;Please make sure to run the commands to delete colima instances and the garbage collection commands after you're done developing&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  About &lt;code&gt;nix&lt;/code&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What's &lt;code&gt;nix&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://nixos.org/"&gt;&lt;code&gt;Nix&lt;/code&gt;&lt;/a&gt; is a cross-platform package manager. It uses the &lt;a href="https://nixos.org/manual/nix/stable/language/index.html"&gt;&lt;code&gt;nix&lt;/code&gt; programming language&lt;/a&gt;. &lt;code&gt;Nix&lt;/code&gt; and &lt;code&gt;NixOs&lt;/code&gt; are often used in the same context, but while the first is a package manager, the latter is a linux distribution based on &lt;code&gt;nix&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;nix&lt;/code&gt; ecosystem comes with a lot of tools. The &lt;code&gt;nix-shell&lt;/code&gt; is one of these. Under the hood it uses the &lt;code&gt;nix&lt;/code&gt; packages, aka &lt;code&gt;nixpkgs&lt;/code&gt;, which are packages that can be found in this &lt;a href="https://search.nixos.org/packages"&gt;repository&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;One of the advantages of using the &lt;code&gt;nix&lt;/code&gt; ecosystem is the capacity to make reproducible, declarative and reliable systems. One of the disadvantages is that getting to know this ecosystem can be very overwhelming and therefore it has a steep learning curve when compared to other build tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  What were you saying about isolation?
&lt;/h3&gt;

&lt;p&gt;So far we know that we can tap in this "magic" shell that has everything that we need without the hassle. &lt;/p&gt;

&lt;p&gt;But &lt;em&gt;what&lt;/em&gt; is this exactly? Is this a &lt;em&gt;container&lt;/em&gt;? Is this a &lt;em&gt;virtual machine&lt;/em&gt;? Let's ask our shell to give us some information about our operating system and platform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now let's ask the &lt;code&gt;nix-shell&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;uname&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will notice that the answer is exactly the same. This is certainly not what we would obtain if we would run the same command in a &lt;code&gt;docker&lt;/code&gt; container or in a &lt;code&gt;virtual machine&lt;/code&gt;. So our &lt;code&gt;nix-shell&lt;/code&gt; &lt;em&gt;shares ressources&lt;/em&gt; with our machine.&lt;/p&gt;

&lt;p&gt;What does this mean for us? One of the consequences of this is that when we run commands on &lt;strong&gt;this&lt;/strong&gt; &lt;code&gt;nix-shell&lt;/code&gt; (which is configured as in the &lt;code&gt;shell.nix&lt;/code&gt; file), it's as if we would install those dependencies on our machine with &lt;code&gt;homebrew&lt;/code&gt; for example. This also means that if we create a file from the &lt;code&gt;nix-shell&lt;/code&gt;, we will be able to find it if we jump back to our normal shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;test.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;span class="go"&gt;LICENSE   README.md     shell.nix      test.txt  
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the same goes if we first create a file through our regular shell and we want to read it from the &lt;code&gt;nix-shell&lt;/code&gt;. So the environment&lt;sup id="fnref1"&gt;1&lt;/sup&gt; that we have in the &lt;code&gt;nix-shell&lt;/code&gt; is closer to our &lt;strong&gt;real&lt;/strong&gt; shell. This is why we have to handle the memory responsibly and use garbage collection commands. The memory that nix uses to download and install packages is the physical memory of our machine, not the virtualized one (like in the case of &lt;code&gt;containers&lt;/code&gt; and &lt;code&gt;virtual machines&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;This also means that if we exit the shell without stopping and deleting the &lt;code&gt;colima&lt;/code&gt; instance that we started, it will continue to run even when we exit the &lt;code&gt;nix-shell&lt;/code&gt; and even if we don't have &lt;code&gt;colima&lt;/code&gt; installed globally.&lt;/p&gt;

&lt;h2&gt;
  
  
  Container tools: &lt;code&gt;docker&lt;/code&gt;, &lt;code&gt;containerd&lt;/code&gt; and &lt;code&gt;nerdctl&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;You might have noticed that inside the &lt;code&gt;nix-shell&lt;/code&gt; we've created the &lt;code&gt;colima&lt;/code&gt; instance with the flag &lt;code&gt;-r containerd&lt;/code&gt;. In fact if you try to run the same command without the flag you will get this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;INFO[0000] starting colima
INFO[0000] runtime: docker+k3s
FATA[0000] dependency check failed for docker: docker not found, run 'brew install docker' to install
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why is that? In the &lt;code&gt;shell.nix&lt;/code&gt; file we only have &lt;code&gt;colima&lt;/code&gt; and &lt;code&gt;kubernetes&lt;/code&gt; as dependencies. &lt;code&gt;colima&lt;/code&gt; already ships with &lt;code&gt;containerd&lt;/code&gt;, which is the same &lt;code&gt;container runtime&lt;/code&gt; that &lt;a href="https://www.docker.com/blog/what-is-containerd-runtime/"&gt;docker uses under the hood&lt;/a&gt;. So since we are already using &lt;code&gt;colima&lt;/code&gt; we don't need to download &lt;code&gt;docker&lt;/code&gt; for the runtime.&lt;/p&gt;

&lt;p&gt;What about the &lt;code&gt;docker-cli&lt;/code&gt;? &lt;code&gt;colima&lt;/code&gt; also ships with a &lt;a href="https://github.com/containerd/nerdctl"&gt;docker-compatible cli to interact with &lt;code&gt;containerd&lt;/code&gt; called &lt;code&gt;nerdctl&lt;/code&gt;&lt;/a&gt;. We can execute the same &lt;code&gt;docker&lt;/code&gt; cli commands like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;colima nerdctl pull nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For brevity and "developer experience" I created a local alias in &lt;code&gt;shell.nix&lt;/code&gt; for &lt;code&gt;colima nerdctl&lt;/code&gt; which is called &lt;code&gt;docker&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type &lt;/span&gt;docker
&lt;span class="go"&gt;docker is aliased to `colima nerdctl'
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;❗❗ &lt;strong&gt;Please note that this &lt;code&gt;alias&lt;/code&gt; could clash with your global configuration if you have &lt;code&gt;docker&lt;/code&gt; installed globally on your machine.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced usage (optional)
&lt;/h2&gt;

&lt;p&gt;This is by no means an exaustive list of how you can customize your builds, deployments and development environments with &lt;code&gt;nix&lt;/code&gt;, but just some examples.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;lorri&lt;/code&gt; + &lt;code&gt;direnv&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;lorri&lt;/code&gt; is a &lt;code&gt;nix-shell&lt;/code&gt; replacement for project development. Once you've &lt;a href="https://github.com/nix-community/lorri?tab=readme-ov-file#setup-on-other-platforms"&gt;downloaded and installed it&lt;/a&gt; you can initialize your project like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;lorri init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will also create an &lt;code&gt;.envrc&lt;/code&gt; file in which you can configure your shell. Then you can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;lorri deamon
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;lorri&lt;/code&gt;'s deamon gives you information about your shell, takes care of the garbage collection for you and "watches" your shell.nix files for changes, so you don't need to reload the shell if you add a dependency. Neat!&lt;/p&gt;

&lt;p&gt;Moreover &lt;code&gt;lorri&lt;/code&gt; works together with &lt;code&gt;direnv&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One downside of using &lt;code&gt;nix-shell&lt;/code&gt; is that you can only use &lt;code&gt;bash&lt;/code&gt; inside of it. Instead when using &lt;code&gt;lorri&lt;/code&gt; in the newly created &lt;code&gt;.envrc&lt;/code&gt; file you can define other shells like &lt;code&gt;zsh&lt;/code&gt; or &lt;code&gt;fish&lt;/code&gt;, thanks to &lt;code&gt;lorri&lt;/code&gt;'s integration with &lt;code&gt;direnv&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Environment isolation
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Run with &lt;code&gt;--pure&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;When you run the &lt;code&gt;nix-shell&lt;/code&gt;, it inherits your global configuration by default. If you don't want the already installed packages to affect your development and productivity, you can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;my-computer:~/colima-k8s-nix$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nix-shell &lt;span class="nt"&gt;--pure&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;pure&lt;/code&gt; flag gives you a clean slate. But in this case the &lt;code&gt;nix-shell&lt;/code&gt; will only have installed the packages that are specified in &lt;code&gt;shell.nix&lt;/code&gt;. So for example in a &lt;code&gt;nix-shell --pure&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;[nix-shell:~/colima-k8s-nix]$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; 
&lt;span class="go"&gt;bash: ls: command not found
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if you will need &lt;code&gt;ls&lt;/code&gt; or other commands that come with your Unix operating system, you will have to specify them in the &lt;code&gt;shell.nix&lt;/code&gt; file together with the other packages:&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="o"&gt;...&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="kn"&gt;with&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;buildPackages&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nv"&gt;ls&lt;/span&gt;
    &lt;span class="nv"&gt;colima&lt;/span&gt;
    &lt;span class="nv"&gt;kubectl&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Using a &lt;code&gt;virtual machine&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;You can run a &lt;a href="https://lima-vm.io/"&gt;&lt;code&gt;virtual machine&lt;/code&gt; (e.g. &lt;code&gt;lima&lt;/code&gt;)&lt;/a&gt; from inside a &lt;code&gt;nix-shell&lt;/code&gt;, exactly as you would do with a regular shell.&lt;/p&gt;

&lt;p&gt;In this case &lt;code&gt;lima&lt;/code&gt; will provide with the level of isolation that &lt;code&gt;nix-shell&lt;/code&gt; lacks when we don't pass the &lt;code&gt;pure&lt;/code&gt; flag. In this case the control is relinquished to the &lt;code&gt;virtual machine&lt;/code&gt;, so e.g. &lt;code&gt;lima&lt;/code&gt; can't write by default in the &lt;code&gt;~&lt;/code&gt; folder, but provides an isolated folder in which it has both reading and writing rights. &lt;/p&gt;

&lt;h4&gt;
  
  
  Installing an OS inside the shell
&lt;/h4&gt;

&lt;p&gt;Although this is a different approach with respect to using an already existing &lt;code&gt;virtual machine&lt;/code&gt;, we can achieve similar results in terms of isolation and to which we can do inside the shell (for example combined with the &lt;code&gt;pure&lt;/code&gt; flag).&lt;/p&gt;

&lt;p&gt;It goes without saying, that you can download the &lt;code&gt;NixOs&lt;/code&gt; linux distro within your &lt;code&gt;nix-shell&lt;/code&gt;. But you can install other operating systems as well, like you would do in a &lt;code&gt;container&lt;/code&gt; or &lt;code&gt;virtual machine&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So as you can see, this is the power of &lt;code&gt;nix&lt;/code&gt;, we started from a simple package management problem and incrementally we are building a &lt;code&gt;virual machine&lt;/code&gt; in a declarative way. Simply amazing!&lt;/p&gt;

&lt;p&gt;This is an example of how &lt;code&gt;nix-shell&lt;/code&gt; allows you to create &lt;strong&gt;ephemeral environments&lt;/strong&gt;. &lt;a href="https://www.youtube.com/watch?v=0ulldVwZiKA"&gt;Check this video if you want to know more&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;code&gt;nix&lt;/code&gt; user profiles
&lt;/h4&gt;

&lt;p&gt;Let's put aside the level of isolation that a &lt;code&gt;virtual machine&lt;/code&gt; guarantees for a moment.&lt;/p&gt;

&lt;p&gt;Another possibility to partially isolate in &lt;code&gt;nix&lt;/code&gt; is using user profiles. If you have multiple users in your machine you can switch between them and also give root priviledges to any user for whatever specific action. In this case, without additional isolation though, you can affect existing users on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving the development experience
&lt;/h2&gt;

&lt;p&gt;With a few tweaks we can improve our development experience.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Automatic environments&lt;/li&gt;
&lt;li&gt;Improving reproducibility&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Code repository
&lt;/h2&gt;

&lt;p&gt;Article originally posted on &lt;a href="https://github.com/doriancodes/colima-k8s-nix"&gt;github&lt;/a&gt;.&lt;/p&gt;




&lt;ol&gt;

&lt;li id="fn1"&gt;
&lt;p&gt;I'm using this term loosely here, not necessarily related to &lt;code&gt;nix-env&lt;/code&gt; which is a concept and tool of its own. ↩&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;

</description>
      <category>colima</category>
      <category>kubernetes</category>
      <category>nix</category>
      <category>containers</category>
    </item>
    <item>
      <title>Hacktoberfest for the busy developer</title>
      <dc:creator>Dorian D.</dc:creator>
      <pubDate>Fri, 07 Oct 2022 17:26:42 +0000</pubDate>
      <link>https://forem.com/doriancodes/hacktoberfest-for-the-busy-developer-35lm</link>
      <guid>https://forem.com/doriancodes/hacktoberfest-for-the-busy-developer-35lm</guid>
      <description>&lt;p&gt;If you have never contributed to open source, &lt;a href="https://hacktoberfest.com/"&gt;Hacktoberfest&lt;/a&gt; is the perfect chance for you. &lt;br&gt;
There are plenty of guides for beginners. This is a guide for those developers with some industry experience - but no open source experience - who have a day job and other obligations.&lt;/p&gt;

&lt;p&gt;The goal of this guide is to optimize your time as first time contributor and let you focus on the fun part: coding and collaborating with other people on open source projects. &lt;br&gt;
Contributing to open source doesn't always  benefit from all the organization of labor and the structure that you have at work. You can easily waste a lot of time to find the right projects or to setup your local environment or even waiting for a review of your PR that never comes. &lt;br&gt;
This can be very frustrating and make you give up altogether. It doesn't have to be like that. I hope this guide will help you to make the best out of the Hacktoberfest.&lt;/p&gt;

&lt;p&gt;This guide will refer to GitHub projects only, but with few modifications you can use it to contribute to projects on GitLab.&lt;/p&gt;

&lt;p&gt;Step 1: register to the event&lt;br&gt;
Step 2: find the right projects&lt;br&gt;
Step 3: evaluate a project&lt;br&gt;
Step 4: start contributing&lt;br&gt;
Final considerations&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1: register to the event
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://hacktoberfest.com/"&gt;Register to the event.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 2: Find the right projects
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Discord
&lt;/h2&gt;

&lt;p&gt;If you joined the discord Hacktoberfest server you can find some projects here. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthwrqwmcw7bjkq4kymse.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fthwrqwmcw7bjkq4kymse.png" alt="Image description" width="245" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The good thing of finding a project through discord is that you can communicate directly with the project maintainer. &lt;/p&gt;

&lt;p&gt;To search for a project written in your favorite language just use the bar at the top right of the screen: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jd3xhd2e83ns6yn0ql7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9jd3xhd2e83ns6yn0ql7.png" alt="Image description" width="427" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub
&lt;/h2&gt;

&lt;p&gt;I find the &lt;a href="https://github.com/issues"&gt;GitHub issue tracker&lt;/a&gt; very helpful. When you visit this page you will probably find only the issues you created. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzbsy3tzgnpxiy4bteqg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpzbsy3tzgnpxiy4bteqg.png" alt="Image description" width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is because the default filters are as follows:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;is:open is:issue author:yourgithubusername archived:false&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's modify the filters to get more appropriate results. &lt;br&gt;
First of all you want to get rid of the &lt;code&gt;author&lt;/code&gt; filter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0529n9iw15j8tp94if3y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0529n9iw15j8tp94if3y.png" alt="Image description" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is more like it. But the list of issues is still too broad and not so much use. &lt;br&gt;
Now let's say I want to find the Hacktoberfest issues that require as language Kotlin:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45yll6ja4idue5ru9x3z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F45yll6ja4idue5ru9x3z.png" alt="Image description" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The filters that we've applied now look like this:&lt;br&gt;
&lt;code&gt;is:open is:issue archived:false label:hacktoberfest language:kotlin&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;By default the result are sorted by newest issue. You can change the order by clicking on the &lt;code&gt;Sort&lt;/code&gt; dropdown menu. This is a particular that will be more important in the next section of the guide: evaluate a project.&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 3: evaluate a project
&lt;/h1&gt;

&lt;p&gt;Now that we have a list of possible results, let's see some strategies to find the best project to work on in the least amount of time. &lt;/p&gt;

&lt;p&gt;If you found project through GitHub, before visiting every single repo/issue that might have caught your attention there are two important considerations:&lt;/p&gt;

&lt;p&gt;1) the programming language might not be a sufficient filter criteria. Different languages can be used by very different frameworks/platform/etc. E.g. A Kotlin Developer might not have extensive experience with Android development. If you found your project through Discord, you probably had the chance to do your own filtering. But if you found your projects on GitHub, sometimes you can get this information directly from the list of issues, by hovering over the repo name:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fii4yowsqs38p6lu39z8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fii4yowsqs38p6lu39z8x.png" alt="Image description" width="543" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) the sorting criteria is very important. You want to have the newest or most recently updated issues. If the issue is new or has been updated recently it means that the repository maintainer is active and/or has interest to find people to fix the issue. This can speed up the review process and make it so, that your PR is more likely to be accepted in time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjt8udbrkdegrme4vw9n0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjt8udbrkdegrme4vw9n0.png" alt="Image description" width="326" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have clarified these two aspects, let's talk about what to look for in the repository itself and how to evaluate the issue. &lt;/p&gt;

&lt;h2&gt;
  
  
  What to look for in the repository
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Documentation
&lt;/h3&gt;

&lt;p&gt;Before being a contributor you'll be a user. A good project has to have some basic user documentation. In smaller projects it's usually in the README.md file, but some projects automatically build the docs from the source, so you might have to visit another website to get more details. &lt;br&gt;
This is the minimum requirement for you even consider this project. You have to be able to run this project on your local environment to be able to test your changes. &lt;/p&gt;

&lt;h3&gt;
  
  
  When was the last commit
&lt;/h3&gt;

&lt;p&gt;If you got this project from GitHub and followed the relative section you probably don't need this. Checking for the date of the last commit, gives you an idea on if the project is still "alive" and how active are the maintainers. &lt;/p&gt;

&lt;h3&gt;
  
  
  Domain and complexity
&lt;/h3&gt;

&lt;p&gt;There are repositories that have active maintainers and are well documented, however it can require some time to understand the domain logic (like what's this project about) and tackle the complexity (the repository has multiple independent packages, the project has a lot of features, etc.). The fact that this requires you to do some reading shouldn't discourage you from contributing. However if you decide to contribute to a more complex project consider this 3 things:&lt;br&gt;
1) How interested are you in the domain? You have more chances to be successful if you don't feel reading the documentation like a burden.&lt;br&gt;
2) How many issues in the same project can you start contributing to? Even if you're really interested, you have to consider that all that reading will require time. At some point you will want to get started coding. If there are no issues for beginners (usually labeled as &lt;code&gt;low-hanging-fruit&lt;/code&gt;, &lt;code&gt;good-first-issue&lt;/code&gt;, &lt;code&gt;up-for-grabs&lt;/code&gt;, etc.) you risk spending too much time on just one issue, when you could work on smaller projects. It could be still worth your time, if you think you want to continue to contribute long term to this project.&lt;br&gt;
3) How helpful are the maintainers toward beginners? If you start with a complex project, you will probably need to ask questions and clarify things that maintainers and experienced contributors take for granted. Check how issues are explained (more details in the next section) and how maintainers and other contributors answer to questions. Do they give detailed explanation (like exact names of the classes/functions/packages), provide links, refer to the documentations, etc.? Or do newbies often have to ask extra questions because the answer was not accurate enough? These aspects might influence your decision, as you have limited time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to understand if the issue is right for you
&lt;/h2&gt;

&lt;p&gt;Ideally by looking at the issue and source code you should be able to have an idea of what's the issue about and vague strategy on how to solve or at least where to start from when looking for a solution. &lt;br&gt;
When looking at an issue make sure to look at the comments as well. Are there already other users that requested to work on it? If yes, you want to skip this issue it doesn't make sense to have two people opening PRs on the same issue. &lt;/p&gt;

&lt;h3&gt;
  
  
  If the issue is a feature request
&lt;/h3&gt;

&lt;p&gt;The issue should have clearly defined expectations, possibly provide example(s) of expected outcomes and the name of the class/function/package/file to modify. &lt;br&gt;
If adding this feature will affect other functionalities in a not straightforward way this should be also be accurately described in the issue.&lt;/p&gt;

&lt;h3&gt;
  
  
  If the issue is a bug
&lt;/h3&gt;

&lt;p&gt;The issue should describe the problematic behavior and what the ideal behavior should look like. Moreover there should be a description as accurate as possible on how to reproduce the bug.&lt;/p&gt;

&lt;h3&gt;
  
  
  If the issue is an enhancement
&lt;/h3&gt;

&lt;p&gt;The scope shouldn't be too broad or vague. E.g. "Make the application more performant" is a bad scope. There are many ways to do that and this kind of scope invites to a discussion which might end with no decision and no PR on your side. &lt;/p&gt;

&lt;h1&gt;
  
  
  Step 4: start contributing
&lt;/h1&gt;

&lt;p&gt;When you finally found an issue to work on, make sure to comment it and make the maintainer aware of the fact that you want to work on it.&lt;/p&gt;

&lt;p&gt;Read the guidelines to contribute to the project. They are usually in the README.md or CONTRIBUTING.md. If you don't find much information about how to contribute to a specific project, you can follow this list:&lt;br&gt;
1) Fork the project. You will find the "Fork" button at the top right corner of the main project page:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6g34oem113bv2i2b1jwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6g34oem113bv2i2b1jwu.png" alt="Image description" width="493" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The fork is a copy of the project in your account. You will create your PR from this. If the guidelines require you to checkout from a branch that is not &lt;code&gt;main&lt;/code&gt;, make sure to import other branches while forking. Keep in mind that the fork, by default, is out of sync with the relative branch of the original project. If some other pull requests get merged before you're done with yours you will have to sync with the original project and rebase your branch before opening your PR.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F469gxmdxtw5509ptwrsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F469gxmdxtw5509ptwrsz.png" alt="Image description" width="347" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also automatically sync. &lt;/p&gt;

&lt;p&gt;2) Setup your local environment. You should be able to build and run the project locally. Run the tests and see if they are failing. If you have trouble with the setup and there is no information that can help you in the documentation you should probably stop here and look for another project/issue.&lt;/p&gt;

&lt;p&gt;3) You probably know this from your work, but in case it needs to be repeated, give your branch a significant recognizable name that points to the issue you're working on.&lt;/p&gt;

&lt;p&gt;4) This is also general good advice (but it's even more important in a open source project): write meaningful commit messages. Amend commits if you realized that the message is not good enough. If there is no specification on how to write a good commit message in the contribution guidelines, a good rule is to the name of the branch or issue you're working on at the beginning of the message. E.g. for branch &lt;code&gt;prevent_committing_when_no_changes&lt;/code&gt;, a good commit message would be &lt;code&gt;[prevent committing when no changes] added getCommandOutput function&lt;/code&gt;. This will make it easier to search the commit history in the future.&lt;/p&gt;

&lt;p&gt;5) Testing while coding should give you an immediate feedback if you're going in a right direction. But don't forget to test at the end, to make sure you haven't overseen anything.&lt;/p&gt;

&lt;p&gt;6) Write documentation for your code. A good rule of thumb is to follow the documentation style that is already present in the project.&lt;/p&gt;

&lt;p&gt;7) Before submitting your PR be your first reviewer. Go once again through your final solution. Read again the issue to make sure that you understood correctly the specifications and didn't miss anything. &lt;/p&gt;

&lt;p&gt;8) After submitting the PR if you receive a request from a maintainer try to discuss in a constructive way and don't be defensive about your code (after all we all make mistakes!). Keep in mind that the maintainer is the "architect" of the project and has more knowledge about it. &lt;/p&gt;

&lt;p&gt;8) Not being defensive doesn't mean that you can't voice your opinion. Offer your opinion in terms of suggestion and be ready to take for as an answer.&lt;/p&gt;

&lt;h1&gt;
  
  
  Final considerations
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Quantity over quality?
&lt;/h2&gt;

&lt;p&gt;From what discussed above one might think that this guide pushes you to prefer quantity over quality. To successfully participate to the Hacktoberfest you will need 4 PRs merged until the end of October. You might find it rewarding contributing to open source even if you don't achieve this goal. From experience though I found out that having multiple PRs merged in open source projects has given me the confidence to explore more complex projects and I think to become a regular contributor. &lt;br&gt;
I hope this guide helps you in this way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maintainers
&lt;/h2&gt;

&lt;p&gt;While contributing keep in mind that maintainers might be "busy developers" too. Writing good documentation, writing good issues and in general maintaining the project takes a considerable amount of time. It's just amazing that people do this for free in their free time. Often maintainers will thank you for the contribution, but you should be thankful as well. As developers we use open source software every day. It is what allows us to build our applications, to learn, to grow, to find new solutions, to innovate. And now you are a part of this! &lt;/p&gt;

&lt;p&gt;That's it for this guide!&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
