Created
January 7, 2026 15:26
-
-
Save gnull/fdb9f4f6e05c80f904bb98dbb169a700 to your computer and use it in GitHub Desktop.
Nix flake to reproduce bad bootable flag in sd-image.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| description = "NixOS configuration for an SD card image"; | |
| inputs = { | |
| nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | |
| # nixpkgs.url = "github:gnull/nixpkgs/patch-1"; | |
| flake-utils.url = "github:numtide/flake-utils"; | |
| }; | |
| outputs = | |
| { self, nixpkgs, flake-utils, ... }: | |
| { | |
| ## System config, use with nixos-rebuild | |
| nixosConfigurations = { | |
| orangepi5plus = nixpkgs.lib.nixosSystem { | |
| system = "aarch64-linux"; | |
| modules = [ | |
| "${nixpkgs}/nixos/modules/installer/sd-card/sd-image.nix" | |
| ({config, lib, ...}: { | |
| boot = { | |
| loader = { | |
| grub.enable = lib.mkForce false; | |
| generic-extlinux-compatible.enable = lib.mkForce true; | |
| }; | |
| }; | |
| sdImage = { | |
| populateFirmwareCommands = ""; | |
| firmwarePartitionOffset = 32; | |
| firmwarePartitionName = "BOOT"; | |
| firmwareSize = 200; # MiB | |
| populateRootCommands = ""; | |
| }; | |
| }) | |
| ]; | |
| specialArgs = { | |
| inherit nixpkgs; | |
| }; | |
| }; | |
| }; | |
| } // flake-utils.lib.eachDefaultSystem (system: | |
| { | |
| packages = { | |
| sdImage = self.nixosConfigurations.orangepi5plus.config.system.build.sdImage; | |
| }; | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment