{ description = "Wiimms SZS Tools - command line tools for Mario Kart Wii files"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; version = "2.42a"; in { packages = { wiimms-szs-tools = pkgs.stdenv.mkDerivation { pname = "wiimms-szs-tools"; inherit version; src = ./.; buildInputs = with pkgs; [ ncurses libpng zlib ]; postPatch = '' # Fix shebangs: /usr/bin/env doesn't exist in Nix sandbox sed -i '1s|#!/usr/bin/env bash|#!${pkgs.bash}/bin/bash|' \ project/gen-template.sh project/gen-text-file.sh ''; buildPhase = '' make -C project SHELL=bash NOWIIMM=1 ''; installPhase = '' for tool in wszst wbmgt wctct wimgt wkclt wkmpt wlect wmdlt wpatt wstrt; do install -Dm755 "project/$tool" "$out/bin/$tool" done ''; meta = with pkgs.lib; { description = "Command-line tools to extract, modify and create Mario Kart Wii files"; homepage = "https://szs.wiimm.de/"; license = licenses.gpl2Plus; maintainers = [ ]; platforms = platforms.linux; }; }; default = self.packages.${system}.wiimms-szs-tools; }; }); }