All of my computers use a 512MB EFI partition and a ext4 partition with a swapfile that’s double the RAM of my machines (with the exception of my desktop, since the ram is quite large, its swapfile is equal to that of the machine).
Home-manager is configured as a NixOS module, so when NixOS is rebuilt Home-manager is also rebuilt at the same time as a systemd service!
- Download a NixOS ISO or create custom one with nix experimental features and Nvidia drivers installed by following the instructions over under Tips; then boot into the ISO’s live image environment
- Download the repo onto the live image copy of NixOS.
- Open the terminal and enter the repo directory.
- Run
nix-shell
ornix develop
to enter environment with all necessary packages to build the config properlynix-shell
is available on any version of nix. However, in order to usenix develop
, you must have nix v2.4+, git, and have enabled theflakes
andnix-command
experimental features. If you are using the custom ISO as stated previously, you can usenix develop
without having to do anything additional as the configs already have the needed configurations and dependencies.- JUNE 2024:
nix develop
is the recommended way to utilize the devshell, as it directly pulls the flake’s overlays into itself without errors along with its other inputs,nix-shell
**DOES NOT** important any of the flake’s inputs thus causing errors when loading into it.
- Drag a pre-configured or your own disko config into
hosts/HOSTNAME
named asdisks.nix
and import into your hardware default nix file.- Make sure the
hosts/HOSTNAME/disks.nix
file to your designed partition configurations (see disko’s getting started guide for more!) - Most importantly, make sure to edit the
disk
andswapSize
variables at the top of the file to point to your drive’s id (usingsudo blkid
).
- Make sure the
- Run
just disko #HOSTNAME
to automatically partition the system’s disks according to yourdisks.nix
for the host you specified - Run
nixos-generate-config --show-hardware-config --no-filesystems --root /mnt
to create a base configuration file that the installer provides.- It is important to include
--no-filesystems
in the command, as since disko handles the filesystem configurations for you (including them along with disko will cause conflicts which will make the install fail).
- It is important to include
- Add any of the additional kernel modules as exactly as they appear into the
hosts/HOSTNAME/hardware-configuration
file. - Change the
FLAKE
variable located undermodules/home-manager/default-config.nix
. Some dotfiles are sym-links that aren’t located on nix store and not having the repo in the location that the variable specifies will cause the links to break. This would in turn result in some apps malfunctioning or not have your settings. - IMPORTANT: Make sure to be aware of the following caveats:
- For modules that include
evaluation secrets
(secrets that used during the flake’s evaluation; which DOES NOT include the secrets fromsops-nix
oragenix
), you will not be able to directly use said modules without removing them along with git-crypt and change them to be your own. For your own version of the repo, you simply transfer the GPG private key used to encrypt the secrets onto the machine you are installing to and run the commandgit-crypt unlock
. - For modules that include secrets from
sops-nix
oragenix
, you will also need to change out those secrets (aswell as generate keys for each new host). - See more under Tips for more information regarding these caveats
- For modules that include
- Run
nixos-install --flake .#HOSTNAME --root /mnt
to install NixOS with the configuration (or runjust nixos-install HOSTNAME
) - If you did not set a user password in the flake, make sure you use
nixos-enter
to set a password for the user! - Move repo into the folder located on /mnt that matches your
FLAKE
environment variable - Restart and the system will boot up into NixOS!
Once your system boots, check out Post Install for instructions for system and application setup steps that can only be done once the system is installed and booted.