Skip to content

Instantly share code, notes, and snippets.

@telent
Created November 22, 2017 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telent/f4db573d4ed3d8d314487ae7c3794bb7 to your computer and use it in GitHub Desktop.
Save telent/f4db573d4ed3d8d314487ae7c3794bb7 to your computer and use it in GitHub Desktop.
(this doesn't work)
with import <nixpkgs> {
crossSystem = {
system = "mipsel-linux-gnu";
withTLS = true;
platform = {
uboot = null;
name = "malta";
kernelArch = "mips";
kernelBaseConfig = "malta_defconfig";
kernelHeadersBaseConfig = "malta_defconfig";
kernelTarget = "uImage";
gcc = { abi = "gnu"; } ;
kernelAutoModules = false;
kernelModules = false;
kernelPreferBuiltin = true;
};
};
};
let nocheck = d : lib.overrideDerivation d (a: {
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
});
in rec {
hello = (nocheck pkgs.hello);
linux = linux_latest;
kernel = lib.overrideDerivation linux (a: {
name = "nixwrt_kernel";
});
all = buildEnv {
name = "nixwrt";
paths = [ hello pkgs.busybox ];
};
}
@telent
Copy link
Author

telent commented Nov 22, 2017

For the avoidance of doubt, the command I'm running is

NIX_PATH=nixpkgs=`pwd`/nixpkgs nix-build -A linux --show-trace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment