2024-09-04 17:03:21 +09:00
|
|
|
{
|
2024-09-09 04:37:12 +09:00
|
|
|
lib,
|
|
|
|
buildGoModule,
|
|
|
|
makeBinaryWrapper,
|
|
|
|
xdg-dbus-proxy,
|
2024-09-23 18:21:12 +09:00
|
|
|
bubblewrap,
|
2024-09-04 17:03:21 +09:00
|
|
|
acl,
|
|
|
|
xorg,
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "fortify";
|
2024-11-06 04:37:43 +09:00
|
|
|
version = "0.1.0";
|
2024-09-04 17:03:21 +09:00
|
|
|
|
|
|
|
src = ./.;
|
|
|
|
vendorHash = null;
|
|
|
|
|
2024-11-02 03:03:44 +09:00
|
|
|
ldflags =
|
|
|
|
lib.attrsets.foldlAttrs
|
|
|
|
(
|
|
|
|
ldflags: name: value:
|
|
|
|
ldflags
|
|
|
|
++ [
|
|
|
|
"-X"
|
|
|
|
"git.ophivana.moe/security/fortify/internal.${name}=${value}"
|
|
|
|
]
|
|
|
|
)
|
|
|
|
[
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2024-11-04 12:32:14 +09:00
|
|
|
"-X"
|
|
|
|
"main.Fmain=${placeholder "out"}/bin/.fortify-wrapped"
|
2024-11-02 03:03:44 +09:00
|
|
|
]
|
|
|
|
{
|
|
|
|
Version = "v${version}";
|
|
|
|
Fsu = "/run/wrappers/bin/fsu";
|
2024-11-06 14:59:28 +09:00
|
|
|
Fshim = "${placeholder "out"}/bin/fshim";
|
|
|
|
Finit = "${placeholder "out"}/bin/finit";
|
2024-11-02 03:03:44 +09:00
|
|
|
};
|
2024-09-04 17:03:21 +09:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
acl
|
|
|
|
xorg.libxcb
|
|
|
|
];
|
2024-09-09 04:37:12 +09:00
|
|
|
|
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2024-09-23 18:21:12 +09:00
|
|
|
wrapProgram $out/bin/${pname} --prefix PATH : ${
|
|
|
|
lib.makeBinPath [
|
|
|
|
bubblewrap
|
|
|
|
xdg-dbus-proxy
|
|
|
|
]
|
|
|
|
}
|
2024-10-27 23:45:52 +09:00
|
|
|
|
|
|
|
mv $out/bin/fsu $out/bin/.fsu
|
2024-09-09 04:37:12 +09:00
|
|
|
'';
|
2024-09-04 17:03:21 +09:00
|
|
|
}
|