chore: include nix configs for devenv

This commit is contained in:
Erica Marigold 2025-02-09 11:05:58 +00:00
parent 965ddb1164
commit e57c9d7b29
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw
3 changed files with 79 additions and 0 deletions

33
dev.nix Normal file
View file

@ -0,0 +1,33 @@
{ pkgs ? import <nixpkgs> {} }:
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/
'';
})
];
}

27
flake.lock generated Normal file
View file

@ -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
}

19
flake.nix Normal file
View file

@ -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;
};
}