-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/modules/installer/sd-card/sd-image-mips64el.nix: init
This cross-compiles a complete NixOS installer image. The image is built specifically for Cavium Octeon chips, because currently these are the Mips64 products that are commercially available: you can order a Ubiquiti Edgerouter from Amazon and have it the next day. All of Debian's non-Longsoon MIPS builders are Octeons: https://wiki.debian.org/MIPSPort Co-authored-by: Samuel Dionne-Riel <[email protected]>
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
To build, use: | ||
nix-build nixos -I nixos-config=nixos/modules/installer/sd-card/sd-image-mips64el.nix -A config.system.build.sdImage | ||
Since mips hardware is found mostly in routers which are optimized | ||
for I/O throughput rather than compilation speed, you probably | ||
want to cross-compile this. To do so, use: | ||
nix-build nixos \ | ||
-A config.system.build.sdImage \ | ||
--arg configuration '{config,lib,pkgs,...}@args: (import ./nixos/modules/installer/sd-card/sd-image-mips64el.nix args) // { nixpkgs.hostPlatform = lib.systems.examples.octeon; nixpkgs.buildPlatform = builtins.currentSystem; }' | ||
*/ | ||
{ config, lib, pkgs, ... }: | ||
|
||
{ | ||
imports = [ | ||
../../profiles/base.nix | ||
./sd-image.nix | ||
]; | ||
|
||
boot.loader = { | ||
grub.enable = false; | ||
generic-extlinux-compatible = { | ||
enable = true; | ||
}; | ||
}; | ||
|
||
services.xserver.enable = lib.mkForce false; | ||
services.xserver.libinput.enable = lib.mkForce false; | ||
|
||
boot.consoleLogLevel = lib.mkDefault 7; | ||
boot.kernelParams = [ "console=ttyS0,115200" ]; | ||
boot.initrd.includeDefaultModules = false; | ||
|
||
sdImage = { | ||
populateFirmwareCommands = ""; | ||
populateRootCommands = '' | ||
mkdir -p ./files/boot | ||
${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot | ||
''; | ||
}; | ||
} |