diff options
| author | jamie <git@skilet.ro> | 2026-06-28 09:55:30 +0100 |
|---|---|---|
| committer | jamie <git@skilet.ro> | 2026-06-28 09:55:30 +0100 |
| commit | 264b6090e49c8f9bf508c8a0925dc41595a73332 (patch) | |
| tree | 653a9ee9af8edd136f62e124faab88cf978f2d63 /flake.nix | |
| parent | 246fdb38d7c2fb3054b8f8528e11dc8f17691750 (diff) | |
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ddaaef2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,51 @@ +{ + 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; + }; + }); +} |
