<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Nixos on Dark Kernel</title>
    <link>https://blogs.sumit.engineer/tags/nixos/</link>
    <description>Recent content in Nixos on Dark Kernel</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 24 Aug 2023 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://blogs.sumit.engineer/tags/nixos/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Chroot into nixos</title>
      <link>https://blogs.sumit.engineer/notes/2-notes/2023-08-24-chroot-into-nixos/</link>
      <pubDate>Thu, 24 Aug 2023 00:00:00 +0000</pubDate>
      
      <guid>https://blogs.sumit.engineer/notes/2-notes/2023-08-24-chroot-into-nixos/</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Mount the file system containing the NixOS to chroot into at &lt;code&gt;/mnt&lt;/code&gt; or any other directory, using e.g.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo mount /dev/sda10 /mnt/nixx/
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;[&amp;ndash;more&amp;ndash;]&lt;/p&gt;
&lt;ol start=&#34;2&#34;&gt;
&lt;li&gt;Mount the host system&amp;rsquo;s Linux run-time api file systems inside the mount, then populate /run using the activate script and chroot inside, starting a bash shell&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo mount -o bind /dev /mnt/nixx/dev/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo mount -o bind /proc /mnt/nixx/proc/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo mount -o bind /sys /mnt/nixx/sys/
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo chroot /mnt/nixx /nix/var/nix/profiles/system/activate
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo chroot /mnt/nixx/ /run/current-system/sw/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Reference: &lt;a href=&#34;https://nixos.wiki/wiki/Change_root&#34;&gt;NixOS Wiki&lt;/a&gt;&lt;/p&gt;
</description> 
    </item>
    
  </channel>
</rss>


