mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 16:57:55 +00:00
72 lines
3.6 KiB
Plaintext
72 lines
3.6 KiB
Plaintext
---
|
|
title: Prerequisites
|
|
---
|
|
= Prerequisites
|
|
|
|
Before you get into dive into this configuration, let's establish a few things first.
|
|
In order to make use of this system in the first place, you need the following components.
|
|
|
|
- A NixOS installer image with flakes enabled.
|
|
An example would be the unstable versions from link:https://releases.nixos.org/?prefix=nixos/unstable/[NixOS project release page].
|
|
As an additional option, you can also use link:https://github.com/foo-dogsquared/nixos-config/releases/tag/latest[my personalized NixOS installers] which is primarily intended for me configs.
|
|
|
|
- A flash drive or any storage device that will boot the installer image up for installation.
|
|
|
|
- A computer with disabled secure boot.
|
|
Because unfortunately, that's the state of most Linux distros right now. footnote:[But things change hopefully with github:nix-community/lanzaboote[Lanzaboote project] into usable and stable state.]
|
|
|
|
This primarily uses Nix flakes so you can have a preview of what's available in my config.
|
|
|
|
[source, shell, subs=attributes]
|
|
----
|
|
nix flake show {canonical-flake-url}
|
|
----
|
|
|
|
All you have to do is to flash the installer image into the flash drive and boot with the drive (with the disabled secure boot).
|
|
|
|
[NOTE]
|
|
====
|
|
For this example, we'll assume you're installing my desktop configuration which is at `nixosConfigurations.ni`.
|
|
====
|
|
|
|
Next, we'll partition the disk of the system.
|
|
This is already handled for us since this project uses xref:../../04-nixos-modules/03-disko/index.adoc[disko modules].
|
|
Just run the following command as root.
|
|
|
|
[source, shell]
|
|
----
|
|
nix run github:nix-community/disko -- --mode disko ./hosts/ni/disko.nix --arg disks '[ "/dev/nvme0n1" ]'
|
|
----
|
|
|
|
Then install the NixOS configuration (also as root).
|
|
|
|
[source, shell, subs=attributes]
|
|
----
|
|
nixos-install --flake {canonical-flake-url}#INSTALLABLE
|
|
----
|
|
|
|
Despite being a NixOS system, it isn't entirely reproducible to the point of installing this config will work out-of-the-box.
|
|
It has some things needed in the first place to work like my external backup setup where it needs my SSH private keys to work in the first place.
|
|
You can see more details from xref:../05-what-should-not-be-here/index.adoc[What should not be here?].
|
|
Nonetheless, the parts is it isn't reproducible is only about 10% of this config.
|
|
Everything else is fine and dandy and can be deployed successfully (but not used as intended).
|
|
|
|
|
|
[appendix]
|
|
[#installing-with-a-persistent-nixos-installer]
|
|
== Installing with a persistent NixOS installer
|
|
|
|
In some cases such as my main desktop configuration, it may be impossible to install it with a typical installer image like the official ISO.
|
|
This is because the typical installer environment boots on a 2GB tmpfs which should be enough for most environments.
|
|
Buuuuuut several of my NixOS configurations are not that, they basically contain at least 24GB of shenanigans and the collective build files resulting from it is simply not enough in a little 2GB tmpfs and most likely creates a system crash.
|
|
For this reason, it is very recommended to create an installer environment with a persistent live installer.
|
|
|
|
To do so, simply partition your storage device (e.g., a flash drive, external hard drive) of at least >=64GB.
|
|
Then, you'll have to install a NixOS system in the partition with `graphical-installer` NixOS configuration found in the project flake.
|
|
As widespread throughout the project, you can use disko to install the system in a one-liner.
|
|
|
|
[source, shell, subs=attributes]
|
|
----
|
|
disko --mode disko [--arg disk "/dev/sda"] --flake {canonical_flake_url}#external-hdd && nixos-install --no-root-passwd --root /mnt --flake {canonical_flake_url}#graphical-installer-x86_64-linux
|
|
----
|