diff --git a/dev.nix b/dev.nix new file mode 100644 index 0000000..f3ba7e0 --- /dev/null +++ b/dev.nix @@ -0,0 +1,33 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = [ + pkgs.curl + pkgs.git + pkgs.lune + (let version = "6.0-28"; in pkgs.stdenv.mkDerivation { + name = "unzip-${version}"; + src = pkgs.fetchurl { + url = "http://ftp.debian.org/debian/pool/main/u/unzip/unzip_${version}_amd64.deb"; + sha256 = "13h6cm4708p5zczi7fc4qbdlwl1nhnhrk0ncwv9chb1q6jf55ndk"; + }; + + buildInputs = [ pkgs.binutils pkgs.gnutar pkgs.bzip2 pkgs.pkg-config ]; + + unpackPhase = '' + mkdir -p tmp/ + ar x $src + mv data.tar.xz tmp/ + ''; + + installPhase = '' + mkdir -p $out/bin $out/lib + tar -xf ./tmp/data.tar.xz -C $out + mv $out/usr/bin/unzip $out/bin/ + cp $(pkg-config --variable=libdir bzip2)/libbz2.so.1.0.8 $out/lib/libbz2.so.1.0 + rm -rf $out/usr tmp/ + ''; + }) + ]; +} + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..018d1fa --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1739092636, + "narHash": "sha256-h3MJZPufyEgYho/eIa6BvCSEMHed5a7j3uPk6dZctuY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "d9b16fd85014d20ed53f65b0cf45cbc36b60c3fc", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "release-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2ff65a4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,19 @@ +{ + description = "luau-unzip development environment"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/release-24.11"; + }; + + outputs = { self, nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { inherit system; }; + devpkgs = import ./dev.nix { + inherit pkgs; + }; + in { + packages.${system}.devShell = devpkgs; + defaultPackage.${system} = devpkgs; + }; +} +