1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 21:11:34 +03:00
mobile-nixos/systems/kernel-initrd.nix
Samuel Dionne-Riel 6095b623f6 Adds qemu-x86_64 device.
Network doesn't work :/
2018-06-17 20:55:34 -04:00

38 lines
742 B
Nix

{
device_config,
hardware_config,
initrd
}:
let
pkgs = (import ../overlay);
in
with pkgs;
let
inherit (hardware_config) ram;
device_name = device_config.name;
device_info = device_config.info;
linux = device_info.kernel;
kernel = "${linux}/*Image*";
# TODO : Allow appending / prepending
cmdline = device_info.kernel_cmdline;
in
stdenv.mkDerivation {
name = "nixos-mobile_${device_name}_boot.img";
src = builtins.filterSource (path: type: false) ./.;
unpackPhase = "true";
buildInputs = [
linux
];
installPhase = ''
mkdir -p $out/
cp ${kernel} $out/kernel
cp ${initrd} $out/initrd
echo -n "${cmdline}" > $out/cmdline.txt
echo -n "${toString ram}" > $out/ram.txt
'';
}