<?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: Lucas Quaresma</title>
    <description>The latest articles on DEV Community by Lucas Quaresma (@luksquaresma).</description>
    <link>https://dev.to/luksquaresma</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%2F2386647%2Fcb8705ef-5e2e-49d6-83a3-9456f41723be.png</url>
      <title>DEV Community: Lucas Quaresma</title>
      <link>https://dev.to/luksquaresma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luksquaresma"/>
    <language>en</language>
    <item>
      <title>How to deal with regex? An extremely concise and definitive AI workflow.</title>
      <dc:creator>Lucas Quaresma</dc:creator>
      <pubDate>Wed, 09 Apr 2025 16:19:35 +0000</pubDate>
      <link>https://dev.to/luksquaresma/how-to-deal-with-regex-an-extremely-concise-and-definitive-ai-workflow-258f</link>
      <guid>https://dev.to/luksquaresma/how-to-deal-with-regex-an-extremely-concise-and-definitive-ai-workflow-258f</guid>
      <description>&lt;h1&gt;
  
  
  Motivation
&lt;/h1&gt;

&lt;p&gt;Some time ago I had to deal with some complex regex patterns to process huge amounts of data via Apache Spark (using the pyspark API). In this process I've found a pretty simple, and yet very effective way to deal with the construction and understanding of regex patterns.&lt;/p&gt;

&lt;p&gt;I'm not a regex expert, and I don't intend to become one. Deal with regex is not something pleasant to me, neither something would like to be doing. However, sometimes it's necessary and this article is intended to show my workflow, partially powered by AI models.&lt;/p&gt;

&lt;p&gt;If you're in a similar situation, this article is for you. If you're a seasoned developer who knows regex pretty well and can immediately understand upon reading, this article is not for you.&lt;/p&gt;

&lt;h1&gt;
  
  
  On LLMs and correctness
&lt;/h1&gt;

&lt;p&gt;LLMs are purely probabilistic models, having &lt;strong&gt;NO GUARANTEE&lt;/strong&gt; on the pseudo information they can provide. A helpful way to understand this behavior is to think of them as some type of extremely efficient and lossy compression. &lt;strong&gt;To some degree is possible to trust that the information they yield is ruffly in the ballpark of the correctness, but you should never assume it actually is!&lt;/strong&gt; Of course, this is true provided that such model been trained on this kind o information.&lt;/p&gt;

&lt;p&gt;This shortcoming can be much improved upon when using techniques that explicitly include actual relevant information on the context window of the model alongside your prompt. This can be achieved with RAGs, for instance, but this will not be discussed here.&lt;/p&gt;

&lt;h1&gt;
  
  
  Workflow
&lt;/h1&gt;

&lt;p&gt;The process basically consists in two steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using IA (LLMs) for getting a some understanding of the patterns.&lt;/li&gt;
&lt;li&gt;Using some deterministic tool to assert that the patterns you deal with actually do what the IA assumes/intends them to do.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Understanding some regex pattern that already exists
&lt;/h2&gt;

&lt;p&gt;In this case we use the following example: &lt;code&gt;"[^0-9a-zA-Z_\-]+"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let's assume you have stumbled in this pattern on some code and wants to understand what it does. First you can use some IA model to get an overview explanation.&lt;/p&gt;

&lt;p&gt;We proceed with local LLMs, using &lt;a href="https://ollama.com/library/deepseek-r1:14b-qwen-distill-q4_K_M" rel="noopener noreferrer"&gt;DeepSeek R1 (14B parameters)&lt;/a&gt;, (excluding thinking) in this article, but you can compare the results with &lt;a href="https://ollama.com/library/mistral-nemo:12b-instruct-2407-q6_K" rel="noopener noreferrer"&gt;Mistral Nemo (12B parameters)&lt;/a&gt; on the &lt;a href="https://openwebui.com/c/luksquaresma/d10ef737-1d9f-47b8-88ff-8b5d3bdc6a1d" rel="noopener noreferrer"&gt;this link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model results in a chat:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Prompt:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;What the regex &lt;code&gt;[^0-9a-zA-Z_\-]+&lt;/code&gt; does?&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;The regular expression &lt;code&gt;[^0-9a-zA-Z_\-]&lt;/code&gt; is designed to match any single character that is NOT one of the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Digits&lt;/strong&gt;: 0 through 9&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letters&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Lowercase: a through z&lt;/li&gt;
&lt;li&gt;Uppercase: A through Z&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commonly used in variable names.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Included as a literal character.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This regex is useful for identifying characters that are outside the allowed set of digits, letters, underscores, and hyphens. For instance, it would match special characters like @, #, $, etc., but not any digit, letter, underscore, or hyphen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Usage:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In a string "user@name123", the '@' symbol would be matched by this regex.&lt;/li&gt;
&lt;li&gt;In "Hello_World-123", none of the characters would be matched because they all fall within the allowed set.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Using the results above, its possible to grasp a pretty good comprehension of how the regex pattern works and how it could be used. &lt;strong&gt;However, we arrive at one of biggest problem with LLMs: they DO NOT yield deterministic information.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As cited in the session &lt;em&gt;On LLMs and correctness&lt;/em&gt;, it's not possible to have any trust what so ever in this information. &lt;strong&gt;Hence, the need to verify each and every piece of the result.&lt;/strong&gt; This can be done in several manners, such as testing locally with examples etc, but here we proceed using a &lt;a href="https://en.wikipedia.org/wiki/Static_program_analysis" rel="noopener noreferrer"&gt;static analysis&lt;/a&gt; with &lt;a href="https://regex101.com/" rel="noopener noreferrer"&gt;regex101&lt;/a&gt;, a free online tool tailored for this purpose.&lt;/p&gt;

&lt;p&gt;Putting the pattern in the tool, and using the python standard alongside with option &lt;code&gt;/gm&lt;/code&gt; (global and multi line) we see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5x76xuatpe5c2z6mgefu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5x76xuatpe5c2z6mgefu.png" alt="Results from regex101 0" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With all of this, we can confirm that the regex actually does what the model explained it does, and we can proceed to alter it or manage it however necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Writing some new regex pattern to perform some function
&lt;/h2&gt;

&lt;p&gt;Using the same kind of process, we can use the same IA models to generate regex patterns that perform some kind of function. For instance, let's say we need a pattern that recognizes white-spaces at the end of lines to be removed. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model results in a &lt;a href="https://openwebui.com/c/luksquaresma/d10ef737-1d9f-47b8-88ff-8b5d3bdc6a1d" rel="noopener noreferrer"&gt;chat&lt;/a&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Prompt:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;Make a regex pattern that matches any white-spaces at the end of any line in the text.&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;To create a regex pattern that matches any whitespace characters at the end of any line, you can use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern:&lt;/strong&gt;&lt;br&gt;
  &lt;code&gt;\s+$&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This pattern works as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;\s+&lt;/code&gt; : Matches one or more whitespace characters (spaces, tabs, newlines, etc.).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt; : Asserts the position at the end of a line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Options:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You may want to add the &lt;code&gt;m&lt;/code&gt; (multiline) option so that the &lt;code&gt;$&lt;/code&gt; anchor matches the end of each line rather than just the end of the string.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example in regex with multiline mode enabled:&lt;/strong&gt;  &lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\s+$
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This will match any line that consists entirely of whitespace characters.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now we can verify the actual function of the pattern using regex101:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyzkjhfuisiz9jx03syu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foyzkjhfuisiz9jx03syu.png" alt="Results from regex101 1" width="800" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, at first glance, the pattern seems to match everything we need, but we can be sure testing it. In doing so, we'll use the following multi line string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test with no trailing spaces

test with one trailing space 
test with tow trailing spaces  

   test with leading and trailing spaces     
     test with some leading spaces
   test with one leading space
   test with leading and trailing spaces     
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And now we replace the pattern matches with an emoji for easy visualization using regex101:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tel60aha8qg90heoo3w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tel60aha8qg90heoo3w.png" alt="Replace 0" width="800" height="1113"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As can be seen above, the pattern the model suggested to us has an unfortunate side-effect: it removes blank lines from the input string. Since in the present hypothetical case this is not intended to happen, we proceed improving it with the model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Continuation of the model results in a chat:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Prompt:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;The pattern is removing blank lines, how can i make it match only the characters before the end of the line?&lt;/em&gt;&lt;/p&gt;



&lt;p&gt;To modify the regex to only match whitespaces at the end of a line when there are non-whitespace characters before them (ignoring blank lines), you can use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;^\S+\s+$&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This pattern matches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt;: Start of the line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\S+&lt;/code&gt;: One or more non-whitespace characters&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\s+&lt;/code&gt;: One or more whitespace characters at the end of the line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt;: End of the line&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Explanation&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This regex ensures that there is &lt;strong&gt;at least one non-whitespace character&lt;/strong&gt; before any trailing whitespace. &lt;/li&gt;
&lt;li&gt;Blank lines (which only contain whitespace) will not be matched because they lack the &lt;code&gt;\S+&lt;/code&gt; part.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;br&gt;
In a text like:&lt;/p&gt;


&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello World    &amp;lt;-- Matched
   (contains only spaces)
Another line    &amp;lt;-- Matched
Another line    &amp;lt;-- Not matched (blank line)
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The regex &lt;code&gt;^\S+\s+$&lt;/code&gt; will match lines 1 and 3 but not the blank line.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, checking the functionality and testing the new pattern:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86o71m9zt6vy7eumyiwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86o71m9zt6vy7eumyiwi.png" alt="Results from regex101 2" width="800" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3k9zxvtwxfzr8eu2lhss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3k9zxvtwxfzr8eu2lhss.png" alt="Replace 1" width="800" height="1125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And indeed we can assert that the regex does exactly what is intended to do and that such behavior is &lt;strong&gt;guaranteed&lt;/strong&gt; via tests.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Even as a firm pessimist on the majority of the use cases for IA and LLMs, still is not possible for me to ignore some of the actual good use cases for it. I believe that this post showcases some &lt;strong&gt;responsible&lt;/strong&gt; and &lt;strong&gt;productive&lt;/strong&gt; uses of such technology.&lt;/p&gt;

&lt;p&gt;AI is here to stay, not as the solve-all-problems hype that it is today, but with some actual good usage cases. I hope this post has given you, the reader, some insight and maybe inspiration to find more of them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;P.S. Tests are your friends, take care of them, treat them well, and they will do the same for you. And always remember, that the Crowdstrike Incident was in part due to regex errors &lt;a href="https://www.crowdstrike.com/wp-content/uploads/2024/08/Channel-File-291-Incident-Root-Cause-Analysis-08.06.2024.pdf" rel="noopener noreferrer"&gt;according to themselfs&lt;/a&gt;. Be careful!&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>ai</category>
      <category>regex</category>
      <category>llm</category>
    </item>
    <item>
      <title>How to start using nix?</title>
      <dc:creator>Lucas Quaresma</dc:creator>
      <pubDate>Fri, 08 Nov 2024 21:49:44 +0000</pubDate>
      <link>https://dev.to/luksquaresma/how-to-start-using-nix-f5h</link>
      <guid>https://dev.to/luksquaresma/how-to-start-using-nix-f5h</guid>
      <description>&lt;p&gt;If you're a Linux user, it's possible you could have heard some fuss about Nix.&lt;/p&gt;

&lt;p&gt;But what is it? How to use it? Where could you start?&lt;/p&gt;

&lt;p&gt;This post intends to present some introductory answers to ease the burden of your path coming into the best side of the force.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is nix?
&lt;/h2&gt;

&lt;p&gt;Nix is tree things, all at once, all at the same time. They are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A programing language (therefore referred as nixlang).&lt;/li&gt;
&lt;li&gt;A package and dependency manager (that includes other nice tools).&lt;/li&gt;
&lt;li&gt;An operational system, in the form of Linux distribution, called &lt;a href="https://nixos.org/" rel="noopener noreferrer"&gt;NixOS&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The relationship among these parts, on a pretty high level, can be explained by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;1 is used as a means to work with 2 and 3. For instance, performing shell commands on 2, and writing &lt;code&gt;.nix&lt;/code&gt; config files on 3.&lt;/li&gt;
&lt;li&gt;2 is used in 3 as the manager for all packages and dependencies.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Declarative builds
&lt;/h2&gt;

&lt;p&gt;The most interesting feature of all the nix ecosystem is being completely based on declarative builds and configurations.&lt;/p&gt;

&lt;p&gt;We'll not go any further in details here, but think of packages that never change, builds that are completely stable, and reproducibility everywhere you go. No matter what happens, if your config worked somewhere once, it will always work anywhere else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to start?
&lt;/h2&gt;

&lt;p&gt;After this brief introduction you might be wondering where to start. If you should try something like NixOS on a virtual machine, or fully dive into it and substitute the OS on your work machine. &lt;strong&gt;The answer is for sure: no.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I used Linux myself for about ten years, even though, when switched to NixOS with no experience on Nix (the package manager) or nixlang, it was a big headache. The logic of nix and declarative systems is not similar to other Linux distributions. Therefore, directly switching distros to NixOS with no previous experience on the ecosystem would most probably result on giving up before any meaningfull benefits. However, if you're really stubborn like me, and have a bit of &lt;em&gt;brio&lt;/em&gt;, it's possible. Once again, I do not recommend it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Brio&lt;/em&gt; illustrative reference&lt;/strong&gt; (Brazilian meme of the highest quality)&lt;strong&gt;:&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F846kbwl31nkbwr4ndbmj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F846kbwl31nkbwr4ndbmj.png" alt="brio" width="696" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other things to avoid are all the &lt;a href="https://nix.dev/manual/nix/2.18/contributing/experimental-features" rel="noopener noreferrer"&gt;experimental features&lt;/a&gt;, like &lt;a href="https://nixos.wiki/wiki/Flakes" rel="noopener noreferrer"&gt;flakes&lt;/a&gt; and &lt;a href="https://nix.dev/manual/nix/2.17/command-ref/new-cli/nix3-develop" rel="noopener noreferrer"&gt;nix develop&lt;/a&gt;, or non-declarative alternatives, like &lt;code&gt;nix-env&lt;/code&gt;. &lt;strong&gt;Do not use experimental features!!!&lt;/strong&gt; But if you really want to learn more, and in spite of my advice if you do use them, for the love of god don't complain about it for the community, were not responsible for you skill issues.&lt;/p&gt;

&lt;p&gt;What you should start learning is the the basics, &lt;strong&gt;just the basics&lt;/strong&gt;. First, take a look at the &lt;a href="https://nix.dev/manual/nix/2.17/language/" rel="noopener noreferrer"&gt;docs for the nixlang&lt;/a&gt;, it's not great, but they will give you an overall idea of how things work and some capabilities to work with &lt;code&gt;.nix&lt;/code&gt; files when needed.&lt;/p&gt;

&lt;p&gt;Second, you should be able to understand how to use &lt;code&gt;nix-shell&lt;/code&gt; and it's &lt;a href="https://nix.dev/manual/nix/2.18/command-ref/nix-shell" rel="noopener noreferrer"&gt;features&lt;/a&gt;. In my opinion it's one of the simplest, yet most powerful things in the whole ecosystem. With it you can create purely declarative, completely isolated and ephemeral  shells, that can be used anywhere, on any Linux distro, and give you real power. Along with it, it's possible to integrate them with bash, use them stand alone with simple terminal commands, or based on &lt;code&gt;&amp;lt;shell_name&amp;gt;.nix&lt;/code&gt; config files.&lt;/p&gt;

&lt;p&gt;Third, you should be able to understand and configure &lt;a href="https://nixos.wiki/wiki/Nix_channels" rel="noopener noreferrer"&gt;nix package channels&lt;/a&gt;, understand how generations and unstable branches work and how to mix and match them to your liking. I recommend start doing this inside &lt;code&gt;nix-shell&lt;/code&gt; and any other nix environments. Use some packages from stable, others from unstable, look for things that are available in one of them and not the others etc.&lt;/p&gt;

&lt;p&gt;Forth, go easy! What you should really be looking forward is to try nix on the small things. In that regard, it's much like bash, it will not solve most of your problems, but will for sure make your life hell of a lot easier. Look for small things like test environments, quick setups, the disposable spaces where you want to use some new thing and be sure it will not hurt your system configs etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  When will you be ready to use NixOS?
&lt;/h2&gt;

&lt;p&gt;This really depends. For me, changing distros was kind of a necessity since I was in distro hopping hell due to Nvidia/TensorFlow fucking ecosystem for CUDA and machine learning. It saved me, and thank god I have no longer this kind of problem.&lt;/p&gt;

&lt;p&gt;However, sometimes on NixOS you could have other problems. You are not me, and your problems and tradeoffs can be different than mine. &lt;strong&gt;If you already know the basics, and think the tradeoffs could be worth, go for it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One thing I can say for certain is, if you have a single stable system, you'll always have at least that version working everywhere. That is more peace of mind that you could ever find elsewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Concluding remarks
&lt;/h2&gt;

&lt;p&gt;For me, using the whole nix ecosystem has been a wonderful experience. It solved so many problems I had and didn't think there could be a solution. It also helped me to make elaborate things work in the most simple and elegant way. &lt;strong&gt;If this kind of thing is what you're looking for, nix could be for you.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lastly, good luck! I hope this post can give at least some idea or inspiration on where to start.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
