Initial commit

This commit is contained in:
coolneng 2022-07-12 16:39:43 +02:00
commit 079c9c37a5
3 changed files with 37 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.zst filter=lfs diff=lfs merge=lfs -text

17
README.md Normal file
View File

@ -0,0 +1,17 @@
# Custom SD image for Raspberry Pi 4
This repository contains the instructions and configuration to build a SD image with a bigger /boot partition size and my SSH public keys
## Usage
1. Enable QEMU on the host machine by adding the following option
```{nix}
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
```
2. Build the image
```{bash}
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./sd-image.nix --argstr system aarch64-linux
```

19
sd-image.nix Normal file
View File

@ -0,0 +1,19 @@
{ ... }: {
imports = [
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64.nix>
];
# Add SSH key
users.extraUsers.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFRqINHR7/zc+c3/PuR+NeSsBHXXzBiEtFWSK6QaxQTW coolneng@panacea"
];
users.extraUsers.nixos = {
isNormalUser = true;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFRqINHR7/zc+c3/PuR+NeSsBHXXzBiEtFWSK6QaxQTW coolneng@panacea"
];
};
# Increase /boot partition size
sdImage.firmwareSize = 256;
}