1
Fork 0
mirror of https://github.com/RGBCube/crash synced 2025-07-28 17:07:45 +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, lib,
stdenvNoCC, stdenvNoCC,
callPackage,
zig_0_12, zig_0_12,
optimize ? "ReleaseFast",
bashInteractive, bashInteractive,
fallbackShell ? bashInteractive, fallbackShell ? bashInteractive,
@ -19,28 +17,15 @@ in stdenvNoCC.mkDerivation {
src = ./.; src = ./.;
nativeBuildInputs = [ zig_0_12 ]; dontCheck = true;
dontConfigure = true; nativeBuildInputs = [
dontInstall = true; zig_0_12.hook
];
preBuild = '' zigBuildFlags = [
mkdir -p .cache "-Dfallback_shell=${fallbackShell'}"
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
'';
passthru.shellPath = "/bin/crash"; passthru.shellPath = "/bin/crash";

View file

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