{"id":5586,"date":"2023-12-29T15:37:32","date_gmt":"2023-12-29T21:37:32","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=5586"},"modified":"2023-12-29T15:37:32","modified_gmt":"2023-12-29T21:37:32","slug":"how-to-install-nixos-minimum-from-usb-drive","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/how-to-install-nixos-minimum-from-usb-drive\/","title":{"rendered":"How To Install NixOS Minimum from USB drive"},"content":{"rendered":"\n<p>You can make the USB drive by downloading the image off of nixos.org and then use <a href=\"https:\/\/etcher.balena.io\/\">Etcher<\/a>, dd, or your favorite iso to USB drive utility.<\/p>\n\n\n\n<p>The minimum version of NixOS does not come with a GUI installer.<\/p>\n\n\n\n<p><a href=\"https:\/\/nixos.org\/manual\/nixos\/stable\/#ch-installation\">https:\/\/nixos.org\/manual\/nixos\/stable\/#ch-installation<\/a><\/p>\n\n\n\n<p>The manual contains all the info needed.  For a minimum install, there are a couple of steps that you need to perform, before you can install.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Format hard disk<\/li>\n\n\n\n<li>Create config file<\/li>\n\n\n\n<li>Install<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Format Hard Disk<\/h2>\n\n\n\n<p>We&#8217;ll assume that \/dev\/sda is our target disk.  This will overwrite the disk.  Make sure you don&#8217;t need anything on it.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">parted \/dev\/sda -- mklabel gpt\nparted \/dev\/sda -- mkpart root ext4 512MB -8GB\nparted \/dev\/sda -- mkpart swap linux-swap -8GB 100%\nparted \/dev\/sda -- mkpart ESP fat32 1MB 512MB\nparted \/dev\/sda -- set 3 esp on<\/pre>\n\n\n\n<p>Format the partitions<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkfs.ext4 -L nixos \/dev\/sda1\nmkswap -L swap \/dev\/sda2\nmkfs.fat -F 32 -n boot \/dev\/sda3\nmount \/dev\/disk\/by-label\/nixos \/mnt\nmkdir -p \/mnt\/boot\nmount \/dev\/disk\/by-label\/boot \/mnt\/boot\nswapon \/dev\/sda2<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create a basic config file<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">nixos-generate-config --root \/mnt<\/pre>\n\n\n\n<p>You can edit the config to make any changes you need.  You may want to uncomment the user lines to setup a new user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/mnt\/etc\/nixos\/configuration.nix<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Install NixOS<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">nixos-install<\/pre>\n\n\n\n<p>Last step is to setup the root and user password.  <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">passwd<\/pre>\n\n\n\n<p>Reboot the machine once the password is set.<\/p>\n\n\n\n<p>After you log in, set the user password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">passwd username<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can make the USB drive by downloading the image off of nixos.org and then use Etcher, dd, or your favorite iso to USB drive utility. The minimum version of NixOS does not come with a GUI installer. https:\/\/nixos.org\/manual\/nixos\/stable\/#ch-installation The &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/how-to-install-nixos-minimum-from-usb-drive\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[417,7,1635,1261],"class_list":["post-5586","post","type-post","status-publish","format-standard","hentry","category-linux","tag-install","tag-linux-2","tag-nixos","tag-setup"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=5586"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5586\/revisions"}],"predecessor-version":[{"id":5588,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/5586\/revisions\/5588"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=5586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=5586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=5586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}