Last active
October 1, 2020 14:25
-
-
Save CRTified/25f9c8a811e371004889e6c0143eab29 to your computer and use it in GitHub Desktop.
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
nix-build \ | |
--cores 0 \ | |
'<nixos-unstable/nixos>' \ | |
-I nixos-config=image.nix \ | |
-A config.system.build.sdImage \ | |
-o result-cross \ | |
--show-trace |
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
# Heavily based on https://gist.github.com/sorki/548de08f621b066c94f0c36a7a78cc41#file-configuration-nix-L9 | |
{ config, lib, pkgs, ... }: | |
{ | |
imports = [ | |
<nixos-unstable/nixos/modules/installer/cd-dvd/sd-image-raspberrypi.nix> | |
./wireless.nix # Just contains the PSK config of my wifi | |
]; | |
# Keep it ready for `dd`ing it on the SD card | |
sdImage = { | |
compressImage = false; | |
}; | |
nixpkgs = { | |
crossSystem = { | |
system = "armv6l-linux"; | |
platform = lib.systems.platforms.raspberrypi; | |
}; | |
overlays = [ | |
(self: super: { | |
mailutils = null; # Does not cross-compile. Missing binary breaks sendmail functionality of smartd | |
}) | |
]; | |
}; | |
# closure minification | |
environment.noXlibs = true; | |
services.xserver.enable = false; | |
services.xserver.desktopManager.xterm.enable = lib.mkForce false; | |
# this pulls too much graphical stuff | |
services.udisks2.enable = lib.mkForce false; | |
# this pulls spidermonkey and firefox | |
security.polkit.enable = false; | |
boot.supportedFilesystems = lib.mkForce [ "vfat" ]; | |
i18n.supportedLocales = lib.mkForce [ (config.i18n.defaultLocale + "/UTF-8") ]; | |
documentation.enable = false; | |
documentation.man.enable = false; | |
documentation.nixos.enable = false; | |
## Combats the default setting of wpa_supplicant not starting on installation devices | |
## https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix#L74 | |
# systemd.services.wpa_supplicant.wantedBy = lib.mkOverride 49 [ "multi-user.target" ]; | |
} |
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
# Add this to your x86 host configuration to add cross-compiling support | |
{ | |
boot.binfmt.emulatedSystems = [ "armv6l-linux" ]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To create a minimal
wireless.nix
, you can run