lol
1{
2 lib,
3 fetchFromGitLab,
4 libseccomp,
5 mandoc,
6 nix-update-script,
7 pkg-config,
8 rustPlatform,
9 scdoc,
10 testers,
11}:
12
13rustPlatform.buildRustPackage (finalAttrs: {
14 pname = "sydbox";
15 version = "3.38.2";
16
17 outputs = [
18 "out"
19 "man"
20 ];
21
22 src = fetchFromGitLab {
23 domain = "gitlab.exherbo.org";
24 owner = "Sydbox";
25 repo = "sydbox";
26 tag = "v${finalAttrs.version}";
27 hash = "sha256-yxe3U+n9FL58wI/uk8EM24Mcmxzlk8wmgi0wCu+dcnk=";
28 };
29
30 cargoHash = "sha256-17Ri1QGQFWL/DTjpGEMb4SubsnvHcVTYW6wsjiFR36w=";
31
32 nativeBuildInputs = [
33 mandoc
34 pkg-config
35 scdoc
36 ];
37
38 buildInputs = [ libseccomp ];
39
40 makeFlags = [ "PREFIX=${placeholder "out"}" ];
41
42 checkFlags = [
43 # rm -rf tmpdir: Os { code: 2, kind: NotFound, message: "No such file or directory" }
44 "--skip=fs::tests::test_relative_symlink_resolution"
45 # Failed to write C source file!: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
46 "--skip=proc::tests::test_proc_set_at_secure_test_32bit_dynamic"
47 # Flakey. May only fail on OfBorg/Hydra
48 # Failed to write C source file!: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
49 "proc::tests::test_proc_set_at_secure_test_32bit_static"
50 # Failed to write C source file!: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
51 "--skip=proc::tests::test_proc_set_at_secure_test_32bit_static_pie"
52 # /bin/false: Os { code: 2, kind: NotFound, message: "No such file or directory" }
53 "--skip=syd_test"
54
55 # Endlessly stall or use "invalid arguments". Maybe a sandbox issue?
56 "--skip=caps"
57 "--skip=landlock"
58 "--skip=proc::proc_cmdline"
59 "--skip=proc::proc_comm"
60 ];
61
62 # TODO: Have these directories be created upstream similar to the vim files
63 postInstall = ''
64 mkdir -p $out/share/man/man{1,2,5,7}
65
66 make $makeFlags install-{man,vim}
67 '';
68
69 passthru = {
70 tests.version = testers.testVersion {
71 package = finalAttrs.finalPackage;
72 command = "syd -V";
73 };
74
75 updateScript = nix-update-script { };
76 };
77
78 meta = {
79 description = "Seccomp-based application sandbox";
80 homepage = "https://gitlab.exherbo.org/sydbox/sydbox";
81 changelog = "https://gitlab.exherbo.org/sydbox/sydbox/-/blob/${finalAttrs.src.tag}/ChangeLog.md";
82 license = lib.licenses.gpl3Plus;
83 maintainers = with lib.maintainers; [
84 mvs
85 getchoo
86 ];
87 mainProgram = "syd";
88 platforms = lib.platforms.linux;
89 };
90})