Ophestra Umiker
30b8bce90a
All checks were successful
test / test (push) Successful in 22s
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
64 lines
1.2 KiB
Nix
64 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
makeBinaryWrapper,
|
|
xdg-dbus-proxy,
|
|
bubblewrap,
|
|
acl,
|
|
xorg,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "fortify";
|
|
version = "0.2.1";
|
|
|
|
src = ./.;
|
|
vendorHash = null;
|
|
|
|
ldflags =
|
|
lib.attrsets.foldlAttrs
|
|
(
|
|
ldflags: name: value:
|
|
ldflags
|
|
++ [
|
|
"-X"
|
|
"git.ophivana.moe/security/fortify/internal.${name}=${value}"
|
|
]
|
|
)
|
|
[
|
|
"-s"
|
|
"-w"
|
|
"-X"
|
|
"main.Fmain=${placeholder "out"}/libexec/fortify"
|
|
"-X"
|
|
"main.Fshim=${placeholder "out"}/libexec/fshim"
|
|
]
|
|
{
|
|
Version = "v${version}";
|
|
Fsu = "/run/wrappers/bin/fsu";
|
|
Finit = "${placeholder "out"}/libexec/finit";
|
|
};
|
|
|
|
buildInputs = [
|
|
acl
|
|
xorg.libxcb
|
|
];
|
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
|
|
|
postInstall = ''
|
|
install -D --target-directory=$out/share/zsh/site-functions comp/*
|
|
|
|
mkdir "$out/libexec"
|
|
mv "$out"/bin/* "$out/libexec/"
|
|
|
|
makeBinaryWrapper "$out/libexec/fortify" "$out/bin/fortify" \
|
|
--inherit-argv0 --prefix PATH : ${
|
|
lib.makeBinPath [
|
|
bubblewrap
|
|
xdg-dbus-proxy
|
|
]
|
|
}
|
|
'';
|
|
}
|