Browse Source

Refactor nix files

master
Knarkzel 2 years ago
parent
commit
7a140ae9ee
  1. 23
      devkitppc.nix
  2. 14
      extract-docker.nix

23
devkitppc.nix

@ -1,30 +1,27 @@
{pkgs ? import <nixpkgs> {}}: let
with pkgs; rec { pkgs = import <nixpkgs> {};
devkitppc-img = dockerTools.pullImage { devkitppc-img = pkgs.dockerTools.pullImage {
imageName = "devkitpro/devkitppc"; imageName = "devkitpro/devkitppc";
imageDigest = "sha256:77ed88cb417e057fa805e12a8ce1eab8865fe35a761cde7be00315d5c6cba288"; imageDigest = "sha256:77ed88cb417e057fa805e12a8ce1eab8865fe35a761cde7be00315d5c6cba288";
sha256 = "LLFLDSPJ/tCRBLj0f9q34b5GVHnHudFCgkb7ppMm8VI="; sha256 = "LLFLDSPJ/tCRBLj0f9q34b5GVHnHudFCgkb7ppMm8VI=";
finalImageName = "devkitpro/devkitppc"; finalImageName = "devkitpro/devkitppc";
finalImageTag = "20200704"; finalImageTag = "20200704";
}; };
in {
devkitpro = stdenv.mkDerivation { devkitpro = pkgs.stdenv.mkDerivation {
name = "devkitpro"; name = "devkitpro";
src = import ./extract-docker.nix { src = import ./extract-docker.nix {
pkgs = pkgs;
image = devkitppc-img; image = devkitppc-img;
directory = "/opt/devkitpro"; directory = "/opt/devkitpro";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
autoPatchelfHook pkgs.autoPatchelfHook
]; ];
buildInputs = [ buildInputs = [
stdenv.cc.cc pkgs.stdenv.cc.cc
openssl pkgs.ncurses5
zlib pkgs.expat
libarchive
ncurses5
expat
tlf
]; ];
buildPhase = "true"; buildPhase = "true";
installPhase = '' installPhase = ''

14
extract-docker.nix

@ -1,17 +1,17 @@
{ {
pkgs,
image, image,
directory, directory,
pkgs ? import <nixpkgs> {},
}: }:
pkgs.vmTools.runInLinuxVM ( pkgs.vmTools.runInLinuxVM (
pkgs.runCommand "docker-preload-image" { pkgs.runCommand "docker-preload-image" {
memSize = 8 * 1024; memSize = 8 * 1024;
buildInputs = with pkgs; [ buildInputs = [
curl pkgs.curl
kmod pkgs.kmod
docker pkgs.docker
e2fsprogs pkgs.e2fsprogs
utillinux pkgs.utillinux
]; ];
} }
'' ''

Loading…
Cancel
Save