aboutsummaryrefslogtreecommitdiff
path: root/nix/initramfs.nix
blob: db2b3134d077057ef2e6af262cb5ed581480a8b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ stdenv, kernel, busybox, cpio }:

stdenv.mkDerivation {
  name = "initramfs-yerba";
  src = ./.;
  buildInputs = [ cpio ];
  buildPhase = ''
    mkdir -p $out
    mkdir -p initramfs/bin
    cp -a ${busybox}/_install/* initramfs/
    cp ${../initramfs_init} initramfs/init
    chmod +x initramfs/init
    cd initramfs
    find . | cpio -o -H newc | gzip > $out/initramfs.cpio.gz
  '';
  installPhase = ''
    echo "initramfs built"
  '';
}