<?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: Ray Harris</title>
    <description>The latest articles on DEV Community by Ray Harris (@raymondgh).</description>
    <link>https://dev.to/raymondgh</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%2F1079935%2Fc9ed3802-2874-4dda-a7a4-d316081674f4.png</url>
      <title>DEV Community: Ray Harris</title>
      <link>https://dev.to/raymondgh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raymondgh"/>
    <language>en</language>
    <item>
      <title>Day 7: Uninstalling NixOS from my Macbook Pro</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Tue, 02 Jan 2024 00:54:32 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-7-uninstalling-nixos-from-my-macbook-pro-3fc9</link>
      <guid>https://dev.to/raymondgh/day-7-uninstalling-nixos-from-my-macbook-pro-3fc9</guid>
      <description>&lt;p&gt;Yes, you read that right. NixOS on MBP was a mistake. Now, almost a year later, I am ready to undo this nightmare.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bad idea from the start
&lt;/h2&gt;

&lt;p&gt;While the setup from my earlier post &lt;em&gt;did&lt;/em&gt; work for me, I found myself running into problems later on.&lt;/p&gt;

&lt;p&gt;Firstly, I needed to run first aid on the Apple partitions frequently. I think it was needed every time the laptop died, which was quite frequent as this one has a terrible battery and I was using it only once every few weeks at most. &lt;/p&gt;

&lt;p&gt;Secondly, using NixOS on this machine has been unpleasant compared to on my desktop. The touchpad is hypersensitive and undersensitive at the same time. The touchbar is useless and leaves me without an escape key (let alone useful function or media control keys). &lt;/p&gt;

&lt;p&gt;Thirdly, I just don't like the idea of my hardware working so hard against me. Seemingly everything about the Macbook is designed to make dual booting this way as painful as possible. Too many tricks and workarounds are needed compared to a normal computer. It should be easy!!&lt;/p&gt;

&lt;p&gt;I'd like to buy a Lenovo or XPS or something some day. Maybe even a nice Framework if I get rich. For now, I feel the need to simplify, and I'm starting with this laptop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Remove NixOS
&lt;/h2&gt;

&lt;p&gt;In MacOS, open disk utility and review what you've got. It probably looks something like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fqdwp6nhfto26fjmbpbn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fqdwp6nhfto26fjmbpbn7.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here I have one big Apple partition (which Apple subdivides on its own automatically), a few smaller partitions for NixOS (disk0s3, disk0s4, disk0s5), plus the mutually accessible partition named CrossData. My screenshot also shows "Nix Store" on the left, but that's only because I tried installing the nix package manager on MacOS at some point. I never really got into that, so I unfortunately don't have much to share about it for now! Maybe later!&lt;/p&gt;

&lt;p&gt;Let's move over to the terminal and check the partitions that way too. Run&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil list


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

&lt;/div&gt;

&lt;p&gt;to see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fd1ok3pkb3pw1mt6tmiam.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fd1ok3pkb3pw1mt6tmiam.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's get to work. The four &lt;code&gt;Microsoft Basic Data&lt;/code&gt; partitions are the ones we'll delete and give back to Apple. Start by ensuring they're all unmounted by running these&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil unmount disk0s3


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil unmount disk0s4


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil unmount disk0s5


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil unmount disk0s6


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

&lt;/div&gt;

&lt;p&gt;Only the last one would be expected to be mounted when running MacOS, but it's harmless to run the command for the others anyway.&lt;/p&gt;

&lt;p&gt;Now, with great care and knowledge that you definitely backed up any important data, wipe those partitions&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil eraseVolume free %noformat% disk0s3


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil eraseVolume free %noformat% disk0s4


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil eraseVolume free %noformat% disk0s5


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil eraseVolume free %noformat% disk0s6


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

&lt;/div&gt;

&lt;p&gt;Can't go back now!&lt;/p&gt;

&lt;p&gt;Let's check out the damage.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil list


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnzlspkr65o0bxwqkgnwj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnzlspkr65o0bxwqkgnwj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looks like we have a floating 250GB of free space. Let's merge that back into the main apple partition. What's nice is we can do this in the GUI of disk utility, giving us confidence that Apple likes what we're doing. Here's what it looks like now:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fqpu49sp5gm5cw4nhtxhs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fqpu49sp5gm5cw4nhtxhs.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So click "Partition" at the top of this window to bring up this view:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fmo2jp03i29irrrzx5nvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmo2jp03i29irrrzx5nvs.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By the time you're reading this, there could be a new MacOS with a different UI, but I hope it should still be easy to select and delete the free space. Here's what it looked like for me with MacOS Sonoma&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fnzyylrkcul5sixxs3uwu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fnzyylrkcul5sixxs3uwu.gif" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The quicktime recording was canceled during the process, but there were no surprises after hitting "Partition". Checking disk utility and now I see things looking good.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9egjtkiibozv1i8wnzqs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9egjtkiibozv1i8wnzqs.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fyiwzleoxyv2sqp03cwle.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyiwzleoxyv2sqp03cwle.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Clean out the EFI partition
&lt;/h2&gt;

&lt;p&gt;Remember that mess we made in here? We should at least do something about it. Not sure if Apple will handle it for us. Let's find out.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil mount disk0s1


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

&lt;/div&gt;

&lt;p&gt;Now it shows up in file explorer and we can see what's still there:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fhzglz61jfgg8hj8mnmui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fhzglz61jfgg8hj8mnmui.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's rEFInd, nixos, linux, systemd... I don't even remember which of the others belong in there or don't. &lt;/p&gt;

&lt;p&gt;Let's delete at least rEFInd and nixos. First check what's there&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ls /Volumes/EFI/EFI


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

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.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%2Faepilwodxnevrxy5vfj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Faepilwodxnevrxy5vfj8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows the same thing which makes sense.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo rm -rf /Volumes/EFI/EFI/refind


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo rm -rf /Volumes/EFI/EFI/nixos


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

&lt;/div&gt;

&lt;p&gt;Time to reboot. Going to &lt;code&gt;Apple&amp;gt;Shut down&lt;/code&gt;. We'll also reset the NVRAM by holding CMD+Option+P+R after hitting power to turn it on again (Macs previously used PRAM instead of NVRAM but we get to keep the old keyboard shortcut to reset it).&lt;/p&gt;

&lt;p&gt;I got the apple logo quickly and after continuing to hold the keys for a moment, it flashed and added a loading bar beneath. Boom, Apple login screen! No Bootloader. Everything seems to be working. I checked the EFI partition contents and still saw systemd and Linux in there. Nothing meaningful inside though, so I'm not going to worry about it for now. &lt;/p&gt;

&lt;h2&gt;
  
  
  Re-enable secure boot
&lt;/h2&gt;

&lt;p&gt;Remember shutting that off? Hehe. Let's turn it back on. Shut down again and boot up. This time holding cmd+r for recovery mode.&lt;/p&gt;

&lt;p&gt;Auth as admin, then at the top choose &lt;code&gt;Utilities &amp;gt; Startup Security Utility&lt;/code&gt;. There are two selections to make here. Make the second one first. Select &lt;code&gt;Disallow booting from external or removable media&lt;/code&gt; under &lt;code&gt;Allowed Boot Media&lt;/code&gt;, then select &lt;code&gt;Full Security&lt;/code&gt; under &lt;code&gt;Secure Boot&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;This is the screenshot from Apple's support site. It's not exactly what I see, but it's close. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F2r0pabdr2baf8lz1qxq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F2r0pabdr2baf8lz1qxq8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It asks to select startup disk which I do easily since there's just one option. Then choose Restart and confirm to save the changes.&lt;/p&gt;

&lt;p&gt;Oops. I got an error. &lt;code&gt;Unable to verify startup disk.&lt;/code&gt; Yikes! Even doing First Aid with disk utility didn't help at all. So what do to? Turn it off and back on again, I suppose. Shutting down and booting up again gave me a warning that said a software update was required to use this drive. I agreed and let it do its thing. After a few reboots and loading bars, I finally got an error. It ended up in a loop trying to reboot. &lt;/p&gt;

&lt;p&gt;Holding down the power button to force shut down, then rebooting into recovery again with CMR+R got me out of that cycle. Still couldn't set the boot security. &lt;/p&gt;

&lt;p&gt;I was able to reinstall Ventura via Recovery mode, which despite giving an error at one point, did succeed. And then once entering recovery mode again, I could set secure boot successfully.&lt;/p&gt;

&lt;p&gt;Woohoo! I'm done with this nightmare! Now it'll be easy to wipe this thing for resale some day.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Running NixOS on a laptop is indefinitely suspended project for me now. However, I did build a new gaming PC and am looking forward to putting NixOS on there and trying out Steam Proton. Additionally, my old desktop does still have NixOS, and I'm planning to embrace that and convert it into a home server of some sort. My ideas are to have a media server as well as to look into setting up a home-based Siri replacement. We'll see! Whatever I do, I'll share here on this blog.&lt;/p&gt;

&lt;p&gt;Good luck out there!&lt;/p&gt;

</description>
      <category>nixos</category>
      <category>linux</category>
      <category>dualbooting</category>
    </item>
    <item>
      <title>Day 6: Making rEFInd Look Good</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Wed, 31 May 2023 21:40:45 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-6-making-refind-look-good-m93</link>
      <guid>https://dev.to/raymondgh/day-6-making-refind-look-good-m93</guid>
      <description>&lt;p&gt;Today, we're styling rEFInd to look kewl. In this post, I'll cover setting up rEFInd on my PC as well as creating and applying a custom style. I've already set it up on my Macbook in a previous post, so look back for that if you want to see how to do that. Originally, I thought to use the native apple Startup Manager &amp;amp; PC BIOS startup disk selection. But there are some problems with that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The PC startup disk selection is ugly AF&lt;/li&gt;
&lt;li&gt;I couldn't get the Mac Startup Manager to work right&lt;/li&gt;
&lt;li&gt;I want more consistency across my devices&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So let's get into it!&lt;/p&gt;

&lt;p&gt;BEFORE:&lt;br&gt;
&lt;a href="https://media.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%2Fkvu07keedavmni6qu0ok.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fkvu07keedavmni6qu0ok.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AFTER:&lt;br&gt;
&lt;a href="https://media.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%2F7dl4i7ms3e14xx4e734p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F7dl4i7ms3e14xx4e734p.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro to rEFInd
&lt;/h2&gt;

&lt;p&gt;rEFInd is a "boot manager" which helps you manage booting up your computer into the operating system you want to run. rEFInd is a tried and true open-source boot manager with over a decade of appreciated existence. The author, oderick W. Smith, manages the code and handles feedback on &lt;a href="https://sourceforge.net/p/refind/code/ci/master/tree/" rel="noopener noreferrer"&gt;sourceforge&lt;/a&gt; and maintains a &lt;a href="https://www.rodsbooks.com/refind/" rel="noopener noreferrer"&gt;webpage&lt;/a&gt; with more details. It's not polished for typical consumer use and requires some patience to fully understand, but for the most part you can just use it and not worry too much.&lt;/p&gt;

&lt;h3&gt;
  
  
  Managing rEFInd
&lt;/h3&gt;

&lt;p&gt;Once installed, rEFInd works by scanning a few commonly used places on your drives for boot files and listing them on a menu. When installed in the normal way, rEFInd takes priority over all the boot options and gets itself launched when the machine turns on. It immediately displays its menu of boot options and bows out once you select the one you want. There is a configuration file called which should be found at &lt;code&gt;/EFI/refind/refind.conf&lt;/code&gt; on the EFI partition. &lt;/p&gt;

&lt;p&gt;The file handles a few settings, but most importantly allows for the creation of custom boot "stanzas" which represent the options that will be presented. To fully customize the appearance, we'll want to create a custom stanza for each OS we're booting. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installing and configuring rEFInd on Macbook
&lt;/h2&gt;

&lt;p&gt;I already have rEFInd installed from my prior days' work, but you can install it by booting into recovery mode with &lt;code&gt;CMD+R&lt;/code&gt;, disabling SIP with the terminal in recovery mode with &lt;code&gt;csrutil disable&lt;/code&gt;, booting back into normal mode, and running the install script you get from unzipping the binary file linked on &lt;a href="https://www.rodsbooks.com/refind/getting.html" rel="noopener noreferrer"&gt;this page&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;With modern Macbooks, managing the boot option is a bit more difficult. Normally, all booting happens from an EFI partition on the main drive. This was once true for OSX as well. With macOS and APFS, the boot is now initiated from within the preboot volume of the main APFS container. Meanwhile, our linux boot will still be in the EFI partition.&lt;/p&gt;

&lt;p&gt;First, check your APFS volumes and their unique identifiers&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

diskutil apfs list


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

&lt;/div&gt;

&lt;p&gt;Which should give you something like this:&lt;br&gt;
&lt;a href="https://media.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%2F5nkb94tahxl95wbtzzza.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F5nkb94tahxl95wbtzzza.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that still open, open a new Finder window and &lt;code&gt;CMD+UP&lt;/code&gt; all the way to the top where you'll see your mounted drives and Network. Now dive down into &lt;code&gt;Macintosh HD/System/Volumes/Preboot&lt;/code&gt;. Here you should find at least one folder with a UID as the name, plus a &lt;code&gt;com.apple.security.cryptexd&lt;/code&gt; folder and a &lt;code&gt;Crpytexes&lt;/code&gt; folder, both of which we can ignore. What we care about here is the name of the correct UID folder. I have two, I don't know why. You might just have one. One of them will help us the other won't. The good one will have a string that matches one of the APFS volumes you saw when running &lt;code&gt;diskutil apfs list&lt;/code&gt;.  Looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fy4s8co14xzcfsxdzf1on.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fy4s8co14xzcfsxdzf1on.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case, the match is &lt;code&gt;38F253E9-6CF0-4612-8D51-383D68564E12&lt;/code&gt;. Plz don't hack me. Kidding, this should be fine.&lt;/p&gt;

&lt;p&gt;With this information, we can now construct our rEFInd boot stanza. Using that string we can create an entry that looks like the code below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

menuentry "My macOS TEST" {
    icon \EFI\refind\icons\os_mac.png
    volume "Preboot"
    loader \38F253E9-6CF0-4612-8D51-383D68564E12\System\Library\CoreServices\boot.efi
    enabled
}


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

&lt;/div&gt;

&lt;p&gt;We need to add this to our refind.conf file which is in the EFI partition. To access it, first find that disk identifer with &lt;code&gt;diskutil list&lt;/code&gt;. Mine is &lt;code&gt;disk0s1&lt;/code&gt; and yours probably is too. Mount it with another command, &lt;code&gt;diskutil mount disk0s1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now when you navigate all the way up, you'll see &lt;code&gt;EFI&lt;/code&gt; listed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F8n6gqazztgk0awhzc14b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F8n6gqazztgk0awhzc14b.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The file we want to modify is at &lt;code&gt;EFI/EFI/refind/refind.conf&lt;/code&gt;. You can paste your stanza down at the bottom of the file after all the example stanzas (note they are all marked &lt;code&gt;disabled&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;Save it, shut down, boot up, and see if your new bootable entry shows up alongside your normal options. Remember, adding a stanza to your config can only add options to your rEFInd boot menu, it will never remove or overwrite an existing boot option. I tested and mine worked, so now let's add the NixOS stanza.&lt;/p&gt;

&lt;p&gt;My boot file turns out to be located at &lt;code&gt;EFI/EFI/systemd/systemd-bootx64.efi&lt;/code&gt;. I'm not sure if it's it'll always be there if NixOS was installed another way, but the good news is that I found it simply by reading the option that rEFInd presented to me. I added this stanza to the refind.conf file below the macOS entry:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

menuentry "My NixOS TEST" {
    icon \EFI\refind\icons\os_mac.png
    loader \EFI\systemd\systemd-bootx64.efi
    enabled
}


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

&lt;/div&gt;

&lt;p&gt;I rebooted and tested out the new entry to confirm that it booted NixOS as expected*. Woot! Now all that's left is styling which I'll do at the same time for both machines.&lt;/p&gt;

&lt;p&gt;I rebooted and tested out the new entry to confirm that it booted NixOS as expected*. Woot! Now all that's left is styling which I'll do at the same time for both machines.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;*Note: Something weird happened here for me. I tested a few times and saw inconsistent activation of the keyboard and trackpad in the rEFInd environment. What's more is that a couple times I booted into the command line instead of KDE Plasma. It seems to work intermittently though, so I will ignore and return to this later.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing and configuring rEFInd on PC
&lt;/h2&gt;

&lt;p&gt;To install, I'm following the steps &lt;a href="http://www.rodsbooks.com/refind/installing.html#windows" rel="noopener noreferrer"&gt;here&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;I'll be installing rEFInd on my nvme drive which is where Windows is located, so I'll start by booting into Windows and mounting the EFI partition:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mountvol R: /S 


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

&lt;/div&gt;

&lt;p&gt;This makes Local Disk (R:) appear in Explorer, but we'll need to run Explorer as an admin to get access to the contents. To do that, open task manager and end &lt;code&gt;explorer.exe&lt;/code&gt; so we can reopen it as an admin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F9wb0pkbhu9hpmrj8hn5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F9wb0pkbhu9hpmrj8hn5w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And to reopen it, go to File&amp;gt;Run new task and enter &lt;code&gt;explorer.exe /nouaccheck&lt;/code&gt; with the admin checkbox selected. Hit OK.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fyjxegopqmegvyo1efuvh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fyjxegopqmegvyo1efuvh.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now open an explorer window and find the R drive. Woot! &lt;/p&gt;

&lt;p&gt;Next I downloaded rEFInd and extracted the files to my desktop. Then I opened command prompt as an administrator (right click) and navigated to the refind folder with &lt;code&gt;cd C:\Users\raymo\Desktop\refind-bin-0.14.0.2\refind-bin-0.14.0.2&lt;/code&gt;. Then to copy files into places, I ran the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

xcopy /E refind R:\EFI\refind\


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

&lt;/div&gt;

&lt;p&gt;A list of copied files appeared so we know it worked. Next, let's go into the drive. Enter &lt;code&gt;R:&lt;/code&gt; into CMD to switch to that partition. Followed by &lt;code&gt;cd EFI\refind&lt;/code&gt; to get into the refind folder. &lt;/p&gt;

&lt;p&gt;Now rename the config file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

rename refind.conf-sample refind.conf


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

&lt;/div&gt;

&lt;p&gt;And perhaps most importantly, run the following to make refind the default boot program.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

bcdedit /set "{bootmgr}" path \EFI\refind\refind_x64.efi


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

&lt;/div&gt;

&lt;p&gt;Let's go ahead and rename as well to make life easy:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

bcdedit /set "{bootmgr}" description "rEFInd"


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

&lt;/div&gt;

&lt;p&gt;In Explorer, let's now go in and remove some unnecessary drivers that will slow us down. There are 3 driver folders: &lt;code&gt;aa64&lt;/code&gt;, &lt;code&gt;ia32&lt;/code&gt;, and &lt;code&gt;x64&lt;/code&gt;. I created a new folder at that same level called &lt;code&gt;extra drivers&lt;/code&gt; and dragged the aa64 and ia32 folders into it. Then in the &lt;code&gt;drivers_x64&lt;/code&gt; folder, I think the only thing I need is the ext4 driver. Windows will bring its own ntfs driver and I'm not using the other file system formats on the list. However, I'll just keep everything there for now.&lt;/p&gt;

&lt;p&gt;Now reboot and get into rEFInd! Since my PC at this point had the Linux drive as the priority, I still needed to hit &lt;code&gt;del&lt;/code&gt; when booting up to select my boot option, but once I selected the rEFInd option, it loaded and presented me with a couple options including my Windows and NixOS intalls. &lt;/p&gt;

&lt;p&gt;Now we want to create manual boot stanzas to give us full control and flexibility. Let's go into NixOS and get the EFI partition's UUID. To do so, run&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo blkid


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

&lt;/div&gt;

&lt;p&gt;Which returned all my partitions and their UUIDs including /dev/sda1 which is the EFI partition with my NixOS bootloader.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

/dev/sda1: UUID="0B3F-2C1E" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="b329461d-b3af-b446-9209-1e79653206ea"



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

&lt;/div&gt;

&lt;p&gt;Now to add the menu entry for NixOS. First, mount the first drive's EFI partition. Add a connection point first:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo mkdir /mnt


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

&lt;/div&gt;

&lt;p&gt;Then mount it. Note, your partition may be elsewhere, so nvme0n1p1 might not be what you need. Run &lt;code&gt;lsblk&lt;/code&gt; to check.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo mount /dev/nvme0n1p1 /mnt


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

&lt;/div&gt;

&lt;p&gt;Then find &lt;code&gt;/mnt/EFI/refind/refind.conf&lt;/code&gt; and edit it. Add the following to the bottom:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

menuentry "NixOS" {
    icon \EFI\refind\icons\os_unknown.png
    volume b329461d-b3af-b446-9209-1e79653206ea
    loader \EFI\systemd\systemd-bootx64.efi
    enabled
}


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

&lt;/div&gt;

&lt;p&gt;Save, exit, and reboot to test! It worked for me, so now let's add a manual boot menuentry for windows too. This should be easy and for the most part consistent across devices. I have Windows 10 so I'm adding this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

menuentry "Windows 10" {
    icon /EFI/refind/icons/os_win.png
    loader /EFI/Microsoft/Boot/bootmgfw.efi
    enabled
}


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

&lt;/div&gt;
&lt;h2&gt;
  
  
  Styling
&lt;/h2&gt;

&lt;p&gt;Now we'll style both Mac and PC at the same time. There are a few things I'd like to do.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make the rEFInd background black&lt;/li&gt;
&lt;li&gt;Use custom icons for NixOS, Windows 10, and macOS&lt;/li&gt;
&lt;li&gt;Hide the text labels for each boot option&lt;/li&gt;
&lt;li&gt;Hide the non-customized boot options&lt;/li&gt;
&lt;li&gt;Replace the extra options icons with consistent minimal icons&lt;/li&gt;
&lt;li&gt;Hide or modify the help text &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;One of the first things to do is to check the maximum resolution rEFInd can support. To do this, add a line to your refind.conf file with your monitor resolution like this:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

resolution 2560 1440


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

&lt;/div&gt;

&lt;p&gt;Booting into rEFInd will now look really clear or you'll get an error like I did. Apparently the my firmware only supports 4 graphics modes before an OS loads more drivers. I'm not sure how to add more, but I did see my Motherboard has had a few firmware revisions since I bought it, but I don't want to mess with that and risk my entire setup right now. Maybe another day!&lt;/p&gt;

&lt;p&gt;Here's what I have available:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Mode 0: 800 x 600
Mode 1: 1024 x 760
Mode 2: 1280 x 1024
Mode 3: 1600 x 1200


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

&lt;/div&gt;

&lt;p&gt;Unfortunately, none of these aspect ratios match my monitor. So I'm going to design my icons with the expectation that they'll be stretched out across my 16:9 aspect ratio. I'll set mode 3 since it's the highest resolution with &lt;code&gt;resolution 1600 1200&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To get from 1600 to 2560 we multiply by 1.6&lt;br&gt;
To get from 1200 to 1440 we multiply by 1.2&lt;/p&gt;

&lt;p&gt;So if we have a 128x128 icon being stretched 1.6 wider and 1.2 taller, it will end up looking like a 204.8x153.6 image which will be stretched wide. Therefore, to have something appear like 128x128, I need icons that are 128/1.6 x 128/1.2, or 80x106.66. &lt;/p&gt;

&lt;p&gt;I opened photoshop an created a PSD template to help me build the images I needed. The image dimensions need to remain 144x144 and 128x128, but the content inside needs to be reverse-scaled in proportion. My template looked like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fb81mfto9r6p5l36pqhux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fb81mfto9r6p5l36pqhux.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And my actual icons ended up like this (You're on dev.to/forem dark mode right?):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F33clve1v3xh6eadrtymh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F33clve1v3xh6eadrtymh.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.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%2F1nn73hhm514xuoysf6t1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1nn73hhm514xuoysf6t1.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.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%2Fmpikt42cuwoytxnmgqg0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fmpikt42cuwoytxnmgqg0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the background, I got a neato abstract image by asking &lt;a href="https://openai.com/product/dall-e-2" rel="noopener noreferrer"&gt;dall-e&lt;/a&gt; for &lt;code&gt;a logo featuring a wild splattering of 2 dimensional shapes of groovy neon colors, centered on a black background, with a few stylish pixelated defects arranged to imply a high forward velocity into the image&lt;/code&gt;. I stretched it out to two different sizes for my two displays and named it &lt;code&gt;computer_.png&lt;/code&gt; (the first draft of my background image had a techno font of the word &lt;code&gt;computer_&lt;/code&gt; and I just kept the file name after scrapping that idea).&lt;/p&gt;

&lt;p&gt;Here are the settings I needed to add to &lt;code&gt;refind.conf&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;For best screen resolution on PC:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

resolution 1600 1200


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

&lt;/div&gt;

&lt;p&gt;(Note: On mac, I didn't need to do this. I just made sure my background image was 3360x2100 since my retina display was 1680x1050).&lt;/p&gt;

&lt;p&gt;For my black background and neato banner&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

banner icons_skewed/computer_.png


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

&lt;/div&gt;

&lt;p&gt;To hide all the other non-OS boot option stuff&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

showtools


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

&lt;/div&gt;

&lt;p&gt;To hide the hard drive icons and helper text&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

hideui badges,label,hints


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

&lt;/div&gt;

&lt;p&gt;To add a white dot under the OS currently selected&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

selection_small selection_small.png
selection_big icons_skewed/selection_big.png


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

&lt;/div&gt;

&lt;p&gt;And that's about it. On my mac, the resolution was different with retina display and all. So I have the line &lt;code&gt;resolution xxx yyy&lt;/code&gt; there, but otherwise it's all the same. &lt;/p&gt;

&lt;h3&gt;
  
  
  Done!
&lt;/h3&gt;

&lt;p&gt;That was honestly a lot more work than I expected. I also did a bit of research into patching my gigabyte mobo bios to support higher resolutions and found a very little guidance online on how to do that. In the end, I think the design is nice enough and I'm happy to be rid of that 90s web look. Now as long as none of my OS updates stage a "boot coup", I should be good to go.&lt;/p&gt;

</description>
      <category>refind</category>
      <category>nixos</category>
      <category>dualboot</category>
    </item>
    <item>
      <title>Day 5: NixOS &amp; Git - version control for config.nix</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Wed, 17 May 2023 03:46:49 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-5-syncing-nix-config-across-laptop-and-desktop-1i41</link>
      <guid>https://dev.to/raymondgh/day-5-syncing-nix-config-across-laptop-and-desktop-1i41</guid>
      <description>&lt;p&gt;In my last post, I finally got NixOS dualbooting successfully on my Macbook Pro alongside macOS. In this post, I'll set up my desktop to dualboot NixOS and Windows 10. I'll also configure a github repository to track and sync my NixOS configuration for both of my devices.&lt;/p&gt;

&lt;p&gt;My desktop PC is an aging mini-itx gaming machine with parts matching this &lt;a href="https://pcpartpicker.com/user/wudf/saved/#view=TJgJxr"&gt;pcpartpicker list&lt;/a&gt;. Needless to say, the config will be slightly different for this pc than my macbook pro. Let's see how the magic of Nix makes it easy to manage both with the same code.&lt;/p&gt;

&lt;p&gt;I imagine the organization of my nix config will continue to evolve over time, but since it's all code and I'll be using version control, I feel pretty happy to experiment. The structure I'll be implementing today is pictured below and the actual configuration can be seen in the &lt;a href="https://github.com/raymondgh/nix-config/tree/v0.2.0"&gt;v0.2.0 tag on my github repo&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;/home/ray/nix-config/
├── README.md
├── common-configuration.nix
└── hosts
    ├── nixos-mbp
    │   ├── configuration.nix
    │   ├── hardware-configuration.nix
    │   └── firmware
    └── nixos-desktop
        ├── configuration.nix
        └── hardware-configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Basic tools first
&lt;/h3&gt;

&lt;p&gt;I use the Github desktop client. I admit it. I like it. I love it. I hate command line git. Sourcetree confuses me. I will grow one day. But today, I'm getting stuff done, not fighting for street cred. &lt;/p&gt;

&lt;p&gt;I boot into the my Plasma NixOS environment that I set up for my Macbook Pro (as detailed in the &lt;a href="https://dev.to/raymondgh/day-4-reinstalling-nixos-on-my-apfs-t2-intel-macbook-pro-265n"&gt;previous post&lt;/a&gt;) and log in with my user account. I open &lt;code&gt;Konsole&lt;/code&gt; from the start-like menu and run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano ../../etc/nixos/configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I scroll toward the bottom and add two system packages, so that my systemPackages config looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  environment.systemPackages = with pkgs; [
      git
      (vscode-with-extensions.override {
        vscodeExtensions = with vscode-extensions; [
          bbenoist.nix
        ];
      })
      github-desktop
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's some explanation of how this works in my &lt;a href="https://dev.to/raymondgh/day-2-configurationnix-5cj3"&gt;Day 2 Post&lt;/a&gt; and it's kind of easy to understand, so I won't go into details in this post. With that, I do a quick &lt;code&gt;sudo nixos-rebuild switch&lt;/code&gt; and boom I've got VSCode with Nix syntax highlighting as well as Github desktop installed. I'm ready to do this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Version control for Nix Config
&lt;/h3&gt;

&lt;p&gt;One does not simply initialize a git repo in &lt;code&gt;/etc/nixos&lt;/code&gt;. This is a protected area, where changes require root access. From what I can see there are a couple popular options for handling this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use sudo commands &amp;amp; git cli to manage repo in &lt;code&gt;/etc/nixos&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Grant your user ownership of &lt;code&gt;/etc/nixos&lt;/code&gt; &lt;/li&gt;
&lt;li&gt;Configure nix to load config from another location&lt;/li&gt;
&lt;li&gt;Putting symlink(s) in &lt;code&gt;/etc/nixos&lt;/code&gt; that point to another location&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are probably the best ways to do it right now. I also explored using multiple branches and worktrees but that got cumbersome fast. Ultimately, I just want something easy. To do that, I'll use one symlink and a repo in my home directory.&lt;/p&gt;

&lt;p&gt;First, what is a symlink? A symlink is a symbolic link and differs from a hard link. Simply stated, a hard link is a reference to data and a symbolic link is a reference to a reference. It can get pretty technical if you look much deeper than that. But essentially, if I replace the file &lt;code&gt;/etc/nixos/configuration.nix&lt;/code&gt; with a symlink of the same name which targets the config file in my home directory repo, Nix will follow that path and evaluate the config files in my repo instead of &lt;code&gt;/etc/nixos&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's do it.&lt;/p&gt;

&lt;p&gt;First, I cloned my &lt;a href="https://github.com/raymondgh/nix-config"&gt;existing repository&lt;/a&gt; to &lt;code&gt;/home/ray/nix-config/&lt;/code&gt; using Github desktop. Then I moved my current working files into that repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo cp -r /etc/nixos /home/ray/nix-config/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, I deleted everything in &lt;code&gt;/etc/nixos&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;sudo rm -rf /etc/nixos/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I created the symlink&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /home/ray/nix-config/configuration.nix /etc/nixos/configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And finally, tested it out&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nixos-rebuild dry-activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That created a new result file (actually another symlink!) which I added to my gitignore. &lt;/p&gt;

&lt;p&gt;Since I'm not collaborating with anyone and I hope to be careful about my changes, I'll be working directly out of the main branch w/o pull requests. This is a little iffy because it means it's very easy to make quick changes to my device's active config. Ideally I could have the ease of Github desktop's git action UX and diff highlighting as well as some kind of confirmation for when I update the config that's actually in use by the computer. Perhaps someone can comment with advice! In any case, it's time to move on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Refactoring config layout
&lt;/h3&gt;

&lt;p&gt;My current config is essentially the NixOS default. The contents for my laptop are pinned in a release &lt;a href="https://github.com/raymondgh/nix-config/releases/tag/v0.1.1"&gt;here&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;/etc/nixos/
├── configuration.nix
├── hardware-configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To adapt to the new structure, I'll create a &lt;code&gt;common-configuration.nix&lt;/code&gt; file which is accessed by each device as well as a dedicated directory for &lt;code&gt;configuration.nix&lt;/code&gt; and &lt;code&gt;hardware-configuration.nix&lt;/code&gt; for each device. For each device, 1 symlink will be created pointing &lt;code&gt;/etc/nixos/configuration.nix&lt;/code&gt; to &lt;code&gt;/home/ray/nix-config/HOSTNAME/configuration.nix&lt;/code&gt;. I'll try to keep as much config in the common file as possible.&lt;/p&gt;

&lt;p&gt;First, I'm creating the new file structure and leaving the common file empty. Nothing changing besides locations. That means removing the symlink I just built and creating a new one with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo rm /etc/nixos/configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /home/ray/nix-config/hosts/nixos-mbp/configuration.nix /etc/nixos/configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once I get that working, I create the common file as an "empty" config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# NixOS Configuration common to both of my machines

{ config, pkgs, ... }:
{}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next I update my imports in &lt;code&gt;nixos-mbp/configuration.nix&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;imports =
  [ # Common configuration
    ../../common-configuration.nix
    # Include the results of the hardware scan.
    ./hardware-configuration.nix
    # Firmware for keyboard, trackpad, etc
   "${builtins.fetchGit { url = "https://github.com/kekrby/nixos-hardware.git"; }}/apple/t2"
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reference to the common file goes up to the root of my git repo and the reference to the hardware config looks in the same host directory. Lastly, the third part pulls in some firmware stuff we need for the macbook.&lt;/p&gt;

&lt;p&gt;Now I'm going through the rest of the config file and moving anything that I think should be in the common config file. I end up with just 4 "uncommon" things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hostname&lt;/li&gt;
&lt;li&gt;Imports&lt;/li&gt;
&lt;li&gt;Broadcom firmware&lt;/li&gt;
&lt;li&gt;Touchpad support&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Next, I'm going to duplicate this file and add it to a new directory for my desktop computer. Normally I'd do this with the GUI, but here's the CLI command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cp -r hosts/nixos-mbp/configuration.nix hosts/nixos-desktop/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Maybe I'm learning linux after all. Anyway, I open that new file in VSCode and remove the firmware import, the wifi firmware, and the touchpad entry. I change the hostname and my file looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Config for nixos-mbp device

{ config, pkgs, ... }:

{
  networking.hostName = "nixos-desktop"; # Define your hostname.

  imports =
    [ # Common configuration
      ../../common-configuration.nix
      # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

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

&lt;/div&gt;



&lt;p&gt;Now I think I'm ready to install on the PC!&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing NixOS on PC
&lt;/h3&gt;

&lt;p&gt;Now there's no reason to make this difficult. I downloaded the GNOME 64-bit graphical installer from the &lt;a href="https://nixos.org/download.html#nixos-iso"&gt;Nix site&lt;/a&gt;, flashed an 8GB drive with &lt;a href="https://www.balena.io/etcher"&gt;Balena Etcher&lt;/a&gt; I downloaded onto my Windows 10 system and spammed F12 when booting back up.&lt;/p&gt;

&lt;p&gt;I clicked &lt;code&gt;Next&lt;/code&gt; 3 times, entered a name and password, clicked next 2 more times, checked &lt;code&gt;Allow unfree software&lt;/code&gt;, clicked next, chose my 12 year old SSD, selected &lt;code&gt;Erase Disk&lt;/code&gt; with Swap (with Hibernate), clicked next, clicked install, waited a bit, checked a box to reboot, and hit done.&lt;/p&gt;

&lt;p&gt;Booting up, I smashed F12 again and chose "Linux Boot Manager (P2: OCZ Agility3) and there I was, staring down the login screen with my name on it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring desktop with the repo config
&lt;/h3&gt;

&lt;p&gt;Now I need to do a few things to get in sync with my laptop environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone my nix-config repo&lt;/li&gt;
&lt;li&gt;Move my hardware-configuration.nix into it&lt;/li&gt;
&lt;li&gt;Replace my configuration.nix with a symlink to the repo file&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To do that, I'll temporarily install git with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nix-env -i git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and I'll clone the repo into place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/raymondgh/nix-config /home/ray/nix-config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Moving the hardware config into the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv /etc/nixos/hardware-configuration.nix /home/ray/nix-config/hosts/nixos-desktop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Removing the current config.nix file from etc/nixos&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm mnt/etc/nixos/configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then replacing it with the symlink:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ln -s /home/ray/nix-config/hosts/nixos-desktop/configuration.nix /etc/nixos/configuration.nix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One last thing to do that I learned the hard way -- grant my user ownership of the directory I cloned with root&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown -R ray /home/ray/nix-config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And we should be good to rebuild!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nixos-rebuild switch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and with that done, I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pushing back to Github
&lt;/h3&gt;

&lt;p&gt;Now that our desktop has everything in place, it's time to give back. Opening Github desktop, I choose "add local repository" and select my &lt;code&gt;/ray/nix-config&lt;/code&gt; directory. It's instantly set up and all I need to do is commit and push to origin.&lt;/p&gt;

&lt;p&gt;And with that, I've got two machines running nearly identical operating systems with a single codebase under version control managing their features. &lt;/p&gt;

&lt;p&gt;Whenever I install something, I'll ask myself "Is this for both of my machines, or just one?" and put that new or changed nix expression in either the common-configuration.nix file or the HOSTNAME/configuration.nix file accordingly. Then when I log on to the other machine, I'll pull the latest from the repo, do a &lt;code&gt;nixos-rebuild switch&lt;/code&gt; and enjoy being totally in sync. Pretty snazzy!&lt;/p&gt;

&lt;h3&gt;
  
  
  What's next
&lt;/h3&gt;

&lt;p&gt;Now I've really got my foundation landed. I should try to get something productive done. My next updates might be more quality of life (like getting sound to work on the laptop or making my desktop nicer) or functional (getting a software dev environment set up). At least from what I've read, once I get around to nix flakes or home manager, I'll have more challenges to figure out. As always, thanks for reading and let me know what you think!&lt;/p&gt;

</description>
      <category>nixos</category>
      <category>git</category>
      <category>configuration</category>
    </item>
    <item>
      <title>Day 4: (Re)Installing NixOS on my Macbook Pro</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Sun, 14 May 2023 00:37:37 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-4-reinstalling-nixos-on-my-apfs-t2-intel-macbook-pro-265n</link>
      <guid>https://dev.to/raymondgh/day-4-reinstalling-nixos-on-my-apfs-t2-intel-macbook-pro-265n</guid>
      <description>&lt;p&gt;If you're following from previous notes, you'll know that I'm starting fresh. I've got a totally fresh install of macOS Ventura and I'm ready to rock and roll. I'm combining a couple different guides to get my setup working and I'm noting everything I do here. Spoiler: I got it working this time! Let's get started!&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic Setup
&lt;/h3&gt;

&lt;p&gt;To clarify, my Macbook is an APFS T2 Intel Macbook Pro 2019 15 inch. If you follow this with another device, there may be some differences in steps required. But at least this section is easy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Plug in power&lt;/li&gt;
&lt;li&gt;Plug in Ethernet via USB-C adapter (optional)&lt;/li&gt;
&lt;li&gt;Plug in Get 4GB* USB for install media (via USB-C adapter)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*I actually used a 16gb drive this time, but I did use a 4gb in the past and I think it was good enough.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create installation media
&lt;/h3&gt;

&lt;p&gt;I downloaded the minimal &lt;a href="https://github.com/t2linux/nixos-t2-iso/releases" rel="noopener noreferrer"&gt;nixos-t2-release&lt;/a&gt; and used &lt;a href="https://gitlab.com/bztsrc/usbimager" rel="noopener noreferrer"&gt;USBImager&lt;/a&gt; to write the resulting ISO to my usb drive. &lt;a href="https://www.balena.io/etcher" rel="noopener noreferrer"&gt;Balena Etcher&lt;/a&gt; is a good choice as well.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create new partitions on Macbook Pro SSD
&lt;/h3&gt;

&lt;p&gt;This can be done many ways, but I decided to use the macOS Disk Utility because it seems like the safest way to avoid messing up my APFS partition. Here is the desired endstate:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Total Physical SSD Storage: 500GB
0. EFI Partition (&amp;lt;1 GB; Not shown in Disk Utility)
1. APFS Partition (250 GB; macOS has volumes within this)
2. ExFAT Partition (30 GB; CrossData - sharing between OSes)
3. Ext4 Partition (120 GB; NixOS Root)
4. Ext4 Partition (80 GB; NixOS Home)
5. Swap Partition (20 GB; Swap - Memory Overflow for NixOS)


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

&lt;/div&gt;

&lt;p&gt;I am giving a lot of space to NixOS root because this is where I understand packages and previous generations will be stored. I also witnessed online that people who complain about running out of space in their root partition are mocked by people who claim to be allocating 100+ GB to it. It seems to me that this is a bit of a mental shift from past operating systems. Since all my programs will be nix packages, they can be nicely separated from my personal files and data. Apple has done a pretty neat thing with APFS. macOS's portion of the drive is so tidy because all the operational divisions are handled with dynamically sized &lt;code&gt;volumes&lt;/code&gt; within the APFS partition. Meanwhile, Microsoft will screw up your EFI partition, so you need a second EFI to mitigate that if you want to triple boot. I don't really understand all that, but I'm just going to use one for now. &lt;/p&gt;

&lt;p&gt;Here's how to create the partitions with macOS GUI Disk Utility. The trick is to click the right items in the right order.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;View &amp;gt; Show all devices&lt;/li&gt;
&lt;li&gt;Click the top level APPLE SSD AP0512M Media&lt;/li&gt;
&lt;li&gt;Click Partition&lt;/li&gt;
&lt;li&gt;Hit the +; choose &lt;code&gt;Add Partition&lt;/code&gt; not volume&lt;/li&gt;
&lt;li&gt;Set the size for the partition&lt;/li&gt;
&lt;li&gt;Name the partition&lt;/li&gt;
&lt;li&gt;Select the &lt;code&gt;ExFat&lt;/code&gt; format&lt;/li&gt;
&lt;li&gt;Hit Apply &amp;amp; Confirm&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Plus button first, then size, then name, then format.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Do this for each partition. I did it 4 times to create my CrossData partition and 3 partitions for NixOS (NixOS Root, NixOS Home, and Swap). Sometimes there may be an error. I don't know the consequences of that, but I just respond by deleting the new partition and creating it again. One time it took 3 tries, but usually it works the first time.&lt;/p&gt;

&lt;p&gt;Looks like this for me now:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2F1redz3vx0hzi4a5vs4q9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F1redz3vx0hzi4a5vs4q9.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Extract the Macbook Devices Firmware
&lt;/h3&gt;

&lt;p&gt;We need to get the firmware from macOS somewhere linux can access it. The &lt;a href="https://wiki.t2linux.org/guides/wifi-bluetooth/#on-macos" rel="noopener noreferrer"&gt;t2linux site&lt;/a&gt; provides a handy script called &lt;code&gt;firmware.sh&lt;/code&gt; which has a macOS portion and a Linux portion. The macOS portion does 2 things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Zips the firmware files up into &lt;code&gt;firmware.tar.gz&lt;/code&gt; on the EFI partition&lt;/li&gt;
&lt;li&gt;Copies the firmware.sh script into the EFI partition as well&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Download the script, &lt;code&gt;cd&lt;/code&gt; into its directory, and run it. &lt;/p&gt;

&lt;p&gt;Grant execution permission with chmod first.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

chmod +x firmware.sh


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

&lt;/div&gt;

&lt;p&gt;Execute it&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

./firmware.sh


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

&lt;/div&gt;

&lt;p&gt;If you want to do it manually, you can follow the steps on &lt;a href="https://github.com/Redecorating/archiso-mbp/blob/2898e6f957c6afb239ce466ab3909719098977aa/airootfs/root/wifi-firmware/wifi.md?plain=1#L27" rel="noopener noreferrer"&gt;this guide&lt;/a&gt;. Those steps include the easy part (copying the files over) as well as the hard part (packaging them up appropriately). Looked a little intimidating for me, so I stuck to running the &lt;code&gt;firmware.sh&lt;/code&gt; script and crossing my fingers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prepare for dual booting
&lt;/h3&gt;

&lt;p&gt;I'm not sure why, but I still couldn't boot into another device without rEFInd. Here's what I had to do to get my boot-up process working.&lt;/p&gt;

&lt;p&gt;Boot into recovery mode by holding &lt;code&gt;CMD+R&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use Startup Security Utility to set secure boot to &lt;code&gt;No Security&lt;/code&gt; and allowed boot media to &lt;code&gt;Allow booting&lt;/code&gt;. Apple docs on this &lt;a href="https://support.apple.com/en-us/HT208198" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Use Terminal to disable system integrity protection (SIP) by running &lt;code&gt;csrutil disable&lt;/code&gt;. Apple docs &lt;a href="https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reboot to normal macOS and download rEFInd from the &lt;code&gt;A binary zip file&lt;/code&gt; sourceforge link from &lt;a href="https://www.rodsbooks.com/refind/getting.html" rel="noopener noreferrer"&gt;rodsbooks website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;From its directory, run the install script&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

./refind-install


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

&lt;/div&gt;

&lt;p&gt;To make life easier, I also set an nvram parameter so that I wouldn't have to hold option &lt;code&gt;⌥&lt;/code&gt; to boot to startup manager.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo nvram manufacturing-enter-picker=true


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Boot from USB
&lt;/h3&gt;

&lt;p&gt;Time to get down to business. Restart the mac and we should see two boot options: Macintosh HD and EFI Boot. Since I have rEFInd installed, it doesn't matter what I choose at this point, but if you don't, you need to pick EFI Boot. &lt;/p&gt;

&lt;p&gt;When rEFInd loads, what I saw was a list of 4 boot options.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;macOS from Preboot (ssd)&lt;/li&gt;
&lt;li&gt;Boot EFI\boot\refind_x64.efi from EFIBOOT (usb)&lt;/li&gt;
&lt;li&gt;Boot Fallback boot loader from EFIBOOT (usb)&lt;/li&gt;
&lt;li&gt;Boot Legacy OS from whole disk volume (usb)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now I don't fully understand these options, but I know to boot from my install media, I need to choose #3. Some text comes up, I get brief GUI boot option and let the timer countdown to 0 to automatically choose the first option. Some green and white matrix code flies by and next thing I know I'm at the NixOS Live CD command line.&lt;/p&gt;
&lt;h3&gt;
  
  
  Finish preparing the drive
&lt;/h3&gt;

&lt;p&gt;Welcome to the command line. We should see a blinking underscore after &lt;code&gt;[nixos@nixos:~]$&lt;/code&gt;. We have a few steps to take before actually installing NixOS. First things first, let's make the font size bigger. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

setfont ter-v32n


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

&lt;/div&gt;

&lt;p&gt;Wow!!! The keyboard works!!! We're on the right track! Next let's take a look at the partitions we prepared earlier&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT


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

&lt;/div&gt;

&lt;p&gt;This gives me a bunch of stuff, take a look:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NAME        FSTYPE    SIZE     MOUNTPOINT
loop0       squashfs  800M     /nix/.ro-store
sda         iso9660   14.7G
├─sda1      iso9660   839M     /iso
└─sda2      vfat      3M
nvme0n1               465.9G
├─nvme0n1p1 vfat      300M
├─nvme0n1p2 apfs      232.8G
├─nvme0n1p3 exfat     18.6G
├─nvme0n1p4 exfat     74.5G
├─nvme0n1p5 exfat     111.8G
└─nvme0n1p6 exfat     27.9G


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

&lt;/div&gt;

&lt;p&gt;Looks familiar, right? Now we need to format the two NixOS partitions as Ext4. We'll keep the CrossData partition as exfat and we'll format the swap partition differently.&lt;/p&gt;

&lt;p&gt;First, let's format the swap partition and label it &lt;code&gt;swap&lt;/code&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo mkswap -L swap /dev/nvme0n1p3


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

&lt;/div&gt;

&lt;p&gt;Next, let's format the nixos partition. Graciously, it gave me a confirmation dialog to confirm. That's good because this command wipes the contents of the partition. I don't know what will happen if you wipe the APFS partition. Can't be very good.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo mkfs.ext4 -L nixos /dev/nvme0n1p5


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

&lt;/div&gt;

&lt;p&gt;Finally, the partition for the home directory&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

sudo mkfs.ext4 -L home /dev/nvme0n1p4


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

&lt;/div&gt;

&lt;p&gt;Let's check our work&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

lsblk -o NAME,FSTYPE,SIZE,LABEL,MOUNTPOINT


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

&lt;/div&gt;

&lt;p&gt;Same command as before, but now with the LABEL column.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NAME        FSTYPE    LABEL                         SIZE     MOUNTPOINT
loop0       squashfs  802.6M                                 /nix/.ro-store
sda         iso9660   nixos-minimal-23.05-x86_64    14.7G
├─sda1      iso9660   nixos-minimal-23.05-x86_64     839M    /iso
└─sda2      vfat      EFIBOOT                          3M
nvme0n1                                            465.9G
├─nvme0n1p1 vfat      EFI                            300M
├─nvme0n1p2 apfs                                   232.8G
├─nvme0n1p3 swap      swap                          18.6G
├─nvme0n1p4 ext4      home                          74.5G
├─nvme0n1p5 ext4      nixos                        111.8G
└─nvme0n1p6 exfat     CrossData                     27.9G


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

&lt;/div&gt;

&lt;p&gt;Looking good! Before we continue mounting, let's follow this complex process for connecting to the internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Loading Wi-Fi firmware to installer
&lt;/h3&gt;

&lt;p&gt;With an ethernet-USBC adapter, you'll automatically be able to connect online, but these steps will still help prepare for regular usage later on, so I suggest following them.&lt;/p&gt;

&lt;p&gt;First, let's run that &lt;code&gt;firmware.sh&lt;/code&gt; script from before. Remember the first time we ran it, it just copied the script file into the EFI partition along with a the zipped firmware files. Thanks to its power of conditional statements, it will do something else when run on Linux. Run the script with this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

./mnt/boot/firmware.sh


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

&lt;/div&gt;

&lt;p&gt;Hopefully that works for you first try. When I did it, it failed and I ended up going in and reading the script so that I could pick out parts to execute manually. I think my mistake was mounting my EFI partition before running this script, which also mounts it to another location. Since we saved that step for AFTER this one, you should be fine.&lt;/p&gt;

&lt;p&gt;Once you've got your firmware installed, you can connect online! Use &lt;code&gt;wpa_supplicant&lt;/code&gt; and add your network. The same instructions as the &lt;a href="https://nixos.org/manual/nixos/stable/index.html#sec-installation-manual-networking" rel="noopener noreferrer"&gt;NixOS manual&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

systemctl start wpa_supplicant


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

&lt;/div&gt;

&lt;p&gt;Enter the wpa_cli with&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

wpa_cli


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

&lt;/div&gt;

&lt;p&gt;A few more commands...&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

add_network


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

&lt;/div&gt;

&lt;p&gt;If this returns something other than 0, use that number as the network id for the following commands.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

set_network 0 ssid "myhomenetwork"


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

set_network 0 psk "mypassword"


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

set_network 0 key_mgmt WPA-PSK


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

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

enable_network 0


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

&lt;/div&gt;

&lt;p&gt;If that worked, then you'll see some messages including the word &lt;code&gt;CONNECTED&lt;/code&gt;. Wonderful. On a Macbook!&lt;/p&gt;

&lt;h3&gt;
  
  
  Mounting Partitions
&lt;/h3&gt;

&lt;p&gt;Now we mount the partitions. Consider that right now we are running on the USB. In order to access the Macbook SSD partitions, we need to make them available at some location. Mounting is the process that takes a partition or device and makes it available at a specified location. So we'll be creating &lt;code&gt;/mnt&lt;/code&gt; as a working directory from where we can access these formatted partitions.&lt;/p&gt;

&lt;p&gt;Furthermore, the drive mount statuses are what the NixOS installer will look at when generating the important &lt;code&gt;hardware-configuration.nix&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;The order of operations here doesn't matter AFAIK. But we need to mount the root partition (nixos), the home partition (home), and the boot partition (EFI). We'll activate the swap partition because the nixos manual says to do so, even though we have 16GB of RAM in this MBP which really should be enough.&lt;/p&gt;

&lt;p&gt;First let's run that lsblk command again&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

lsblk -o NAME,FSTYPE,SIZE,LABEL,MOUNTPOINT


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

&lt;/div&gt;

&lt;p&gt;None of your new partitions should be mounted at this point. If they are, unmount them. I needed to unmount my boot partition at this point so I ran &lt;code&gt;sudo umount /dev/nvme0n1p1&lt;/code&gt; then did my lsblk command again to confirm.&lt;/p&gt;

&lt;p&gt;If you don't want to keep typing sudo, you can run &lt;code&gt;sudo -i&lt;/code&gt; to identify yourself as the super user. &lt;strong&gt;WARNING&lt;/strong&gt;: Make sure you are using &lt;em&gt;your&lt;/em&gt; partition names. They might not be the same as my examples below. Ex: My &lt;code&gt;nvme0n1p5&lt;/code&gt; might be your &lt;code&gt;nvme0n1p4&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Mount the root partition&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mount /dev/nvme0n1p5 /mnt


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

&lt;/div&gt;

&lt;p&gt;Create the home directory&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mkdir /mnt/home


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

&lt;/div&gt;

&lt;p&gt;Mount the home partition&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mount /dev/nvme0n1p4 /mnt/home


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

&lt;/div&gt;

&lt;p&gt;Create a directory to mount the boot/EFI partition&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mkdir -p /mnt/boot/efi


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

&lt;/div&gt;

&lt;p&gt;Mount the EFI partition&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mount /dev/nvme0n1p1 /mnt/boot/efi


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

&lt;/div&gt;

&lt;p&gt;Activate the swap&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

swapon /dev/nvme0n1p3


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Preparing Configuration.nix
&lt;/h3&gt;

&lt;p&gt;Remember how NixOS is a declaratively defined operating system? Everything we're about to install will be declared in configuration.nix. And since we have an internet connection, you could probably just download a valid config file right now and not do anything manually. In fact, here's my &lt;a href="https://github.com/raymondgh/nix-config/blob/v0.1.1/configuration.nix" rel="noopener noreferrer"&gt;configuration.nix&lt;/a&gt; that I ended up with after finishing this guide. But if you've come so far with me doing things the hard way, why not continue? Here's the minimal config I want to implement right now:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add general t2 mac hardware support&lt;/li&gt;
&lt;li&gt;Add wifi drivers&lt;/li&gt;
&lt;li&gt;Store the home directory contents on my home partition&lt;/li&gt;
&lt;li&gt;Anything else to get the machine to work&lt;/li&gt;
&lt;li&gt;Install a desktop environment&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;First things first, let's generate our starter configuration.nix file. There's a command for that:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nixos-generate-config --root /mnt


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

&lt;/div&gt;

&lt;p&gt;This actually generates two files. We'll only focus on &lt;code&gt;configuration.nix&lt;/code&gt; for now, as the other one, &lt;code&gt;hardware-configuration.nix&lt;/code&gt; shouldn't need to be modified. You'll notice in a moment that the main config file imports the hardware config file. Pretty neat. Apparently there's a lot of room to get creative with organizing config. For now we'll try to keep it simple.&lt;/p&gt;

&lt;p&gt;Now let's edit it with Nano, the teeny tiny command line text editor. If you haven't already, cd back to root. To do that, I ran &lt;code&gt;cd ../..&lt;/code&gt; and then &lt;code&gt;pwd&lt;/code&gt; to confirm that I was in &lt;code&gt;/&lt;/code&gt;. Really, just try running the next command and navigate with &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cd&lt;/code&gt;, and &lt;code&gt;pwd&lt;/code&gt; as needed. It's good to be comfortable with that kind of navigation!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nano /mnt/etc/nixos/configuration.nix


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

&lt;/div&gt;

&lt;p&gt;Up pops a bunch of cyan text. Mostly everything is commented out. It's nice that the installer gives us some guidance with this starter config rather than just an empty file.&lt;/p&gt;

&lt;p&gt;The bottom of the screen should show the available controls. Arrow keys to navigate, CTRL+O to save, CTRL+X to exit. &lt;/p&gt;

&lt;p&gt;Let's work top to bottom.&lt;/p&gt;

&lt;p&gt;First up is an import that we need to add. The top of your file probably looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

imports =
  [ # Include the results of the hardware scan.
    ./hardware-configuration.nix
  ];


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

&lt;/div&gt;

&lt;p&gt;We need to add a line following the t2linux instructions so that it looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

imports =
  [ # Include the results of the hardware scan.
    ./hardware-configuration.nix
    "${builtins.fetchGit { url = "https://github.com/kekrby/nixos-hardware.git"; }}/apple/t2"
  ];


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

&lt;/div&gt;

&lt;p&gt;I really don't like that the line turns red. But this is what the instructions say and if it doesn't work I'll come back and edit this part of my post. I don't know if the indentation matters, but I'm keeping things aligned and using spaces not tabs.&lt;/p&gt;

&lt;p&gt;To the boot.loader section, add one line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

boot.loader.efi.efiSysMountPoint = "/boot/efi";


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

&lt;/div&gt;

&lt;p&gt;Next, networking.hostname. It's commented out right now, which is fine, but how do you want your device to be identified on the network? I'm going to have two nixos devices (laptop and desktop) so I'm going to uncomment this and change the name. So my line now looks like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

networking.hostname = "nixos-mbp"


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

&lt;/div&gt;

&lt;p&gt;Continuing down the list, we need to choose a network solution: networking.wireless or networking.networkmanager. Uncomment &lt;code&gt;networking.networkmanager.enable = true;&lt;/code&gt; and move on! Next up, timezone. I think the spelling counts here, so maybe skip it if you don't know yours. I'm setting mine to &lt;code&gt;time.timeZone = "America/Los_Angeles";&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I'm skipping the network proxy. In the internationalization section, I'm uncommenting only the first line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

i18n.defaultLocale = "en_US.UTF-8";


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

&lt;/div&gt;

&lt;p&gt;Next there's something about X11 windowing system. This is required if you want to use a desktop environment. I certainly do. If you go online you can find arguments about which is best. If you look long enough, you might find two people that agree. What's great about NixOS is that if we want to change what we have, we just come in here to the configuration and change it. &lt;/p&gt;

&lt;p&gt;So I am uncommenting the line&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

services.xserver.enable = true


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

&lt;/div&gt;

&lt;p&gt;and adding a few more to enable a Plasma desktop environment &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# Enable the Plasma Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;


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

&lt;/div&gt;

&lt;p&gt;If you want GNOME instead of Plasma, change &lt;code&gt;sddm&lt;/code&gt; to &lt;code&gt;gdm&lt;/code&gt; and &lt;code&gt;plasma5&lt;/code&gt; to &lt;code&gt;gnome&lt;/code&gt; within those 2 lines.&lt;/p&gt;

&lt;p&gt;Next there is some config about how the keyboard should work. I am using a US keyboard and don't need nothin' fancy. Uncommenting the first line does it for me:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

services.xserver.layout = "us";


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

&lt;/div&gt;

&lt;p&gt;Skipping the part about CUPS and sound. Yes, sound 🥲. I think I read somewhere that sound is borked on Macbooks, so I will leave that for another day. There's a line to enable touchpad support. I'm not sure if this is the right way to do it, but I'm uncommenting that line as well&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

services.xserver.libinput.enable = true;


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

&lt;/div&gt;

&lt;p&gt;Then we have a user account. Apparently accounts are managed in config! Awesome! I wonder how passwords work though -- don't want those in config!! Here's what mine looks like&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

users.users.ray = {
    isNormalUser = true;
    description = "Ray";
    extraGroups = [ "networkmanager" "wheel" ];
    packages = with pkgs; [
      firefox
    ];
  };


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

&lt;/div&gt;

&lt;p&gt;I deleted thunderbird, but why not keep firefox. Below this, I added another important line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# Allow unfree packages
nixpkgs.config.allowUnfree = true;


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

&lt;/div&gt;

&lt;p&gt;Remember, everything is a package. So if you want to use something &lt;a href="https://nixos.org/manual/nixpkgs/stable/#sec-allow-unfree" rel="noopener noreferrer"&gt;unfree&lt;/a&gt; like VSCode, you need to allow it.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://wiki.t2linux.org/distributions/nixos/installation/" rel="noopener noreferrer"&gt;T2Linux guide&lt;/a&gt; instructs to add this, so let's add it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# Firmware for Broadcom Wi-Fi and Bluetooth
hardware.firmware = [
  (pkgs.stdenvNoCC.mkDerivation {
    name = "brcm-firmware";

    buildCommand = ''
      dir="$out/lib/firmware"
      mkdir -p "$dir"
      cp -r ${./firmware}/* "$dir"
    '';
  })
];


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

&lt;/div&gt;

&lt;p&gt;*&lt;em&gt;Note: I have modified one line in the t2linux guide by removing &lt;code&gt;/files&lt;/code&gt; so that our firmware will be stored at /etc/nixos/firmware/bcrm.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This is another spot where the syntax highlighting is no good. Nano thinks that &lt;code&gt;/*&lt;/code&gt; is the beginning of a multi-line comment, so the following lines are all blue. Nix doesn't support multi-line comments as far as I can tell, and the expression is still valid. Maybe Nix does support it and it doesn't take effect because of the double apostrophe? Dunno! But this works, let's move on.&lt;/p&gt;

&lt;p&gt;Last config change is to add the git package. Since we're relying on the &lt;code&gt;fetchGit&lt;/code&gt; expression to get the hardware firmware, we need to make sure git is available. You can simply add &lt;code&gt;git&lt;/code&gt; as a new line under your created user, but I'm going to add it as a system package instead of a user package. AFAIK this just makes it available to everyone instead of just one user. So lower down you'll see&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# List packages installed in system profile. To search, run:
# $ nix search wget
#   environment.systemPackages = with pkgs; [
#     vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
#     wget
# ];


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

&lt;/div&gt;

&lt;p&gt;We will add &lt;code&gt;git&lt;/code&gt; very simply so that it looks like this;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

# List packages installed in system profile. To search, run:
# $ nix search wget
  environment.systemPackages = with pkgs; [
#   vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
    # wget
    git
  ];


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

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;When I first installed, I didn't realize I needed to add git. When I booted into my machine for the first time, I had to use an external keyboard to comment out the fetchGit hardware line near the top, add git, rebuild, then go an uncomment the fetchGit hardware line and rebuild &amp;amp; reboot again.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/raymondgh/nix-config/tree/v0.1.1" rel="noopener noreferrer"&gt;This&lt;/a&gt; is what the final configuration.nix and hardware-configuration.nix should look like.&lt;/p&gt;

&lt;p&gt;Lastly before installing, we also need to copy the Broadcom wireless firmware into the nixos partition. First create the appropriate directory:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

mkdir -p /mnt/etc/nixos/firmware/brcm


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

&lt;/div&gt;

&lt;p&gt;Then issue the copy pasta command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

cp -r /lib/firmware/brcm/* /mnt/etc/nixos/firmware/brcm/


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

&lt;/div&gt;
&lt;h3&gt;
  
  
  Install NixOS
&lt;/h3&gt;

&lt;p&gt;Run&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nixos-install


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

&lt;/div&gt;

&lt;p&gt;Another awesome thing about NixOS: if something is wrong, it's gonna halt the installation and tell you right away. You get to fix it &lt;em&gt;before&lt;/em&gt; having the chance to screw up your system. I had a couple typos in my configuration.nix when I got to this point. Once it gets going, you'll hear the airplanes take off (the laptop fan). Lots of white text scrolling across the screen. I don't really read it. Looks like a lot of &lt;code&gt;building '/nix/store/...&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Eventually it will prompt you for a new root password and report &lt;code&gt;Installation finished!&lt;/code&gt;! Woot!&lt;/p&gt;

&lt;h3&gt;
  
  
  Boot NixOS on Macbook Pro
&lt;/h3&gt;

&lt;p&gt;We're still running the installer, so let's reboot with this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

reboot


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

&lt;/div&gt;

&lt;p&gt;If everything went right, Macbook's startup manager will run and show 3 options: EFI Boot (Internal), Macintosh HD (Internal), and EFI BOOT (external).&lt;/p&gt;

&lt;p&gt;NixOS should be running now, with access to internet and ability to log in to a user named &lt;code&gt;root&lt;/code&gt; with the password you set during installation. Once logged in, you can set a password for your user with a command like this&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

passwd ray


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

&lt;/div&gt;

&lt;p&gt;It'll ask you to type and retype the desired password. Now I don't know how passwords work yet in NixOS, but from what I can tell it's not a fully solved problem. Perhaps we'll explore that together another day.&lt;/p&gt;

&lt;h3&gt;
  
  
  Booting macOS and NixOS selectively
&lt;/h3&gt;

&lt;p&gt;I don't know if you'll encounter these, but I had to do a few extra things before I could get into NixOS on the Mac SSD. &lt;/p&gt;

&lt;p&gt;From my installation media, I had to run an additional command to install the bootloader because my original configuration.nix had the boot partition mounted at &lt;code&gt;/boot&lt;/code&gt; instead of &lt;code&gt;/boot/efi&lt;/code&gt;. To do that, I followed some steps &lt;a href="https://nixos.wiki/wiki/Bootloader#FAQ" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Specifically I ran &lt;code&gt;nixos-enter&lt;/code&gt; from my installation media and then once that gave me the &lt;code&gt;&amp;gt;&lt;/code&gt; text entry prompt, I ran&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NIXOS_INSTALL_BOOTLOADER=1 /nix/var/nix/profiles/system/bin/switch-to-configuration boot


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

&lt;/div&gt;

&lt;p&gt;After that. I could only boot NixOS, not macOS. So I reset the nvram by booting with &lt;code&gt;CMD+OPTION+P+R&lt;/code&gt;, disabled SIP with &lt;code&gt;csrutil disable&lt;/code&gt; after booting in recovery mode &lt;code&gt;CMD+R&lt;/code&gt;, and finally reinstalled rEFInd via macOS.&lt;/p&gt;

&lt;p&gt;So now I choose my boot partition successfully with rEFInd. I'd like to use the Mac's native startup manager instead but that'll take some figuring out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Congrats!
&lt;/h3&gt;

&lt;p&gt;We got our Macbook Pro dual booting macOS and NixOS. We got our keyboard, touchbar, trackpad, and wireless networks working. Woo!! This post is labeled "day 4" but this took more than 1 day to figure out, I promise. I'm just glad to have this stable starting point from which I can continue to improve my OS. Maybe we'll reach the limits of NixOS eventually, but for now, I'm optimistic.&lt;/p&gt;

&lt;h3&gt;
  
  
  To Do
&lt;/h3&gt;

&lt;p&gt;The more I learn, the less I know. Here are some things I want to get back to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Getting a stable &amp;amp; desirable boot management configuration set up&lt;/li&gt;
&lt;li&gt;NixOS keeps trying to have 2 wired connections but there's only one... Would like to fix that.&lt;/li&gt;
&lt;li&gt;Getting audio to work&lt;/li&gt;
&lt;li&gt;If I leave my laptop open and running for a long time and come back, I can't get the screen to turn back on. Want to fix that&lt;/li&gt;
&lt;li&gt;Setting up a smooth integration between my configuration.nix and a github repository&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And of course, installing on my desktop, potentially getting my two environments in sync, and setting up a development environment for some software project or another.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thank you!
&lt;/h3&gt;

&lt;p&gt;If you went through all this, I would appreciate your feedback. Anything on what you liked or would have liked to have seen would be great! I can update this post with improvements.&lt;/p&gt;

</description>
      <category>nixos</category>
      <category>dualbooting</category>
      <category>linux</category>
    </item>
    <item>
      <title>Day 3: Fighting with network interfaces</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Thu, 11 May 2023 00:33:05 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-3-fighting-with-network-interfaces-13hh</link>
      <guid>https://dev.to/raymondgh/day-3-fighting-with-network-interfaces-13hh</guid>
      <description>&lt;p&gt;I went down quite a rabbit hole trying to figure out hardware compatibility on my own. I'll walk through how I worked on the Wi-Fi issue here. Most of this content will be useless because I ended up with another solution, but I'll describe it anyway. To begin, I asked ChatGPT what I should do. ChatGPT apparently knows a lot about NixOS, though not the latest information unfortunately. So if any of the steps taken here seem unintuitive, don't worry. I had guidance and you can too.&lt;/p&gt;

&lt;p&gt;From the top, we know that if we want to use Network Manager as the primary way of managing internet (I do), then it needs access to the wifi interface. To see my interfaces, I ran this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ip link show
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To see your available interfaces. I only had two results, &lt;code&gt;lo&lt;/code&gt; and &lt;code&gt;enp7s0u2&lt;/code&gt;. The &lt;code&gt;lo&lt;/code&gt; will be there for everyone, and a variation of the &lt;code&gt;enp*&lt;/code&gt; will represent an available ethernet interface. With working wireless, another entry should appear. Its absence means something is wrong. From here, I checked to see if my wireless network controller could even be found in the first place. To do this I added a new package, pciutils (PCI Utilities) to check the devices attached to my PCI slots (connections to the motherboard).&lt;/p&gt;

&lt;p&gt;Adding it made my environment.systemPackages look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  environment.systemPackages = with pkgs; [
    (vscode-with-extensions.override {
      vscodeExtensions = with vscode-extensions; [
        bbenoist.nix
      ];
    })
    pciutils
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see the vscode w/ extensions from before, and now pciutils is there too.&lt;/p&gt;

&lt;p&gt;I then ran the simple command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lspci | grep -i broadcom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And good news, it exists! &lt;code&gt;03:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4364 802.11ac Wireless Network Adapter (rev 03)&lt;/code&gt; The mystery remained though, why if we could find the device we couldn't use it. Or might you say &lt;em&gt;drive&lt;/em&gt; it? We need drivers!&lt;/p&gt;

&lt;p&gt;There were more commands to investigate, such as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lsmod | grep -i brcmfmac
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To help check if there were conflicting drivers. I had a hard time interpreting the results, but ChatGPT said there was a conflict. I continued with this pair-debugging plan and ran more commands and did and undid a bunch of things. There are many versions of the Broadcom chip and the &lt;code&gt;BCM4364&lt;/code&gt; version in my &lt;code&gt;MacbookPro15,1&lt;/code&gt; is just one of many. I tried pretty hard to get this installed. Here are a bunch of things I tried/learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Added &lt;code&gt;wl&lt;/code&gt; to &lt;code&gt;boot.kernelModules&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Enabled &lt;code&gt;hardware.enableAllFirmware = true&lt;/code&gt; flag in hardware-configuration.nix&lt;/li&gt;
&lt;li&gt;Added &lt;code&gt;linuxKernel.packages.linux_zen.broadcom_sta&lt;/code&gt; to my system packages in configuration.nix&lt;/li&gt;
&lt;li&gt;Blacklisted the apparently undesirable conflicting module with &lt;code&gt;boot.blacklistedKernelModules = [ "brcmfmac" ];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Explicitly added linux 5.5 packages&lt;/li&gt;
&lt;li&gt;Found that the popularly recommended site, &lt;a href="https://web.archive.org/web/20210217170329/https://packages.aunali1.com/apple/wifi-fw/18G2022/"&gt;aunali1&lt;/a&gt;, was offline, no longer offering broadcome drivers&lt;/li&gt;
&lt;li&gt;Found that my BCM4364 is codenamed Midway and the others of the same generation are named after pacific/Hawaiian islands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, I found &lt;a href="https://t2linux.org/"&gt;https://t2linux.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apple started introducing the T2 security chip in 2017 and my laptop has it. All new devices have it or something that has the same effect: Makes it super hard to use the laptop hardware.&lt;/p&gt;

&lt;p&gt;Unfortunately following this guide was very difficult for me. Some of the instructions don't quite make sense and others don't have the expected result. It seems like doing something out of order or having done something differently ahead of following these steps can prevent success with this method. &lt;/p&gt;

&lt;p&gt;I found myself in a state where there was something going on with the startup manager and I couldn't boot from other partitions or USB devices at all. I tried so many things. Really. And I hate to admit defeat, but this time I am doing just that. I resorted to resetting my Macbook to factory defaults, completely wiping it. I will try again fresh and be very careful about the steps I take.&lt;/p&gt;

</description>
      <category>nixos</category>
      <category>apple</category>
      <category>firmware</category>
    </item>
    <item>
      <title>Day 2: Introducing Configuration.nix</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Wed, 10 May 2023 03:48:57 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-2-configurationnix-5cj3</link>
      <guid>https://dev.to/raymondgh/day-2-configurationnix-5cj3</guid>
      <description>&lt;p&gt;My todos from Day 1 were as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get Wi-Fi working&lt;/li&gt;
&lt;li&gt;Get Macbook keyboard, touch bar, and trackpad working&lt;/li&gt;
&lt;li&gt;Learn how to use the OS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The OS config is supposed to be configured entirely with functional expressions, so priority #1 became learning to manage the configuration. Turns out, there's a nifty command for doing just that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nixos-rebuild edit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will open the configuration.nix file in Nano, a text editor for the terminal. This is probably uncomfortable for anyone new to linux, but it works great. Forget the mouse, use the arrow keys, pageup/pagedown, CTRL+O to save and CTRL+X to exit. Easy peasy. &lt;/p&gt;

&lt;p&gt;Now, reading the code in here is fairly straightforward. Understanding it is another level of technicality. Here is a perfect example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
  # Enable networking
  networking.networkmanager.enable = true;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These two lines control how the operating system manages the network interfaces. What you might not know if you don't have prior linux experience is that NetworkManager and wpa_supplicant do not play nice without being properly introduced to each other. Simply uncommenting will not work.&lt;/p&gt;

&lt;p&gt;So I simply uncommented and saved the file. 💀&lt;/p&gt;

&lt;p&gt;The configuration.nix file is updated! What next? Next we need to rebuild NixOS using the updated file. We'll also need to switch to the new build for the changes to take effect. A keyword to learn here is "Generation". When you rebuild, you create a new generation. Here's the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nixos rebuild switch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And this is where the beauty of NixOS rears its ugly head. There's some &lt;a href="https://nixos.org/guides/how-nix-works.html"&gt;kool-aid available here&lt;/a&gt;, but basically if you mess up, NixOS can't build, and if it can't build, your mistake can't break your system. And if you have another mistake that can "break" something, you can always roll back to a previous "generation". Since every generation is defined so clearly, you can know that they basically all work.&lt;/p&gt;

&lt;p&gt;So when I ran my first &lt;code&gt;nixos rebuild switch&lt;/code&gt; command, I got an error (remember the unacquainted network interface managers). I haven't resolved this yet, but there's a &lt;a href="https://nixos.org/manual/nixos/stable/index.html#sec-networking"&gt;section in the manual&lt;/a&gt; to help figure it out. For now, I've reverted my change and kept the wireless line commented out. I'm still using a wired connection as of writing this :)&lt;/p&gt;

&lt;p&gt;A little struggle, but that's Okay. One thing I need for sure is to be able to modify my configuration.nix file more comfortably. One great thing about blogging as a noob for noobs is that nobody is going to comment about using vim or emacs to be superior. Nope. My people are using Sublime and VSCode. And I want to install VSCode. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;echo $EDITOR&lt;/code&gt; to see what you have as your default editor now&lt;/li&gt;
&lt;li&gt;Find the name of the vscode package by searching &lt;a href="https://search.nixos.org/packages"&gt;https://search.nixos.org/packages&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;vscode&lt;/code&gt; to your configuration.nix near the bottom. Here's what my file ended up looking like:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  vscode
  # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;I also added a line at above this section:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  environment.variables.EDITOR = "code";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;By the way, if you didn't allow unfree when installing your OS, you can do that now by making sure this line is in your configuration and set to true
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wish the executable name were "vscode" instead of "code" but Microsoft gets away with a lot. &lt;/p&gt;

&lt;p&gt;Now after saving my changes to configuration.nix, I get to try running &lt;code&gt;sudo nixos rebuild switch&lt;/code&gt; again. And good news, it worked! I can now open vscode, open my &lt;code&gt;etc/nixos/configuration/nix&lt;/code&gt; file, and make changes in a nice friendly UI. &lt;/p&gt;

&lt;p&gt;If only we had some syntax highlighting. How do we add vscode extensions in NixOS? Turns out, we just need to install a different package in place of &lt;code&gt;vscode&lt;/code&gt; in the &lt;code&gt;environment.systemPackages&lt;/code&gt;. Like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    (vscode-with-extensions.override {
      vscodeExtensions = with vscode-extensions; [
        bbenoist.nix
      ];
    })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's kind of complex and I haven't fully internalized the syntax and the meaning of it all, but after some googling I found that my config should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  environment.systemPackages = with pkgs; [
    (vscode-with-extensions.override {
      vscodeExtensions = with vscode-extensions; [
        bbenoist.nix
      ];
    })
  # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
  ];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The nix syntax highlighting is available thanks to a French dude's extension called bbenoist.nix which you can see &lt;a href="https://github.com/bbenoist/vscode-nix"&gt;on github here&lt;/a&gt;. Thanks Baptist!&lt;/p&gt;

&lt;p&gt;That's enough for today! The more I learn, the less I know. Future topics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Getting my Macbook hardware to work (keyboard, mouse, speakers, camera, wifi, everything)&lt;/li&gt;
&lt;li&gt;Better understanding the nix language and configuration expressions&lt;/li&gt;
&lt;li&gt;Improving my desktop experience. The default app-switcher in KDE/Plasma is gross.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nixos</category>
    </item>
    <item>
      <title>Day 1: Installing NixOS on my 2019 Macbook Pro</title>
      <dc:creator>Ray Harris</dc:creator>
      <pubDate>Wed, 10 May 2023 03:17:06 +0000</pubDate>
      <link>https://dev.to/raymondgh/day-1-installing-nixos-on-my-2019-macbook-pro-2idh</link>
      <guid>https://dev.to/raymondgh/day-1-installing-nixos-on-my-2019-macbook-pro-2idh</guid>
      <description>&lt;p&gt;Here's everything I did to install NixOS on my Macbook Pro without ruining my existing macOS Ventura setup.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Created bootable media&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Downloaded Balena Etcher &lt;/li&gt;
&lt;li&gt;Downloaded NixOS ISO (GNOME, 64-bit Intel/AMD)&lt;/li&gt;
&lt;li&gt;Plugged in 16gb USB drive&lt;/li&gt;
&lt;li&gt;Ran Etcher to flash the NixOS ISO onto the USB drive (easy as 1-2-3)&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Prepared a partition on my hard drive&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Couldn't use disk utility because it would only let me create APFS volumes&lt;/li&gt;
&lt;li&gt;Opened terminal&lt;/li&gt;
&lt;li&gt;Ran &lt;code&gt;diskutil list&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ran &lt;code&gt;diskutil info /dev/disk0&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Ran &lt;code&gt;diskutil apfs resizeContainer /dev/disk0s2 300g ExFAT "NixOS" 200gb&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This took a little while.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Disabled the boot restriction security&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Shut down the mac&lt;/li&gt;
&lt;li&gt;Booted up, holding &lt;code&gt;CMD+R&lt;/code&gt; to enter recovery mode&lt;/li&gt;
&lt;li&gt;At the top bar, chose Utilities&amp;gt;Startup Security Utility&lt;/li&gt;
&lt;li&gt;Chose &lt;code&gt;No security&lt;/code&gt; for the first option&lt;/li&gt;
&lt;li&gt;Chose &lt;code&gt;Allow booting from external media&lt;/code&gt; for the second option&lt;/li&gt;
&lt;li&gt;Closed the window&lt;/li&gt;
&lt;li&gt;Shut down&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Got my peripherals ready&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Plugged in power cable&lt;/li&gt;
&lt;li&gt;Plugged in external mouse and keyboard&lt;/li&gt;
&lt;li&gt;Plugged in network cable via ethernet-usbc adapter&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Ran the installer&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Booted up, holding &lt;code&gt;Option&lt;/code&gt; key&lt;/li&gt;
&lt;li&gt;Chose EFI boot (my usb device)&lt;/li&gt;
&lt;li&gt;Ignored the menu that came up and disappeared in 10 seconds. If you press a key, the 10 second timer will be aborted and you'll have to manually select an option. Choose the first and hit enter&lt;/li&gt;
&lt;li&gt;Clicked next a few times and added my username, password, timezone, etc.&lt;/li&gt;
&lt;li&gt;I chose the Plasma desktop environment after comparing the visual preview to GNOME's in the setup wizard. I think people fight about this kind of stuff online, but I'm led to believe by one of the Reddit posts I saw that we can easily switch risk-free later on thanks to the power of Nix.&lt;/li&gt;
&lt;li&gt;Let it run and went upstairs for a few hours&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Came back to my laptop and booted up NixOS&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Wondered how to get Wi-Fi working&lt;/li&gt;
&lt;li&gt;Wondered how to get Macbook keyboard, touch bar, and trackpad working&lt;/li&gt;
&lt;li&gt;Wondered how the heck I do anything on this weird OS&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nixos</category>
      <category>nix</category>
      <category>linux</category>
    </item>
  </channel>
</rss>
