NixOS-based container for running GitHub actions
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

more debugging

+22 -36
+2 -20
flake.nix
··· 37 37 inherit system; 38 38 overlays = [ 39 39 # (final: prev: { 40 - # util-linux = prev.util-linux.override { 41 - # pamSupport = false; 42 - # }; 43 - # }) 44 - # (final: prev: { 45 40 # nix = prev.nix.overrideAttrs (old: { 46 41 # postInstall = '' 47 42 # chmod u+s $out/bin/nix ··· 246 241 groupContents = (lib.concatStringsSep "\n" (lib.attrValues (lib.mapAttrs groupToGroup groups))); 247 242 248 243 defaultNixConf = { 249 - cores = "1"; 250 - max-jobs = "1"; 251 - http-connections = "5"; 252 244 sandbox = "true"; 253 245 build-users-group = "nixbld"; 254 246 trusted-users = [ ··· 481 473 extraCommands = '' 482 474 rm -rf nix-support 483 475 ln -s /nix/var/nix/profiles nix/var/nix/gcroots/profiles 484 - 485 - # https://github.com/containerd/containerd/issues/12683 486 - 487 - # tmp="$(realpath --relative-to=etc etc/passwd)" 488 - # rm -f etc/passwd 489 - # cp "$tmp" etc/passwd 490 - 491 - # tmp="$(realpath --relative-to=etc etc/group)" 492 - # rm -f etc/group 493 - # cp "$tmp" etc/group 494 476 ''; 495 477 fakeRootCommands = '' 496 478 chmod u=rwxt,u=rwx,o=rwx tmp ··· 521 503 "USER=root" 522 504 "PATH=${ 523 505 lib.concatStringsSep ":" [ 524 - "${lib.getBin execas-github}/bin" 506 + # "${lib.getBin execas-github}/bin" 525 507 "/root/.nix-profile/bin" 526 508 "/nix/var/nix/profiles/default/bin" 527 509 "/nix/var/nix/profiles/default/sbin" ··· 543 525 "GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" 544 526 "NIX_SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" 545 527 "NIX_PATH=/nix/var/nix/profiles/per-user/root/channels:/root/home/.nix-defexpr/channels" 546 - "MEMORYTEST=${lib.getExe' execas-github "memorytest"}" 528 + # "MEMORYTEST=${lib.getExe' execas-github "memorytest"}" 547 529 ]; 548 530 }; 549 531 };
+2 -7
src/bash.zig
··· 25 25 26 26 try lib.switchToUser(); 27 27 28 + lib.chdir(.user); 29 + 28 30 try lib.exec(init.gpa, options.bash, argv.items, &environ_map); 29 - 30 - // const err = std.process.replace(io, .{ 31 - // .argv = argv.items, 32 - // .environ_map = &environ_map, 33 - // }); 34 - 35 - // std.debug.print("unable to execute: {t}\n", .{err}); 36 31 }
+2
src/lib.zig
··· 3 3 4 4 const std = @import("std"); 5 5 6 + pub const chdir = @import("lib/chdir.zig").chdir; 6 7 pub const exec = @import("lib/process.zig").exec; 7 8 pub const fixupEnvironMap = @import("lib/env.zig").fixupEnvironMap; 8 9 pub const switchToUser = @import("lib/switchtouser.zig").switchToUser; 9 10 10 11 test { 12 + _ = @import("lib/chdir.zig"); 11 13 _ = @import("lib/env.zig"); 12 14 _ = @import("lib/process.zig"); 13 15 _ = @import("lib/switchtouser.zig");
+14
src/lib/chdir.zig
··· 1 + // SPDX-FileCopyrightText: © 2023 Jeffrey C. Ollie 2 + // SPDX-License-Identifier: MIT 3 + 4 + const std = @import("std"); 5 + const options = @import("options"); 6 + 7 + pub fn chdir( 8 + user: enum { root, user }, 9 + ) void { 10 + _ = std.os.linux.chdir(switch (user) { 11 + .root => "/root", 12 + .user => "/github/home", 13 + }); 14 + }
+2 -9
src/sh.zig
··· 25 25 26 26 try lib.switchToUser(); 27 27 28 - try lib.exec(init.gpa, options.sh, argv.items, &environ_map); 28 + lib.chdir(.user); 29 29 30 - // const err = std.process.replace(io, .{ 31 - // .argv = argv.items, 32 - // .environ_map = &environ_map, 33 - // }); 34 - 35 - // std.debug.print("unable to execute: {t}\n", .{err}); 36 - 37 - // return 127; 30 + try lib.exec(init.gpa, options.sh, argv.items, &environ_map); 38 31 }