My personal NixOS configurations.
Run ./apply-system.sh
to build and apply the NixOS configuration
with the current host name.
Using git-crypt. All files
declared in .gitattributes
file will be encrypted.
# check what files will be encrypted
git-crypt status
# export symmetric key
git-crypt export-key /path/to/key
# unlock with symmetric key
git-crypt unlock /path/to/key
Steps for installing NixOS (aarch64) in a Raspberry Pi 4B without a monitor.
Add this to your system configuration to simulate aarch64:
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
Generate the image with this command:
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./configuration.nix --argstr system aarch64-linux --option sandbox false
Power the Raspberry. It will automatically connect to your wifi and be available via ssh.
There is no necessity to partition the SD card.
Generate the initial configuration: nixos-generate-configuration
.
Add this to your configuration:
boot = {
loader.grub.enable = false;
loader.raspberryPi.enable = true;
loader.raspberryPi.version = 4;
kernelPackages = pkgs.linuxPackages_rpi4;
};
Apply the configuration: nixos-rebuild switch
(it may be necessary to run: nix-channel --update
).