Skip to content

My Nix(OS) configuration flake for all my machines featuring home-manager, sops, and all the good nix stuff...

Notifications You must be signed in to change notification settings

phdenzel/nix-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-config

These instructions assume that just is installed on the machine. If this is not the case, inspect the justfile and replace the commands correspondingly.

Build images

This flake also supports building custom ISO images. Use

just build <my-image>

where <my-image> has to be replaced with the name of an implemented host. So far, the following images are implemented:

  • iso: a minimal ISO image from which NixOS can be installed on x86_64 systems.
  • rpi: a minimal NixOS image for Raspberry Pis’ SD cards.

A symlink ./results/ should appear, pointing to the built image.

For cross-platform building make sure to have the appropriate system emulation enabled, e.g. with

boot.binfmt.emulatedSystems = ["aarch64-linux"]; # e.g. for Raspberry Pis

Use the following to flash the images to an SD card (say at /dev/sda)

just flash-sd /dev/sda

or a USB stick

just flash /dev/sda

Install from ISO

Once the ISO is flashed, boot into it on the machine where you want to install NixOS. The nix-config contains a few helpful commands that aid in the CLI-based installation. Thus, clone the repository with

git clone https://github.com/phdenzel/nix-config.git

You can inspect the justfile for the commands necessary for a proper installation.

cd nix-config
nix-shell -p just
just iso-install <my-machine>

where <my-machine> has to be replaced with the name of an implemented host. So far,

  • phinix
  • fenrix
  • heimdall
  • idun

are implemented.

Install on NixOS

Log in to a NixOS installation as root and clone the repository once more:

git clone https://github.com/phdenzel/nix-config.git
cd nix-config

Then, make sure you have copied an authorized AGE key onto the machine to

~/.config/sops/age/keys.txt

To derive and register a new authorized key from the host SSH key

just host-age-key

Once all preparations are done, run

sudo nixos-rebuild switch --flake .#<my-machine>

where <my-machine> has to be replaced with the name of an implemented host.

Alternatively, you can run the shorthand

just rbs <my-machine>

Modify and adapt the configuration further as needed.

About

My Nix(OS) configuration flake for all my machines featuring home-manager, sops, and all the good nix stuff...

Topics

Resources

Stars

Watchers

Forks