Skip to content

JoeyEamigh/nixos-superbird-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nixos-superbird-template

A flake template for nixos-superbird. Many helpful commands exist in the Justfile.

For documentation about what is going on here, visit https://github.com/JoeyEamigh/nixos-superbird.

Whenever there is a new update to nixos-superbird, you must run nix flake update (or rm flake.nix if using docker) to get the newest version.

Build Installer (docker)

without build caching:

docker run --privileged --rm -it -v $(pwd):/workdir ghcr.io/joeyeamigh/nixos-superbird/builder:latest

with build caching:

docker volume create nix-store
docker volume create nix-root
docker run --privileged --rm -it \
  -v ./:/workdir \
  -v nix-store:/nix \
  -v nix-root:/root \
  ghcr.io/joeyeamigh/nixos-superbird/builder:latest

or all-in-one:

docker compose up

MacOS Notes

On MacOS, there is a bug that prevents filesystem permissions from working properly. Until this is fixed, a workaround is to go into the Docker Desktop settings, scroll down to Virtual Machine Options, and select osxfs (Legacy) as the file sharing implementation.

Build Installer (local)

nix build '.#nixosConfigurations.superbird.config.system.build.installer' -j$(nproc) --show-trace
echo "kernel is $(stat -Lc%s -- result/linux/kernel | numfmt --to=iec)"
echo "initrd is $(stat -Lc%s -- result/linux/initrd.img | numfmt --to=iec)"
echo "rootfs (sparse) is $(stat -Lc%s -- result/linux/rootfs.img | numfmt --to=iec)"

sudo rm -rf ./out
mkdir ./out
cp -r ./result/* ./out/
chown -R $(whoami):$(whoami) ./out
cd ./out

sudo ./scripts/shrink-img.sh
echo "rootfs (compact) is $(stat -Lc%s -- ./linux/rootfs.img | numfmt --to=iec)"

Run Installer

cd out

./install.sh

Push System Over SSH (Development)

If you are planning on building multiple iterations of the system, build the installer using the following command:

docker run --privileged -it -v $(pwd):/workdir ghcr.io/joeyeamigh/nixos-superbird/builder:latest

Then, after flashing the device, bring your network interface online by running cd ./out && ./scripts/ssh.sh. Then you can run the Docker container with host networking, and push any changes directly.

docker run --privileged --network=host --entrypoint bash -it -v ./:/workdir ghcr.io/joeyeamigh/nixos-superbird/builder:latest

In the container:

nix run github:serokell/deploy-rs

Releases

No releases published

Packages

No packages published