nix: do not force static linking on nix
In a typical Nix or NixOS-based setup, the entire /nix/store directory is available to the sandbox. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
b60c01f440
commit
c4de450217
24
flake.nix
24
flake.nix
@ -166,8 +166,28 @@
|
|||||||
go
|
go
|
||||||
gcc
|
gcc
|
||||||
]
|
]
|
||||||
++ fortify.buildInputs
|
# buildInputs
|
||||||
++ fortify.nativeBuildInputs;
|
++ (
|
||||||
|
with pkgsStatic;
|
||||||
|
[
|
||||||
|
musl
|
||||||
|
libffi
|
||||||
|
acl
|
||||||
|
wayland
|
||||||
|
wayland-protocols
|
||||||
|
]
|
||||||
|
++ (with xorg; [
|
||||||
|
libxcb
|
||||||
|
libXau
|
||||||
|
libXdmcp
|
||||||
|
])
|
||||||
|
)
|
||||||
|
# nativeBuildInputs
|
||||||
|
++ [
|
||||||
|
pkg-config
|
||||||
|
wayland-scanner
|
||||||
|
makeBinaryWrapper
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fhs = fhs.env;
|
fhs = fhs.env;
|
||||||
|
13
package.nix
13
package.nix
@ -1,11 +1,16 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
buildGoModule,
|
buildGoModule,
|
||||||
|
makeBinaryWrapper,
|
||||||
xdg-dbus-proxy,
|
xdg-dbus-proxy,
|
||||||
bubblewrap,
|
bubblewrap,
|
||||||
pkgsStatic,
|
|
||||||
pkg-config,
|
pkg-config,
|
||||||
|
libffi,
|
||||||
|
acl,
|
||||||
|
wayland,
|
||||||
|
wayland-protocols,
|
||||||
wayland-scanner,
|
wayland-scanner,
|
||||||
|
xorg,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildGoModule rec {
|
buildGoModule rec {
|
||||||
@ -27,7 +32,6 @@ buildGoModule rec {
|
|||||||
)
|
)
|
||||||
[
|
[
|
||||||
"-s -w"
|
"-s -w"
|
||||||
"-extldflags '-static'"
|
|
||||||
"-X main.Fmain=${placeholder "out"}/libexec/fortify"
|
"-X main.Fmain=${placeholder "out"}/libexec/fortify"
|
||||||
"-X main.Fshim=${placeholder "out"}/libexec/fshim"
|
"-X main.Fshim=${placeholder "out"}/libexec/fshim"
|
||||||
]
|
]
|
||||||
@ -42,10 +46,7 @@ buildGoModule rec {
|
|||||||
GO_TEST_SKIP_ACL = 1;
|
GO_TEST_SKIP_ACL = 1;
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
# cannot find a cleaner way to do this
|
|
||||||
with pkgsStatic;
|
|
||||||
[
|
[
|
||||||
musl
|
|
||||||
libffi
|
libffi
|
||||||
acl
|
acl
|
||||||
wayland
|
wayland
|
||||||
@ -60,7 +61,7 @@ buildGoModule rec {
|
|||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
wayland-scanner
|
wayland-scanner
|
||||||
pkgsStatic.makeBinaryWrapper
|
makeBinaryWrapper
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user