Skip to content

Latest commit

 

History

History
70 lines (36 loc) · 1.5 KB

README.md

File metadata and controls

70 lines (36 loc) · 1.5 KB

To apply a system configuration:

sudo nixos-rebuild switch --flake .#hostname

To apply a home configuration:

home-manager switch --flake .#username@hostname

To build a package in ./pkgs:

nix build .#package-name

Building ARM64 on x86_64

On Arch, install these packages:

qemu-system-aarch64 qemu-user-static qemu-user-static-binfmt

On non-NixOS, add these lines to /etc/nix/nix.conf:

# Allow us to build ARM64 packages using QEMU
extra-platforms = aarch64-linux

And systemctl restart nix-daemon.

On NixOS, add this line to configuration.nix:

boot.binfmt.emulatedSystems = [ "aarch64-linux" ];

Now you can build a VM with your host's config:

nixos-rebuild build-vm --flake .#hostname

Building a Raspberry Pi installation image

A generic intaller:

nix build .#headless-image-rpi

Or a specific host:

nix build .#nixosConfigurations.stereo.config.system.build.sdImage

To uncompress the image:

Flash this image to an SD card:

zstdcat result/sd-image/nixos-image-rpi3-kernel.img.zst | sudo dd of=/dev/sdX bs=4M status=progress conv=fsync

Boot it and use deploy-rs to deploy your configuration.

Building an ISO

nix build .#headless-image-cloud-x86_64-iso

Installing on a VPS

Boot from the ISO.

Partition and mount the disk as described in the manual.

Create and mount a swapfile if you want.

rsync nix-config to the host

sudo nixos-install --no-root-passwd --flake .#<target>

deploy-rs

nix run github:serokell/deploy-rs .#<target>