<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NixOS on Wael Nasreddine</title><link>https://risala.pages.dev/tags/nixos/</link><description>Recent content in NixOS on Wael Nasreddine</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 24 Mar 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://risala.pages.dev/tags/nixos/index.xml" rel="self" type="application/rss+xml"/><item><title>Why I Use NixOS</title><link>https://risala.pages.dev/posts/why-i-use-nixos/</link><pubDate>Sun, 24 Mar 2019 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/why-i-use-nixos/</guid><description>&lt;p&gt;This post highlights my reasoning behind switching to NixOS.&lt;/p&gt;&#10;&lt;p&gt;&lt;em&gt;This was originally posted as a&lt;/em&gt; &lt;a href="https://www.reddit.com/r/archlinux/comments/b2jkrp/anyone_tried_nixos_what_are_your_thoughts/eixbwu6" class="external-link" target="_blank" rel="noopener"&gt;&lt;em&gt;Reddit comment&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;&#10;&lt;h2 id="linuxunix-history"&gt;&#10; Linux/Unix History&#10; &lt;a class="heading-link" href="#linuxunix-history"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Please head over to read all about my &lt;a href="https://risala.pages.dev/about/linux-unix-history/" &gt;Linux/Unix History&lt;/a&gt;. In a Gist: I have about 20 years experience in using and managing Linux and Unix machines ranging from various Linux distributions, as well as *BSD and by extension Darwin (a.k.a Mac).&lt;/p&gt;&#10;&lt;h2 id="why-did-i-switch-to-nixos"&gt;&#10; Why did I switch to NixOS?&#10; &lt;a class="heading-link" href="#why-did-i-switch-to-nixos"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Last year -- 2018 -- I was still working as a co-founder of a small Ad-related startup. I used to have crazy long days (averaging about 12-16 hours), and I used to do about ten different things (in parallel). The reliability of my machine to say the least is of utmost importance as my day (and thus my productivity) depends on it. One day early May of last year, I wanted to install a new Vim plugin (can't remember the exact plugin) and I inadvertently ran &lt;code&gt;:PlugUpdate&lt;/code&gt; which updated all of my Vim plugins to the latest version and this has broken my entire &lt;a href="https://github.com/fatih/vim-go" class="external-link" target="_blank" rel="noopener"&gt;Go&lt;/a&gt; setup. Not only I could no longer get auto-completion as I was typing, but I was also greeted with a multi-line error every time I open a Go file, attempted to edit something or save it. I had to disable most of my plugins just to get by. By the end of that day, I was very much late on my tasks and extremely frustrated, I decided to take the weekend off and look for a solution!&lt;/p&gt;</description></item><item><title>Announcing the new Golang infrastructure: buildGoModule</title><link>https://risala.pages.dev/posts/announcing-the-new-golang-infrastructure-buildgomodule/</link><pubDate>Sun, 17 Mar 2019 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/announcing-the-new-golang-infrastructure-buildgomodule/</guid><description>&lt;div class="notice info"&gt;&#10; &lt;div class="notice-title"&gt;&#10; &lt;i class="fa-solid fa-exclamation-circle" aria-hidden="true"&gt;&lt;/i&gt;Important&#10; &lt;/div&gt;&#10; &lt;div class="notice-content"&gt;&lt;p&gt;This guide was written on March 17&lt;sup&gt;th&lt;/sup&gt; 2019 and thus is &lt;strong&gt;out of date&lt;/strong&gt;! Please refer to &lt;a href="https://nixos.org/manual/nixpkgs/stable/#sec-language-go" class="external-link" target="_blank" rel="noopener"&gt;Go section in the nixpkgs manual&lt;/a&gt; for a more up-to-date instructions!&lt;/p&gt;&lt;/div&gt;&#10;&lt;/div&gt;&lt;p&gt;I &lt;a href="https://github.com/NixOS/nixpkgs/pull/57080" class="external-link" target="_blank" rel="noopener"&gt;recently introduced&lt;/a&gt; a new function in Nixpkgs named &lt;code&gt;buildGoModule&lt;/code&gt;. The new function allows you to package Go application (or modules) with ease, provided the modules have added support for &lt;a href="https://github.com/golang/go/wiki/Modules" class="external-link" target="_blank" rel="noopener"&gt;Go modules&lt;/a&gt; upstream.&lt;/p&gt;&#10;&lt;p&gt;Go, starting at version 1.11, has shipped with an internal solution for vendoring dependencies named: &lt;a href="https://github.com/golang/go/wiki/Modules" class="external-link" target="_blank" rel="noopener"&gt;Go Modules&lt;/a&gt;. This feature provides a pseudo-lockfile-based implementation for vendoring dependencies, with one guarentee: Reproducible build. This means that all the dependencies are guarenteed to be the same.&lt;/p&gt;</description></item><item><title>CDC: Why Decompression is Worth the Complexity</title><link>https://risala.pages.dev/posts/cdc-why-decompression-worth-complexity/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/cdc-why-decompression-worth-complexity/</guid><description>&lt;p&gt;When I started building &lt;a href="https://github.com/kalbasit/ncps" class="external-link" target="_blank" rel="noopener"&gt;ncps&lt;/a&gt;, a Nix cache protocol server, the fundamental question was: &lt;strong&gt;should we chunk compressed NARs or decompress first?&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;Decompressing before chunking adds CPU cost and complexity. Compressing individual chunks adds storage overhead. It seemed wasteful. The naive approach — chunk the compressed NAR directly — is simpler and avoids the extra round-trip through decompression and recompression.&lt;/p&gt;&#10;&lt;p&gt;But I had data. Over a year of real-world use, I'd accumulated 60,910 NAR files across multiple nixpkgs revisions and platforms. Before committing to the complex path, I wanted empirical evidence.&lt;/p&gt;</description></item><item><title>Content-Defined Chunking (CDC) Results for NAR Storage</title><link>https://risala.pages.dev/posts/ncps-results-nar-storage/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/ncps-results-nar-storage/</guid><description>&lt;p&gt;I’ve been benchmarking Content-Defined Chunking (CDC) to optimize storage for our NAR files. The goal was to maximize deduplication by decompressing the source NARs before chunking, then re-compressing the unique chunks for final storage.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The Pipeline:&lt;/strong&gt; &lt;code&gt;Compressed NAR&lt;/code&gt; → &lt;code&gt;Decompress&lt;/code&gt; → &lt;code&gt;CDC Chunking&lt;/code&gt; → &lt;code&gt;Re-compress Chunks&lt;/code&gt; → &lt;code&gt;Store&lt;/code&gt;&lt;/p&gt;&#10;&lt;h3 id="summary-statistics"&gt;&#10; Summary Statistics&#10; &lt;a class="heading-link" href="#summary-statistics"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Metric&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Value&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Total Files (NARs)&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;60,784&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Original Compressed Size&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;161.06 GB&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Post-Deduplication Size&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;125.46 GB&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Net Space Saved&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;35.60 GB (22.1%)&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Unique Chunks Stored&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;3,934,658&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;Deduplication Hit Rate&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;strong&gt;47.72%&lt;/strong&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;hr&gt;&#10;&lt;h3 id="database-insights"&gt;&#10; Database Insights&#10; &lt;a class="heading-link" href="#database-insights"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h3&gt;&#10;&lt;p&gt;The following queries highlight the storage efficiency and the chunk distribution across the dataset.&lt;/p&gt;</description></item><item><title>Install ArchLinux from within NixOS</title><link>https://risala.pages.dev/posts/install-archlinux-from-nixos-system/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/install-archlinux-from-nixos-system/</guid><description>&lt;h2 id="introduction"&gt;&#10; Introduction&#10; &lt;a class="heading-link" href="#introduction"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;div class="notice note"&gt;&#10; &lt;div class="notice-title"&gt;&#10; &lt;i class="fa-solid fa-sticky-note" aria-hidden="true"&gt;&lt;/i&gt;Note&#10; &lt;/div&gt;&#10; &lt;div class="notice-content"&gt;&lt;p&gt;This is more of a journal entry (of a self-challenge) than a guide. I call my device &lt;strong&gt;Hercules&lt;/strong&gt; and my ZFS pool is named &lt;strong&gt;olympus&lt;/strong&gt;. If you decide to follow this guide, make sure to reference the sources at the bottom.&lt;/p&gt;&lt;/div&gt;&#10;&lt;/div&gt;&lt;div class="notice error"&gt;&#10; &lt;div class="notice-title"&gt;&#10; &lt;i class="fa-solid fa-times-circle" aria-hidden="true"&gt;&lt;/i&gt;Caution&#10; &lt;/div&gt;&#10; &lt;div class="notice-content"&gt;&lt;p&gt;&lt;strong&gt;Backup your ZFS pool.&lt;/strong&gt; I am not responsible if you end up losing your data. Please proceed with caution.&lt;/p&gt;&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>Install Debian or Ubuntu from within NixOS</title><link>https://risala.pages.dev/posts/install-debian-or-ubuntu-from-nixos/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/install-debian-or-ubuntu-from-nixos/</guid><description>&lt;h2 id="introduction"&gt;&#10; Introduction&#10; &lt;a class="heading-link" href="#introduction"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;div class="notice note"&gt;&#10; &lt;div class="notice-title"&gt;&#10; &lt;i class="fa-solid fa-sticky-note" aria-hidden="true"&gt;&lt;/i&gt;Note&#10; &lt;/div&gt;&#10; &lt;div class="notice-content"&gt;&lt;p&gt;This is more of a journal entry (of a self-challenge) than a guide. I call my device &lt;strong&gt;Hercules&lt;/strong&gt; and my ZFS pool is named &lt;strong&gt;olympus&lt;/strong&gt;. If you decide to follow this guide, make sure to reference the sources at the bottom.&lt;/p&gt;&lt;/div&gt;&#10;&lt;/div&gt;&lt;div class="notice error"&gt;&#10; &lt;div class="notice-title"&gt;&#10; &lt;i class="fa-solid fa-times-circle" aria-hidden="true"&gt;&lt;/i&gt;Caution&#10; &lt;/div&gt;&#10; &lt;div class="notice-content"&gt;&lt;p&gt;&lt;strong&gt;Backup your ZFS pool.&lt;/strong&gt; I am not responsible if you end up losing your data. Please proceed with caution.&lt;/p&gt;&lt;/div&gt;&#10;&lt;/div&gt;</description></item><item><title>NixOS - ZFS - No space left on device</title><link>https://risala.pages.dev/posts/nixos-zfs-no-space-left-on-device/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://risala.pages.dev/posts/nixos-zfs-no-space-left-on-device/</guid><description>&lt;h2 id="problem"&gt;&#10; Problem&#10; &lt;a class="heading-link" href="#problem"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;My system ran out of space, and I am unable to run &lt;code&gt;sudo nix-collect-garbage -d&lt;/code&gt;.&lt;/p&gt;&#10;&lt;pre&gt;&lt;code&gt;❯ sudo nix-collect-garbage -d&#10;removing old generations of profile /nix/var/nix/profiles/per-user/root/channels&#10;error: opening lock file '/nix/var/nix/profiles/per-user/root/channels.lock': No space left on device&#10;&lt;/code&gt;&lt;/pre&gt;&#10;&lt;h2 id="solution"&gt;&#10; Solution&#10; &lt;a class="heading-link" href="#solution"&gt;&#10; &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;&#10; &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;&#10; &lt;/a&gt;&#10;&lt;/h2&gt;&#10;&lt;p&gt;Remove your &lt;code&gt;~/.cache/nix&lt;/code&gt; and you should be able to collect the garbage and untangle your system.&lt;/p&gt;</description></item></channel></rss>