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-10-28 20:38:10 +09:00
|
|
|
version = "0.0.10";
|
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";
|
|
|
|
Fshim = "${placeholder "out"}/bin/.fshim";
|
|
|
|
Finit = "${placeholder "out"}/bin/.finit";
|
|
|
|
};
|
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-11-02 03:03:44 +09:00
|
|
|
mv $out/bin/fshim $out/bin/.fshim
|
|
|
|
mv $out/bin/finit $out/bin/.finit
|
2024-09-09 04:37:12 +09:00
|
|
|
'';
|
2024-09-04 17:03:21 +09:00
|
|
|
}
|