From 7a140ae9eee87806aac6f7dc1123a8970cd3e4e2 Mon Sep 17 00:00:00 2001 From: Knarkzel Date: Tue, 15 Nov 2022 15:55:34 +0100 Subject: [PATCH] Refactor nix files --- devkitppc.nix | 23 ++++++++++------------- extract-docker.nix | 14 +++++++------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/devkitppc.nix b/devkitppc.nix index 79e859e..dfc7886 100644 --- a/devkitppc.nix +++ b/devkitppc.nix @@ -1,30 +1,27 @@ -{pkgs ? import {}}: -with pkgs; rec { - devkitppc-img = dockerTools.pullImage { +let + pkgs = import {}; + devkitppc-img = pkgs.dockerTools.pullImage { imageName = "devkitpro/devkitppc"; imageDigest = "sha256:77ed88cb417e057fa805e12a8ce1eab8865fe35a761cde7be00315d5c6cba288"; sha256 = "LLFLDSPJ/tCRBLj0f9q34b5GVHnHudFCgkb7ppMm8VI="; finalImageName = "devkitpro/devkitppc"; finalImageTag = "20200704"; }; - - devkitpro = stdenv.mkDerivation { +in { + devkitpro = pkgs.stdenv.mkDerivation { name = "devkitpro"; src = import ./extract-docker.nix { + pkgs = pkgs; image = devkitppc-img; directory = "/opt/devkitpro"; }; nativeBuildInputs = [ - autoPatchelfHook + pkgs.autoPatchelfHook ]; buildInputs = [ - stdenv.cc.cc - openssl - zlib - libarchive - ncurses5 - expat - tlf + pkgs.stdenv.cc.cc + pkgs.ncurses5 + pkgs.expat ]; buildPhase = "true"; installPhase = '' diff --git a/extract-docker.nix b/extract-docker.nix index 6933985..174a1fb 100644 --- a/extract-docker.nix +++ b/extract-docker.nix @@ -1,17 +1,17 @@ { + pkgs, image, directory, - pkgs ? import {}, }: pkgs.vmTools.runInLinuxVM ( pkgs.runCommand "docker-preload-image" { memSize = 8 * 1024; - buildInputs = with pkgs; [ - curl - kmod - docker - e2fsprogs - utillinux + buildInputs = [ + pkgs.curl + pkgs.kmod + pkgs.docker + pkgs.e2fsprogs + pkgs.utillinux ]; } ''