commit
b833efbcd7
@ -0,0 +1,33 @@ |
|||||||
|
{ lib |
||||||
|
, fetchFromGitHub |
||||||
|
, rustPlatform |
||||||
|
, notmuch |
||||||
|
, stdenv |
||||||
|
, Security |
||||||
|
}: |
||||||
|
|
||||||
|
rustPlatform.buildRustPackage rec { |
||||||
|
pname = "mujmap"; |
||||||
|
version = "0.1.1"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
owner = "elizagamedev"; |
||||||
|
repo = pname; |
||||||
|
rev = "v${version}"; |
||||||
|
sha256 = "sha256-O5CbLgs+MkATPtess0gocgPB9kwD8FMR/urwm6jo2rA="; |
||||||
|
}; |
||||||
|
|
||||||
|
cargoSha256 = "sha256-nOZ+HnzXhVp+tLrNMZO1NmZIhIqlWz0fRMbHVIQkOxI="; |
||||||
|
|
||||||
|
buildInputs = [ |
||||||
|
notmuch |
||||||
|
] ++ lib.optional stdenv.isDarwin Security; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "Bridge for synchronizing email and tags between JMAP and notmuch"; |
||||||
|
homepage = "https://github.com/elizagamedev/mujmap/"; |
||||||
|
license = licenses.gpl3Plus; |
||||||
|
maintainers = with maintainers; [ elizagamedev ]; |
||||||
|
mainProgram = "mujmap"; |
||||||
|
}; |
||||||
|
} |
@ -1,28 +0,0 @@ |
|||||||
{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }: |
|
||||||
|
|
||||||
stdenv.mkDerivation { |
|
||||||
pname = "cpp-ipfs-api"; |
|
||||||
version = "2017-01-04"; |
|
||||||
|
|
||||||
src = fetchFromGitHub { |
|
||||||
owner = "vasild"; |
|
||||||
repo = "cpp-ipfs-api"; |
|
||||||
rev = "96a890f4518665a56581a2a52311eaa65928eac8"; |
|
||||||
sha256 = "1z6gbd7npg4pd9wmdyzcp9h12sg84d7a43c69pp4lzqkyqg8pz1g"; |
|
||||||
}; |
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ]; |
|
||||||
buildInputs = [ curl ]; |
|
||||||
propagatedBuildInputs = [ nlohmann_json ]; |
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = [ |
|
||||||
"-Wno-error=range-loop-construct" |
|
||||||
]; |
|
||||||
|
|
||||||
meta = with lib; { |
|
||||||
description = "IPFS C++ API client library"; |
|
||||||
homepage = "https://github.com/vasild/cpp-ipfs-api"; |
|
||||||
license = licenses.mit; |
|
||||||
platforms = platforms.all; |
|
||||||
}; |
|
||||||
} |
|
@ -0,0 +1,35 @@ |
|||||||
|
{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }: |
||||||
|
|
||||||
|
stdenv.mkDerivation { |
||||||
|
pname = "cpp-ipfs-http-client"; |
||||||
|
version = "unstable-2022-01-30"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
owner = "vasild"; |
||||||
|
repo = "cpp-ipfs-http-client"; |
||||||
|
rev = "3cdfa7fc6326e49fc81b3c7ca43ce83bdccef6d9"; |
||||||
|
sha256 = "sha256-/oyafnk4SbrvoCh90wkZXNBjknMKA6EEUoEGo/amLUo="; |
||||||
|
}; |
||||||
|
|
||||||
|
patches = [ ./unvendor-nlohmann-json.patch ]; |
||||||
|
|
||||||
|
postPatch = '' |
||||||
|
substituteInPlace CMakeLists.txt \ |
||||||
|
--replace '# Fetch "JSON for Modern C++"' "include_directories(${nlohmann_json}/include)" |
||||||
|
''; |
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ]; |
||||||
|
buildInputs = [ curl ]; |
||||||
|
propagatedBuildInputs = [ nlohmann_json ]; |
||||||
|
|
||||||
|
NIX_CFLAGS_COMPILE = [ |
||||||
|
"-Wno-error=range-loop-construct" |
||||||
|
]; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "IPFS C++ API client library"; |
||||||
|
homepage = "https://github.com/vasild/cpp-ipfs-http-client"; |
||||||
|
license = licenses.mit; |
||||||
|
platforms = [ "x86_64-linux" "x86_64-darwin" ]; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
--- source/CMakeLists.txt
|
||||||
|
+++ source/CMakeLists.txt
|
||||||
|
@@ -56,11 +56,6 @@ target_include_directories(${IPFS_API_LIBNAME}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Fetch "JSON for Modern C++"
|
||||||
|
-include(FetchContent)
|
||||||
|
-message(STATUS "Fetching nlohmann/JSON")
|
||||||
|
-# Retrieve Nlohmann JSON
|
||||||
|
-FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz)
|
||||||
|
-FetchContent_MakeAvailable(json)
|
||||||
|
|
||||||
|
# libcurl requires additional libs only for static Windows builds
|
||||||
|
if(WIN32)
|
||||||
|
@@ -71,12 +66,11 @@ set_target_properties(${IPFS_API_LIBNAME} PROPERTIES
|
||||||
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
||||||
|
VERSION ${PROJECT_VERSION}
|
||||||
|
)
|
||||||
|
-target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS} nlohmann_json::nlohmann_json)
|
||||||
|
+target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS})
|
||||||
|
if(NOT DISABLE_INSTALL)
|
||||||
|
install(TARGETS ${IPFS_API_LIBNAME} DESTINATION lib)
|
||||||
|
install(FILES include/ipfs/client.h DESTINATION include/ipfs)
|
||||||
|
install(FILES include/ipfs/http/transport.h DESTINATION include/ipfs/http)
|
||||||
|
- install(FILES ${json_SOURCE_DIR}/include/nlohmann/json.hpp DESTINATION include/nlohmann)
|
||||||
|
endif()
|
||||||
|
# Tests, use "CTEST_OUTPUT_ON_FAILURE=1 make test" to see output from failed tests
|
@ -0,0 +1,39 @@ |
|||||||
|
{ lib |
||||||
|
, buildPythonPackage |
||||||
|
, fetchFromGitHub |
||||||
|
, fzf |
||||||
|
, pythonOlder |
||||||
|
}: |
||||||
|
|
||||||
|
buildPythonPackage rec { |
||||||
|
pname = "pyfzf"; |
||||||
|
version = "0.3.1"; |
||||||
|
format = "setuptools"; |
||||||
|
|
||||||
|
disabled = pythonOlder "3.7"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
owner = "nk412"; |
||||||
|
repo = pname; |
||||||
|
rev = version; |
||||||
|
hash = "sha256-w+ZjQGFd/lR2TiTHc2uQSJXORmzJJZXsr9BO4PIw/Co="; |
||||||
|
}; |
||||||
|
|
||||||
|
propagatedBuildInputs = [ |
||||||
|
fzf |
||||||
|
]; |
||||||
|
|
||||||
|
pythonImportsCheck = [ |
||||||
|
"pyfzf" |
||||||
|
]; |
||||||
|
|
||||||
|
# Module has no tests |
||||||
|
doCheck = false; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "Wrapper for fzf"; |
||||||
|
homepage = "https://github.com/nk412/pyfzf"; |
||||||
|
license = licenses.mit; |
||||||
|
maintainers = with maintainers; [ fab ]; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
{ runCommandNoCC, cargo, neovim, rust-analyzer, rustc }: |
||||||
|
runCommandNoCC "test-neovim-rust-analyzer" { |
||||||
|
nativeBuildInputs = [ cargo neovim rust-analyzer rustc ]; |
||||||
|
|
||||||
|
testRustSrc = /* rust */ '' |
||||||
|
fn main() { |
||||||
|
let mut var = vec![None]; |
||||||
|
var.push(Some("hello".to_owned())); |
||||||
|
} |
||||||
|
''; |
||||||
|
|
||||||
|
nvimConfig = /* lua */ '' |
||||||
|
vim.lsp.buf_attach_client(vim.api.nvim_get_current_buf(), vim.lsp.start_client({ |
||||||
|
cmd = { "rust-analyzer" }, |
||||||
|
handlers = { |
||||||
|
["$/progress"] = function(_, msg, ctx) |
||||||
|
if msg.token == "rustAnalyzer/Indexing" and msg.value.kind == "end" then |
||||||
|
vim.cmd("goto 23") -- let mut |var =... |
||||||
|
vim.lsp.buf.hover() |
||||||
|
end |
||||||
|
end, |
||||||
|
["textDocument/hover"] = function(_, msg, ctx) |
||||||
|
-- Keep newlines. |
||||||
|
io.write(msg.contents.value) |
||||||
|
vim.cmd("q") |
||||||
|
end, |
||||||
|
}, |
||||||
|
on_error = function(code) |
||||||
|
print("error: " .. code) |
||||||
|
vim.cmd("q") |
||||||
|
end |
||||||
|
})) |
||||||
|
''; |
||||||
|
|
||||||
|
} '' |
||||||
|
# neovim requires a writable HOME. |
||||||
|
export HOME="$(pwd)" |
||||||
|
|
||||||
|
cargo new --bin test-rust-analyzer |
||||||
|
cd test-rust-analyzer |
||||||
|
cat <<<"$testRustSrc" >src/main.rs |
||||||
|
cat <<<"$nvimConfig" >script.lua |
||||||
|
|
||||||
|
# `-u` doesn't work |
||||||
|
result="$(nvim --headless +'lua dofile("script.lua")' src/main.rs)" |
||||||
|
echo "$result" |
||||||
|
[[ "$result" == *"var: Vec<Option<String>>"* ]] |
||||||
|
touch $out |
||||||
|
'' |
@ -0,0 +1,34 @@ |
|||||||
|
{ stdenv |
||||||
|
, lib |
||||||
|
, makeWrapper |
||||||
|
, fetchurl |
||||||
|
, numactl |
||||||
|
, python3 |
||||||
|
}: |
||||||
|
|
||||||
|
stdenv.mkDerivation rec { |
||||||
|
pname = "rt-tests"; |
||||||
|
version = "2.3"; |
||||||
|
|
||||||
|
src = fetchurl { |
||||||
|
url = "https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git/snapshot/${pname}-${version}.tar.gz"; |
||||||
|
sha256 = "Q+rNdpRdsmW2gcsrfwg12EzpvO6qlEP/Mb/OWQMNmr8="; |
||||||
|
}; |
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ]; |
||||||
|
buildInputs = [ numactl python3 ]; |
||||||
|
|
||||||
|
makeFlags = [ "prefix=$(out)" "DESTDIR=" "PYLIB=$(out)/${python3.sitePackages}" ]; |
||||||
|
|
||||||
|
postInstall = '' |
||||||
|
wrapProgram "$out/bin/determine_maximum_mpps.sh" --prefix PATH : $out/bin |
||||||
|
''; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
homepage = https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git; |
||||||
|
description = "Suite of real-time tests - cyclictest, hwlatdetect, pip_stress, pi_stress, pmqtest, ptsematest, rt-migrate-test, sendme, signaltest, sigwaittest, svsematest"; |
||||||
|
platforms = platforms.linux; |
||||||
|
maintainers = with maintainers; [ poelzi ]; |
||||||
|
license = licenses.gpl2; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
{ lib |
||||||
|
, buildGoModule |
||||||
|
, fetchgit |
||||||
|
, unstableGitUpdater |
||||||
|
}: |
||||||
|
|
||||||
|
buildGoModule { |
||||||
|
pname = "bloat"; |
||||||
|
version = "unstable-2022-03-31"; |
||||||
|
|
||||||
|
src = fetchgit { |
||||||
|
url = "git://git.freesoftwareextremist.com/bloat"; |
||||||
|
rev = "a38d29a43592601d37d671db8748f0980071c0c4"; |
||||||
|
sha256 = "sha256-7Hxt0QlOYMBMvDS40fpfSItGkd5nYFQmmjJIevNyeF8="; |
||||||
|
}; |
||||||
|
|
||||||
|
vendorSha256 = null; |
||||||
|
|
||||||
|
postInstall = '' |
||||||
|
mkdir -p $out/share/bloat |
||||||
|
cp -r templates $out/share/bloat/templates |
||||||
|
cp -r static $out/share/bloat/static |
||||||
|
sed \ |
||||||
|
-e "s%=templates%=$out/share/bloat/templates%g" \ |
||||||
|
-e "s%=static%=$out/share/bloat/static%g" \ |
||||||
|
< bloat.conf > $out/share/bloat/bloat.conf.example |
||||||
|
''; |
||||||
|
|
||||||
|
passthru.updateScript = unstableGitUpdater { }; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
description = "A web client for Pleroma and Mastodon"; |
||||||
|
longDescription = '' |
||||||
|
A lightweight web client for Pleroma and Mastodon. |
||||||
|
Does not require JavaScript to display text, images, audio and videos. |
||||||
|
''; |
||||||
|
homepage = "https://bloat.freesoftwareextremist.com"; |
||||||
|
downloadPage = "https://git.freesoftwareextremist.com/bloat/"; |
||||||
|
license = licenses.cc0; |
||||||
|
maintainers = with maintainers; [ fgaz ]; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: |
||||||
|
|
||||||
|
buildGoModule rec { |
||||||
|
pname = "badrobot"; |
||||||
|
version = "0.1.2"; |
||||||
|
|
||||||
|
src = fetchFromGitHub { |
||||||
|
owner = "controlplaneio"; |
||||||
|
repo = pname; |
||||||
|
rev = "v${version}"; |
||||||
|
sha256 = "sha256-LGoNM8wu1qaq4cVEzR723/cueZlndE1Z2PCYEOU+nPQ="; |
||||||
|
}; |
||||||
|
vendorSha256 = "sha256-FS4kFVi+3NOJOfWfy5m/hDrQvCzpmsNSB/PliF6cVps="; |
||||||
|
|
||||||
|
nativeBuildInputs = [ installShellFiles ]; |
||||||
|
|
||||||
|
ldflags = [ |
||||||
|
"-s" |
||||||
|
"-w" |
||||||
|
"-X github.com/controlplaneio/badrobot/cmd.version=v${version}" |
||||||
|
]; |
||||||
|
|
||||||
|
postInstall = '' |
||||||
|
installShellCompletion --cmd badrobot \ |
||||||
|
--bash <($out/bin/badrobot completion bash) \ |
||||||
|
--fish <($out/bin/badrobot completion fish) \ |
||||||
|
--zsh <($out/bin/badrobot completion zsh) |
||||||
|
''; |
||||||
|
|
||||||
|
meta = with lib; { |
||||||
|
homepage = "https://github.com/controlplaneio/badrobot"; |
||||||
|
changelog = "https://github.com/controlplaneio/badrobot/blob/v${version}/CHANGELOG.md"; |
||||||
|
description = "Operator Security Audit Tool"; |
||||||
|
longDescription = '' |
||||||
|
Badrobot is a Kubernetes Operator audit tool. It statically analyses |
||||||
|
manifests for high risk configurations such as lack of security |
||||||
|
restrictions on the deployed controller and the permissions of an |
||||||
|
associated clusterole. The risk analysis is primarily focussed on the |
||||||
|
likelihood that a compromised Operator would be able to obtain full |
||||||
|
cluster permissions. |
||||||
|
''; |
||||||
|
license = with licenses; [ asl20 ]; |
||||||
|
maintainers = with maintainers; [ jk ]; |
||||||
|
}; |
||||||
|
} |
Loading…
Reference in new issue