test: move nix files
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m53s
Test / ShareFS (push) Successful in 3m51s
Test / Hakurei (push) Successful in 4m11s
Test / Sandbox (race detector) (push) Successful in 5m29s
Test / Hakurei (race detector) (push) Successful in 6m41s
Test / Flake checks (push) Successful in 1m11s
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m53s
Test / ShareFS (push) Successful in 3m51s
Test / Hakurei (push) Successful in 4m11s
Test / Sandbox (race detector) (push) Successful in 5m29s
Test / Hakurei (race detector) (push) Successful in 6m41s
Test / Flake checks (push) Successful in 1m11s
These are too much clutter. Move them to test directory until the test suite replacement is upstreamed. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildGo126Module,
|
||||
makeBinaryWrapper,
|
||||
xdg-dbus-proxy,
|
||||
pkg-config,
|
||||
libffi,
|
||||
libseccomp,
|
||||
acl,
|
||||
wayland,
|
||||
wayland-protocols,
|
||||
wayland-scanner,
|
||||
|
||||
libxcb,
|
||||
libxau,
|
||||
libxdmcp,
|
||||
|
||||
# for sharefs
|
||||
fuse3,
|
||||
|
||||
# for passthru.buildInputs
|
||||
go_1_26,
|
||||
clang,
|
||||
xorgproto,
|
||||
|
||||
# for check
|
||||
util-linux,
|
||||
nettools,
|
||||
|
||||
glibc, # for ldd
|
||||
withStatic ? stdenv.hostPlatform.isStatic,
|
||||
}:
|
||||
|
||||
buildGo126Module rec {
|
||||
pname = "hakurei";
|
||||
version = with lib.strings; removePrefix "v" (trim (builtins.readFile ../cmd/dist/VERSION));
|
||||
|
||||
srcFiltered = builtins.path {
|
||||
name = "${pname}-src";
|
||||
path = lib.cleanSource ../.;
|
||||
filter = path: type: !(type == "regular" && (lib.hasSuffix ".nix" path || lib.hasSuffix ".py" path)) && !(type == "directory" && lib.hasSuffix "/test" path) && !(type == "directory" && lib.hasSuffix "/cmd/hsu" path);
|
||||
};
|
||||
vendorHash = null;
|
||||
|
||||
src = stdenv.mkDerivation {
|
||||
name = "${pname}-src-full";
|
||||
inherit version;
|
||||
enableParallelBuilding = true;
|
||||
src = srcFiltered;
|
||||
|
||||
buildInputs = [
|
||||
wayland
|
||||
wayland-protocols
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
go_1_26
|
||||
pkg-config
|
||||
wayland-scanner
|
||||
];
|
||||
|
||||
buildPhase = "GOCACHE=$(mktemp -d) go generate ./...";
|
||||
installPhase = "cp -r . $out";
|
||||
};
|
||||
|
||||
ldflags =
|
||||
lib.attrsets.foldlAttrs
|
||||
(
|
||||
ldflags: name: value:
|
||||
ldflags ++ [ "-X hakurei.app/internal/info.${name}=${value}" ]
|
||||
)
|
||||
(
|
||||
[ "-s -w" ]
|
||||
++ lib.optionals withStatic [
|
||||
"-linkmode external"
|
||||
"-extldflags \"-static\""
|
||||
]
|
||||
)
|
||||
{
|
||||
buildVersion = "v${version}";
|
||||
hakureiPath = "${placeholder "out"}/libexec/hakurei";
|
||||
hsuPath = "/run/wrappers/bin/hsu";
|
||||
};
|
||||
|
||||
env = {
|
||||
# use clang instead of gcc
|
||||
CC = "clang -O3 -Werror";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
libffi
|
||||
libseccomp
|
||||
fuse3
|
||||
acl
|
||||
wayland
|
||||
|
||||
libxcb
|
||||
libxau
|
||||
libxdmcp
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeBinaryWrapper
|
||||
|
||||
# for container example
|
||||
nettools
|
||||
];
|
||||
|
||||
postInstall =
|
||||
let
|
||||
appPackages = [
|
||||
glibc
|
||||
xdg-dbus-proxy
|
||||
];
|
||||
in
|
||||
''
|
||||
install -D --target-directory=$out/share/zsh/site-functions cmd/dist/comp/*
|
||||
|
||||
mkdir "$out/libexec"
|
||||
mv "$out"/bin/* "$out/libexec/"
|
||||
|
||||
makeBinaryWrapper "$out/libexec/hakurei" "$out/bin/hakurei" \
|
||||
--inherit-argv0 --prefix PATH : ${lib.makeBinPath appPackages}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
go = go_1_26;
|
||||
|
||||
targetPkgs = [
|
||||
go_1_26
|
||||
clang
|
||||
xorgproto
|
||||
util-linux
|
||||
|
||||
# for go generate
|
||||
wayland-protocols
|
||||
wayland-scanner
|
||||
]
|
||||
++ buildInputs
|
||||
++ nativeBuildInputs;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user