Skip to content
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/build-installer-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build and upload Raspberry Pi installer images

on:
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
env:
SSH_PUB_KEY: ${{ secrets.SSH_PUB_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v4


- uses: cachix/install-nix-action@v31
- run: nix build
- run: nix flake check

- name: Inject SSH public key
run: |
sed -i "s|# YOUR SSH PUB KEY HERE #|$SSH_PUB_KEY|g" flake.nix

- name: Build rpi02 installer image
run: nix build .#installerImages.rpi02 --out-link out-rpi02

- name: Build rpi4 installer image
run: nix build .#installerImages.rpi4 --out-link out-rpi4

- name: Build rpi5 installer image
run: nix build .#installerImages.rpi5 --out-link out-rpi5

- name: Collect built images
run: |
mkdir -p images
for out in out-rpi02 out-rpi4 out-rpi5; do
for file in "$out"/*; do
cp -L "$file" images/
done
done

- name: Upload images artifact
uses: actions/upload-artifact@v3
with:
name: installer-images
path: images
6 changes: 6 additions & 0 deletions flake.nix
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This additional configuration isn't needed.
This flake uses https://github.com/nix-community/nixos-images as a base for installer images:

  • ssh is already enabled, permitting password logins
  • root can login with the dynamically-generated password show on the screen

Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@
# YOUR SSH PUB KEY HERE #

];
services.openssh = {
enable = true;
passwordAuthentication = true;
};

users.users.nixos.initialPassword = "password";

environment.systemPackages = with pkgs; [
tree
Expand Down