1
Fork 0
mirror of https://github.com/RGBCube/crash synced 2025-07-27 08:27:44 +00:00

Fix index out of bounds and clean package.nix

This commit is contained in:
RGBCube 2024-05-15 16:46:53 +03:00
parent 00c77812f1
commit 886ca98838
No known key found for this signature in database
3 changed files with 8 additions and 29 deletions

View file

@ -1,6 +0,0 @@
# generated by zon2nix (https://github.com/nix-community/zon2nix)
{ linkFarm, fetchzip }:
linkFarm "zig-packages" [
]

View file

@ -1,10 +1,8 @@
{
lib,
stdenvNoCC,
callPackage,
zig_0_12,
optimize ? "ReleaseFast",
bashInteractive,
fallbackShell ? bashInteractive,
@ -19,28 +17,15 @@ in stdenvNoCC.mkDerivation {
src = ./.;
nativeBuildInputs = [ zig_0_12 ];
dontCheck = true;
dontConfigure = true;
dontInstall = true;
nativeBuildInputs = [
zig_0_12.hook
];
preBuild = ''
mkdir -p .cache
ln -s ${callPackage ./build.zig.zon.nix {}} .cache/p
'';
buildPhase = ''
runHook preBuild
zig build install \
--cache-dir $(pwd)/zig-cache \
--global-cache-dir $(pwd)/.cache \
--prefix $out \
-Doptimize=${optimize} \
-Dfallback_shell=${fallbackShell'}
runHook postBuild
'';
zigBuildFlags = [
"-Dfallback_shell=${fallbackShell'}"
];
passthru.shellPath = "/bin/crash";

View file

@ -16,8 +16,8 @@ pub fn main() noreturn {
var argi = std.process.args();
while (argi.next()) |arg| {
args[args.len] = arg;
args.len += 1;
args[args.len - 1] = arg;
}
const shells = std.posix.getenv("SHELLS") orelse fallback(alloc);