test: build test program in nixos config
All checks were successful
Test / Create distribution (push) Successful in 26s
Test / Fpkg (push) Successful in 34s
Test / Data race detector (push) Successful in 3m18s
Test / Fortify (push) Successful in 1m53s
Test / Flake checks (push) Successful in 57s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-03-29 19:33:17 +09:00
parent 72c59f9229
commit 8b62e08b44
3 changed files with 37 additions and 37 deletions

View File

@@ -5,7 +5,38 @@
...
}:
let
testCases = import ./sandbox/case pkgs config.environment.fortify.package.version;
testProgram =
let
inherit (pkgs)
buildGoModule
pkg-config
util-linux
;
in
buildGoModule rec {
pname = "check-sandbox";
inherit (config.environment.fortify.package) version;
src = builtins.path {
name = "${pname}-src";
path = lib.cleanSource ./.;
filter = path: type: (type == "directory" && lib.hasSuffix "sandbox" path) || (type == "regular" && lib.hasSuffix ".go" path);
};
vendorHash = null;
buildInputs = [ util-linux ];
nativeBuildInputs = [ pkg-config ];
preBuild = ''
go mod init git.gensokyo.uk/security/fortify/test >& /dev/null
'';
postInstall = ''
mv $out/bin/test $out/bin/fortify-test
'';
};
testCases = import ./sandbox/case lib testProgram;
in
{
users.users = {
@@ -42,7 +73,7 @@ in
mako
# For checking seccomp outcome:
testCases._testProgram
testProgram
];
variables = {