From e884c7a20696e79a8bbd0a83c70af678e5e50207 Mon Sep 17 00:00:00 2001 From: Knarkzel Date: Fri, 18 Nov 2022 21:50:32 +0100 Subject: [PATCH] Try flake --- flake.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..63f61b5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,46 @@ +{ + inputs = { + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-22.05"; + }; + flake-utils = { + url = "github:numtide/flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {}; + image = pkgs.dockerTools.pullImage { + imageName = "devkitpro/devkitppc"; + imageDigest = "sha256:d88e21c1a7b5f8070ba7a15aa892e395f118ded9803b0f8223a3d29ba279fff3"; + sha256 = "nVtz/9mbYveKbvTMj/39EzND7qiLkjBHfqSOgT6SBUY="; + finalImageName = "devkitpro/devkitppc"; + finalImageTag = "20220821"; + }; + in { + devkitPPC = pkgs.stdenv.mkDerivation { + name = "devkitPPC"; + src = import ./extract-docker.nix pkgs image; + nativeBuildInputs = [ pkgs.autoPatchelfHook ]; + buildInputs = [ + pkgs.stdenv.cc.cc + pkgs.ncurses5 + pkgs.expat + pkgs.xz + ]; + buildPhase = "true"; + installPhase = '' + mkdir -p $out + cp -r $src/{devkitPPC,libogc,portlibs,tools,wut} $out + rm -rf $out/pacman + ''; + }; + }); +}