push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
{
lib,
cabextract,
fetchFromGitHub,
readline,
stdenv_32bit,
}:
# stdenv_32bit is needed because the program depends upon 32-bit libraries and does not have
# support for 64-bit yet: it requires libc6-dev:i386, libreadline-dev:i386.
stdenv_32bit.mkDerivation rec {
pname = "loadlibrary";
version = "20170525-${lib.strings.substring 0 7 rev}";
rev = "721b084c088d779075405b7f20c77c2578e2a961";
src = fetchFromGitHub {
inherit rev;
owner = "taviso";
repo = "loadlibrary";
sha256 = "01hb7wzfh1s5b8cvmrmr1gqknpq5zpzj9prq3wrpsgg129jpsjkb";
};
buildInputs = [
cabextract
readline
];
installPhase = ''
mkdir -p $out/bin/
cp mpclient $out/bin/
'';
meta = with lib; {
homepage = "https://github.com/taviso/loadlibrary";
description = "Porting Windows Dynamic Link Libraries to Linux";
platforms = platforms.linux;
maintainers = [ maintainers.eleanor ];
license = licenses.gpl2Plus;
mainProgram = "mpclient";
};
}

View File

@@ -0,0 +1,26 @@
{
lib,
stdenv,
fetchFromSourcehut,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "loadwatch";
version = "1.1-4-g868bd29";
src = fetchFromSourcehut {
owner = "~woffs";
repo = "loadwatch";
hash = "sha256-/4kfGdpYJWQyb7mRaVUpyQQC5VP96bDsBDfM3XhcJXw=";
rev = finalAttrs.version;
};
makeFlags = [ "bindir=$(out)/bin" ];
meta = {
description = "Run a program using only idle cycles";
license = lib.licenses.gpl2Only;
maintainers = with lib.maintainers; [ woffs ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
callPackage,
# Linux deps
libGL,
xorg,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lobster";
version = "2025.3";
src = fetchFromGitHub {
owner = "aardappel";
repo = "lobster";
rev = "v${finalAttrs.version}";
sha256 = "sha256-YGtjoRBGOqkcHaiZNPVFOoeLitJTG/M0I08EPZVCfj0=";
};
nativeBuildInputs = [ cmake ];
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [
libGL
xorg.libX11
xorg.libXext
];
preConfigure = ''
cd dev
'';
passthru.tests.can-run-hello-world = callPackage ./test-can-run-hello-world.nix { };
meta = with lib; {
broken = stdenv.hostPlatform.isDarwin;
homepage = "https://strlen.com/lobster/";
description = "Lobster programming language";
mainProgram = "lobster";
longDescription = ''
Lobster is a programming language that tries to combine the advantages of
very static typing and memory management with a very lightweight,
friendly and terse syntax, by doing most of the heavy lifting for you.
'';
license = licenses.asl20;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
};
})

View File

@@ -0,0 +1,12 @@
{ stdenv, lobster }:
stdenv.mkDerivation {
name = "lobster-test-can-run-hello-world";
meta.timeout = 10;
buildCommand = ''
${lobster}/bin/lobster \
${lobster}/share/Lobster/samples/rosettacode/hello_world_test.lobster \
| grep 'Goodbye, World!'
touch $out
'';
}

View File

@@ -0,0 +1,39 @@
{
lib,
writers,
writeText,
linkFarmFromDrvs,
}:
{
genModels =
configs:
let
name = lib.strings.sanitizeDerivationName (
builtins.concatStringsSep "_" ([ "local-ai-models" ] ++ (builtins.attrNames configs))
);
genModelFiles =
name: config:
let
templateName = type: name + "_" + type;
config' = lib.recursiveUpdate config (
{
inherit name;
}
// lib.optionalAttrs (lib.isDerivation config.parameters.model) {
parameters.model = config.parameters.model.name;
}
// lib.optionalAttrs (config ? template) {
template = builtins.mapAttrs (n: _: templateName n) config.template;
}
);
in
[ (writers.writeYAML "${name}.yaml" config') ]
++ lib.optional (lib.isDerivation config.parameters.model) config.parameters.model
++ lib.optionals (config ? template) (
lib.mapAttrsToList (n: writeText "${templateName n}.tmpl") config.template
);
in
linkFarmFromDrvs name (lib.flatten (lib.mapAttrsToList genModelFiles configs));
}

View File

@@ -0,0 +1,77 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.services.local-ai;
inherit (lib) mkOption types;
in
{
options.services.local-ai = {
enable = lib.mkEnableOption "Enable service";
package = lib.mkPackageOption pkgs "local-ai" { };
extraArgs = mkOption {
type = types.listOf types.str;
default = [ ];
};
port = mkOption {
type = types.port;
default = 8080;
};
threads = mkOption {
type = types.int;
default = 1;
};
models = mkOption {
type = types.either types.package types.str;
default = "models";
};
parallelRequests = mkOption {
type = types.int;
default = 1;
};
logLevel = mkOption {
type = types.enum [
"error"
"warn"
"info"
"debug"
"trace"
];
default = "warn";
};
};
config = lib.mkIf cfg.enable {
systemd.services.local-ai = {
wantedBy = [ "multi-user.target" ];
environment.LLAMACPP_PARALLEL = toString cfg.parallelRequests;
serviceConfig = {
DynamicUser = true;
ExecStart = lib.escapeShellArgs (
[
"${cfg.package}/bin/local-ai"
"--address=:${toString cfg.port}"
"--threads=${toString cfg.threads}"
"--localai-config-dir=."
"--models-path=${cfg.models}"
"--log-level=${cfg.logLevel}"
]
++ lib.optional (cfg.parallelRequests > 1) "--parallel-requests"
++ cfg.extraArgs
);
RuntimeDirectory = "local-ai";
WorkingDirectory = "%t/local-ai";
};
};
};
}

View File

@@ -0,0 +1,547 @@
{
config,
callPackages,
stdenv,
lib,
addDriverRunpath,
fetchFromGitHub,
protobuf,
protoc-gen-go,
protoc-gen-go-grpc,
grpc,
openssl,
llama-cpp,
# needed for audio-to-text
ffmpeg,
cmake,
pkg-config,
buildGoModule,
makeWrapper,
ncurses,
which,
opencv,
curl,
enable_upx ? true,
upx,
# apply feature parameter names according to
# https://github.com/NixOS/rfcs/pull/169
# CPU extensions
enable_avx ? stdenv.hostPlatform.isx86_64,
enable_avx2 ? stdenv.hostPlatform.isx86_64,
enable_avx512 ? stdenv.hostPlatform.avx512Support,
enable_f16c ? stdenv.hostPlatform.isx86_64,
enable_fma ? stdenv.hostPlatform.isx86_64,
with_openblas ? false,
openblas,
with_cublas ? config.cudaSupport,
cudaPackages,
with_clblas ? false,
clblast,
ocl-icd,
opencl-headers,
with_vulkan ? false,
with_tts ? true,
onnxruntime,
sonic,
spdlog,
fmt,
espeak-ng,
piper-tts,
}:
let
BUILD_TYPE =
assert
(lib.count lib.id [
with_openblas
with_cublas
with_clblas
with_vulkan
]) <= 1;
if with_openblas then
"openblas"
else if with_cublas then
"cublas"
else if with_clblas then
"clblas"
else
"";
inherit (cudaPackages)
libcublas
cuda_nvcc
cuda_cccl
cuda_cudart
libcufft
;
llama-cpp-rpc =
(llama-cpp-grpc.overrideAttrs (prev: {
name = "llama-cpp-rpc";
cmakeFlags = prev.cmakeFlags ++ [
(lib.cmakeBool "GGML_AVX" false)
(lib.cmakeBool "GGML_AVX2" false)
(lib.cmakeBool "GGML_AVX512" false)
(lib.cmakeBool "GGML_FMA" false)
(lib.cmakeBool "GGML_F16C" false)
];
})).override
{
cudaSupport = false;
openclSupport = false;
blasSupport = false;
rpcSupport = true;
vulkanSupport = false;
};
llama-cpp-grpc =
(llama-cpp.overrideAttrs (
final: prev: {
name = "llama-cpp-grpc";
src = fetchFromGitHub {
owner = "ggerganov";
repo = "llama.cpp";
rev = "d6d2c2ab8c8865784ba9fef37f2b2de3f2134d33";
hash = "sha256-b9B5I3EbBFrkWc6RLXMWcCRKayyWjlGuQrogUcrISrc=";
fetchSubmodules = true;
};
postPatch = prev.postPatch + ''
cd examples
cp -r --no-preserve=mode ${src}/backend/cpp/llama grpc-server
cp llava/clip* llava/llava.* grpc-server
printf "\nadd_subdirectory(grpc-server)" >> CMakeLists.txt
cp ${src}/backend/backend.proto grpc-server
sed -i grpc-server/CMakeLists.txt \
-e '/get_filename_component/ s;[.\/]*backend/;;' \
-e '$a\install(TARGETS ''${TARGET} RUNTIME)'
cd ..
'';
cmakeFlags = prev.cmakeFlags ++ [
(lib.cmakeBool "BUILD_SHARED_LIBS" false)
(lib.cmakeBool "GGML_AVX" enable_avx)
(lib.cmakeBool "GGML_AVX2" enable_avx2)
(lib.cmakeBool "GGML_AVX512" enable_avx512)
(lib.cmakeBool "GGML_FMA" enable_fma)
(lib.cmakeBool "GGML_F16C" enable_f16c)
];
buildInputs = prev.buildInputs ++ [
protobuf # provides also abseil_cpp as propagated build input
grpc
openssl
curl
];
}
)).override
{
cudaSupport = with_cublas;
rocmSupport = false;
openclSupport = with_clblas;
blasSupport = with_openblas;
vulkanSupport = with_vulkan;
};
espeak-ng' = espeak-ng.overrideAttrs (self: {
name = "espeak-ng'";
inherit (go-piper) src;
sourceRoot = "${go-piper.src.name}/espeak";
patches = [ ];
nativeBuildInputs = [ cmake ];
cmakeFlags = (self.cmakeFlags or [ ]) ++ [
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
(lib.cmakeBool "USE_ASYNC" false)
(lib.cmakeBool "USE_MBROLA" false)
(lib.cmakeBool "USE_LIBPCAUDIO" false)
(lib.cmakeBool "USE_KLATT" false)
(lib.cmakeBool "USE_SPEECHPLAYER" false)
(lib.cmakeBool "USE_LIBSONIC" false)
(lib.cmakeBool "CMAKE_POSITION_INDEPENDENT_CODE" true)
];
preConfigure = null;
postInstall = null;
});
piper-phonemize = stdenv.mkDerivation {
name = "piper-phonemize";
inherit (go-piper) src;
sourceRoot = "${go-piper.src.name}/piper-phonemize";
buildInputs = [
espeak-ng'
onnxruntime
];
nativeBuildInputs = [
cmake
pkg-config
];
cmakeFlags = [
(lib.cmakeFeature "ONNXRUNTIME_DIR" "${onnxruntime.dev}")
(lib.cmakeFeature "ESPEAK_NG_DIR" "${espeak-ng'}")
];
passthru.espeak-ng = espeak-ng';
};
piper-tts' = piper-tts.overrideAttrs (self: {
name = "piper-tts'";
inherit (go-piper) src;
sourceRoot = "${go-piper.src.name}/piper";
installPhase = null;
postInstall = ''
cp CMakeFiles/piper.dir/src/cpp/piper.cpp.o $out/piper.o
cd $out
mkdir bin lib
mv lib*so* lib/
mv piper piper_phonemize bin/
rm -rf cmake pkgconfig espeak-ng-data *.ort
'';
});
go-piper = stdenv.mkDerivation {
name = "go-piper";
src = fetchFromGitHub {
owner = "mudler";
repo = "go-piper";
rev = "e10ca041a885d4a8f3871d52924b47792d5e5aa0";
hash = "sha256-Yv9LQkWwGpYdOS0FvtP0vZ0tRyBAx27sdmziBR4U4n8=";
fetchSubmodules = true;
};
postUnpack = ''
cp -r --no-preserve=mode ${piper-tts'}/* source
'';
postPatch = ''
sed -i Makefile \
-e '/CXXFLAGS *= / s;$; -DSPDLOG_FMT_EXTERNAL=1;'
'';
buildFlags = [ "libpiper_binding.a" ];
buildInputs = [
piper-tts'
espeak-ng'
piper-phonemize
sonic
fmt
spdlog
onnxruntime
];
installPhase = ''
cp -r --no-preserve=mode $src $out
mkdir -p $out/piper-phonemize/pi
cp -r --no-preserve=mode ${piper-phonemize}/share $out/piper-phonemize/pi
cp *.a $out
'';
};
# try to merge with openai-whisper-cpp in future
whisper-cpp = effectiveStdenv.mkDerivation {
name = "whisper-cpp";
src = fetchFromGitHub {
owner = "ggerganov";
repo = "whisper.cpp";
rev = "6266a9f9e56a5b925e9892acf650f3eb1245814d";
hash = "sha256-y30ZccpF3SCdRGa+P3ddF1tT1KnvlI4Fexx81wZxfTk=";
};
nativeBuildInputs = [
cmake
pkg-config
]
++ lib.optionals with_cublas [ cuda_nvcc ];
buildInputs =
[ ]
++ lib.optionals with_cublas [
cuda_cccl
cuda_cudart
libcublas
libcufft
]
++ lib.optionals with_clblas [
clblast
ocl-icd
opencl-headers
]
++ lib.optionals with_openblas [ openblas.dev ];
cmakeFlags = [
(lib.cmakeBool "WHISPER_CUDA" with_cublas)
(lib.cmakeBool "WHISPER_CLBLAST" with_clblas)
(lib.cmakeBool "WHISPER_OPENBLAS" with_openblas)
(lib.cmakeBool "WHISPER_NO_AVX" (!enable_avx))
(lib.cmakeBool "WHISPER_NO_AVX2" (!enable_avx2))
(lib.cmakeBool "WHISPER_NO_FMA" (!enable_fma))
(lib.cmakeBool "WHISPER_NO_F16C" (!enable_f16c))
(lib.cmakeBool "BUILD_SHARED_LIBS" false)
];
postInstall = ''
install -Dt $out/bin bin/*
'';
};
bark = stdenv.mkDerivation {
name = "bark";
src = fetchFromGitHub {
owner = "PABannier";
repo = "bark.cpp";
tag = "v1.0.0";
hash = "sha256-wOcggRWe8lsUzEj/wqOAUlJVypgNFmit5ISs9fbwoCE=";
fetchSubmodules = true;
};
installPhase = ''
mkdir -p $out/build
cp -ra $src/* $out
find . \( -name '*.a' -or -name '*.c.o' \) -print0 \
| tar cf - --null --files-from - \
| tar xf - -C $out/build
'';
nativeBuildInputs = [ cmake ];
};
stable-diffusion = stdenv.mkDerivation {
name = "stable-diffusion";
src = fetchFromGitHub {
owner = "richiejp";
repo = "stable-diffusion.cpp";
rev = "53e3b17eb3d0b5760ced06a1f98320b68b34aaae"; # branch cuda-fix
hash = "sha256-z56jafOdibpX+XhRsrc7ieGbeug4bf737/UobqkpBV0=";
fetchSubmodules = true;
};
installPhase = ''
mkdir -p $out/build
cp -ra $src/* $out
find . \( -name '*.a' -or -name '*.c.o' \) -print0 \
| tar cf - --null --files-from - \
| tar xf - -C $out/build
'';
cmakeFlags = [
(lib.cmakeFeature "GGML_BUILD_NUMBER" "1")
];
nativeBuildInputs = [ cmake ];
buildInputs = [ opencv ];
};
GO_TAGS = lib.optional with_tts "tts";
effectiveStdenv =
if with_cublas then
# It's necessary to consistently use backendStdenv when building with CUDA support,
# otherwise we get libstdc++ errors downstream.
cudaPackages.backendStdenv
else
stdenv;
pname = "local-ai";
version = "2.28.0";
src = fetchFromGitHub {
owner = "go-skynet";
repo = "LocalAI";
tag = "v${version}";
hash = "sha256-Hpz0dGkgasSY/FGO7mDzqsLjXut0LdQ9PUXGaURUOlY=";
};
prepare-sources =
let
cp = "cp -r --no-preserve=mode,ownership";
in
''
mkdir sources
${cp} ${if with_tts then go-piper else go-piper.src} sources/go-piper
${cp} ${whisper-cpp.src} sources/whisper.cpp
cp ${whisper-cpp}/lib/lib*.a sources/whisper.cpp
${cp} ${bark} sources/bark.cpp
${cp} ${stable-diffusion} sources/stablediffusion-ggml.cpp
'';
self = buildGoModule.override { stdenv = effectiveStdenv; } {
inherit pname version src;
vendorHash = "sha256-1OY/y1AeL0K+vOU4Jk/cj7rToVLC9EkkNhgifB+icDM=";
env.NIX_CFLAGS_COMPILE = " -isystem ${opencv}/include/opencv4";
postPatch = ''
# TODO: add silero-vad
sed -i Makefile \
-e '/mod download/ d' \
-e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-avx/ d' \
-e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/llama-cpp-cuda/ d' \
-e '/^ALL_GRPC_BACKENDS+=backend-assets\/grpc\/silero-vad/ d' \
sed -i backend/go/image/stablediffusion-ggml/Makefile \
-e '/^libsd/ s,$, $(COMBINED_LIB),'
''
+ lib.optionalString with_cublas ''
sed -i Makefile \
-e '/^CGO_LDFLAGS_WHISPER?=/ s;$;-L${libcufft}/lib -L${cuda_cudart}/lib;'
'';
postConfigure = prepare-sources + ''
shopt -s extglob
mkdir -p backend-assets/grpc
cp ${llama-cpp-grpc}/bin/grpc-server backend-assets/grpc/llama-cpp-fallback
cp ${llama-cpp-rpc}/bin/grpc-server backend-assets/grpc/llama-cpp-grpc
mkdir -p backend/cpp/llama/llama.cpp
mkdir -p backend-assets/util
cp ${llama-cpp-rpc}/bin/llama-rpc-server backend-assets/util/llama-cpp-rpc-server
cp -r --no-preserve=mode,ownership ${stable-diffusion}/build backend/go/image/stablediffusion-ggml/build
# avoid rebuild of prebuilt make targets
touch backend-assets/grpc/* backend-assets/util/*
find sources -name "lib*.a" -exec touch {} +
'';
buildInputs =
[ ]
++ lib.optionals with_cublas [
cuda_cudart
libcublas
libcufft
]
++ lib.optionals with_clblas [
clblast
ocl-icd
opencl-headers
]
++ lib.optionals with_openblas [ openblas.dev ]
++ lib.optionals with_tts go-piper.buildInputs;
nativeBuildInputs = [
protobuf
protoc-gen-go
protoc-gen-go-grpc
makeWrapper
ncurses # tput
which
]
++ lib.optional enable_upx upx
++ lib.optionals with_cublas [ cuda_nvcc ];
enableParallelBuilding = false;
modBuildPhase = prepare-sources + ''
make protogen-go
go mod tidy -v
'';
proxyVendor = true;
# should be passed as makeFlags, but build system failes with strings
# containing spaces
env.GO_TAGS = builtins.concatStringsSep " " GO_TAGS;
makeFlags = [
"VERSION=v${version}"
"BUILD_TYPE=${BUILD_TYPE}"
]
++ lib.optional with_cublas "CUDA_LIBPATH=${cuda_cudart}/lib"
++ lib.optional with_tts "PIPER_CGO_CXXFLAGS=-DSPDLOG_FMT_EXTERNAL=1";
buildPhase = ''
runHook preBuild
local flagsArray=(
''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}}
SHELL=$SHELL
)
# copy from Makefile:258
make -C backend/go/image/stablediffusion-ggml libsd.a
concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray
echoCmd 'build flags' "''${flagsArray[@]}"
make build "''${flagsArray[@]}"
unset flagsArray
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dt $out/bin ${pname}
runHook postInstall
'';
# patching rpath with patchelf doens't work. The executable
# raises an segmentation fault
postFixup =
let
LD_LIBRARY_PATH =
[ ]
++ lib.optionals with_cublas [
# driverLink has to be first to avoid loading the stub version of libcuda.so
# https://github.com/NixOS/nixpkgs/issues/320145#issuecomment-2190319327
addDriverRunpath.driverLink
(lib.getLib libcublas)
cuda_cudart
]
++ lib.optionals with_clblas [
clblast
ocl-icd
]
++ lib.optionals with_openblas [ openblas ]
++ lib.optionals with_tts [ piper-phonemize ]
++ lib.optionals (with_tts && enable_upx) [
fmt
spdlog
];
in
''
wrapProgram $out/bin/${pname} \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath LD_LIBRARY_PATH}" \
--prefix PATH : "${ffmpeg}/bin"
'';
passthru.local-packages = {
inherit
go-piper
llama-cpp-grpc
whisper-cpp
espeak-ng'
piper-phonemize
piper-tts'
llama-cpp-rpc
bark
stable-diffusion
;
};
passthru.features = {
inherit
with_cublas
with_openblas
with_vulkan
with_tts
with_clblas
;
};
passthru.tests = callPackages ./tests.nix { inherit self; };
passthru.lib = callPackages ./lib.nix { };
meta = with lib; {
description = "OpenAI alternative to run local LLMs, image and audio generation";
mainProgram = "local-ai";
homepage = "https://localai.io";
license = licenses.mit;
maintainers = with maintainers; [
onny
ck3d
];
platforms = platforms.linux;
# Doesn't build with >buildGo123Module.
# 'cp: cannot stat 'bin/rpc-server': No such file or directory'
broken = true;
};
};
in
self

View File

@@ -0,0 +1,302 @@
{
self,
lib,
testers,
fetchzip,
fetchurl,
writers,
symlinkJoin,
jq,
prom2json,
}:
let
common-config =
{ config, ... }:
{
imports = [ ./module.nix ];
services.local-ai = {
enable = true;
package = self;
threads = config.virtualisation.cores;
logLevel = "debug";
};
};
inherit (self.lib) genModels;
in
{
version = testers.testVersion {
package = self;
version = "v" + self.version;
command = "local-ai --help";
};
health = testers.runNixOSTest {
name = self.name + "-health";
nodes.machine = {
imports = [ common-config ];
virtualisation.memorySize = 2048;
};
testScript =
let
port = "8080";
in
''
machine.wait_for_open_port(${port})
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("curl -f http://localhost:${port}/v1/models --output models.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
# check if following issue is still valid
# https://github.com/mudler/LocalAI/issues/2207
machine.succeed("${jq}/bin/jq --exit-status '.[] | select(.name == \"api_call\").metrics | debug | any(.labels.path == \"/metricsls\" and .count == \"1\")' metrics.json")
machine.copy_from_vm("metrics.json")
'';
};
}
//
lib.optionalAttrs
(!self.features.with_cublas && !self.features.with_clblas && !self.features.with_vulkan)
{
# https://localai.io/features/embeddings/#llamacpp-embeddings
llamacpp-embeddings =
let
model = "embedding";
model-configs.${model} = {
parameters.model = fetchurl {
url = "https://huggingface.co/hugging-quants/Llama-3.2-1B-Instruct-Q4_K_M-GGUF/resolve/main/llama-3.2-1b-instruct-q4_k_m.gguf";
sha256 = "1d0e9419ec4e12aef73ccf4ffd122703e94c48344a96bc7c5f0f2772c2152ce3";
};
backend = "llama-cpp";
embeddings = true;
};
models = genModels model-configs;
requests.request = {
inherit model;
input = "Your text string goes here";
};
in
testers.runNixOSTest {
name = self.name + "-llamacpp-embeddings";
nodes.machine = {
imports = [ common-config ];
virtualisation.cores = 2;
virtualisation.memorySize = 3 * 4096;
services.local-ai.models = models;
};
passthru = {
inherit models requests;
};
testScript =
let
port = "8080";
in
''
machine.wait_for_open_port(${port})
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("curl -f http://localhost:${port}/v1/models --output models.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .data[].id == \"${model}\"' models.json")
machine.succeed("curl -f http://localhost:${port}/embeddings --json @${writers.writeJSON "request.json" requests.request} --output embeddings.json")
machine.copy_from_vm("embeddings.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .model == \"${model}\"' embeddings.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
};
# https://localai.io/docs/getting-started/manual/
llama =
let
model = "gpt-3.5-turbo";
# https://localai.io/advanced/#full-config-model-file-reference
model-configs.${model} = rec {
context_size = 16 * 1024; # 128kb is possible, but needs 16GB RAM
backend = "llama-cpp";
parameters = {
# https://ai.meta.com/blog/meta-llama-3-1/
model = fetchurl {
url = "https://huggingface.co/lmstudio-community/Meta-Llama-3.1-8B-Instruct-GGUF/resolve/main/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf";
sha256 = "f2be3e1a239c12c9f3f01a962b11fb2807f8032fdb63b0a5502ea42ddef55e44";
};
# defaults from:
# https://deepinfra.com/meta-llama/Meta-Llama-3.1-8B-Instruct
temperature = 0.7;
top_p = 0.9;
top_k = 0;
# following parameter leads to outputs like: !!!!!!!!!!!!!!!!!!!
#repeat_penalty = 1;
presence_penalty = 0;
frequency_penalty = 0;
max_tokens = 100;
};
stopwords = [ "<|eot_id|>" ];
template = {
# Templates implement following specifications
# https://github.com/meta-llama/llama3/tree/main?tab=readme-ov-file#instruction-tuned-models
# ... and are insprired by:
# https://github.com/mudler/LocalAI/blob/master/embedded/models/llama3-instruct.yaml
#
# The rules for template evaluateion are defined here:
# https://pkg.go.dev/text/template
chat_message = ''
<|start_header_id|>{{.RoleName}}<|end_header_id|>
{{.Content}}${builtins.head stopwords}'';
chat = "{{.Input}}<|start_header_id|>assistant<|end_header_id|>";
completion = "{{.Input}}";
};
};
models = genModels model-configs;
requests = {
# https://localai.io/features/text-generation/#chat-completions
chat-completions = {
inherit model;
messages = [
{
role = "user";
content = "1 + 2 = ?";
}
];
};
# https://localai.io/features/text-generation/#edit-completions
edit-completions = {
inherit model;
instruction = "rephrase";
input = "Black cat jumped out of the window";
max_tokens = 50;
};
# https://localai.io/features/text-generation/#completions
completions = {
inherit model;
prompt = "A long time ago in a galaxy far, far away";
};
};
in
testers.runNixOSTest {
name = self.name + "-llama";
nodes.machine = {
imports = [ common-config ];
virtualisation.cores = 4;
virtualisation.memorySize = 8192;
services.local-ai.models = models;
# TODO: Add test case parallel requests
services.local-ai.parallelRequests = 2;
};
passthru = {
inherit models requests;
};
testScript =
let
port = "8080";
in
''
machine.wait_for_open_port(${port})
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("curl -f http://localhost:${port}/v1/models --output models.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .data[].id == \"${model}\"' models.json")
machine.succeed("curl -f http://localhost:${port}/v1/chat/completions --json @${writers.writeJSON "request-chat-completions.json" requests.chat-completions} --output chat-completions.json")
machine.copy_from_vm("chat-completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .object == \"chat.completion\"' chat-completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .choices | first.message.content | split(\" \") | last | tonumber == 3' chat-completions.json")
machine.succeed("curl -f http://localhost:${port}/v1/edits --json @${writers.writeJSON "request-edit-completions.json" requests.edit-completions} --output edit-completions.json")
machine.copy_from_vm("edit-completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .object == \"edit\"' edit-completions.json")
machine.succeed("${jq}/bin/jq --exit-status '.usage.completion_tokens | debug == ${toString requests.edit-completions.max_tokens}' edit-completions.json")
machine.succeed("curl -f http://localhost:${port}/v1/completions --json @${writers.writeJSON "request-completions.json" requests.completions} --output completions.json")
machine.copy_from_vm("completions.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .object ==\"text_completion\"' completions.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
};
}
//
lib.optionalAttrs
(self.features.with_tts && !self.features.with_cublas && !self.features.with_clblas)
{
# https://localai.io/features/text-to-audio/#piper
tts =
let
model-stt = "whisper-en";
model-configs.${model-stt} = {
backend = "whisper";
parameters.model = fetchurl {
url = "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.en-q5_1.bin";
hash = "sha256-x3xXZvHO8JtrfUfyG1Rsvd1BV4hrO11tT3CekeZsfCs=";
};
};
model-tts = "piper-en";
model-configs.${model-tts} = {
backend = "piper";
parameters.model = "en-us-danny-low.onnx";
};
models =
let
models = genModels model-configs;
in
symlinkJoin {
inherit (models) name;
paths = [
models
(fetchzip {
url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-danny-low.tar.gz";
hash = "sha256-5wf+6H5HeQY0qgdqnAG1vSqtjIFM9lXH53OgouuPm0M=";
stripRoot = false;
})
];
};
requests.request = {
model = model-tts;
input = "Hello, how are you?";
};
in
testers.runNixOSTest {
name = self.name + "-tts";
nodes.machine = {
imports = [ common-config ];
virtualisation.cores = 2;
services.local-ai.models = models;
};
passthru = {
inherit models requests;
};
testScript =
let
port = "8080";
in
''
machine.wait_for_open_port(${port})
machine.succeed("curl -f http://localhost:${port}/readyz")
machine.succeed("curl -f http://localhost:${port}/v1/models --output models.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug' models.json")
machine.succeed("curl -f http://localhost:${port}/tts --json @${writers.writeJSON "request.json" requests.request} --output out.wav")
machine.copy_from_vm("out.wav")
machine.succeed("curl -f http://localhost:${port}/v1/audio/transcriptions --header 'Content-Type: multipart/form-data' --form file=@out.wav --form model=${model-stt} --output transcription.json")
machine.copy_from_vm("transcription.json")
machine.succeed("${jq}/bin/jq --exit-status 'debug | .segments | first.text == \"${requests.request.input}\"' transcription.json")
machine.succeed("${prom2json}/bin/prom2json http://localhost:${port}/metrics > metrics.json")
machine.copy_from_vm("metrics.json")
'';
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule (finalAttrs: {
pname = "local-content-share";
version = "35";
src = fetchFromGitHub {
owner = "Tanq16";
repo = "local-content-share";
tag = "v${finalAttrs.version}";
hash = "sha256-pFYkq1QqGugOVT0uMPC11ChXtxMwGv4JZKGWIqK7y3s=";
};
vendorHash = null;
# no test file in upstream
doCheck = false;
meta = {
description = "Storing/sharing text/files in your local network with no setup on client devices";
homepage = "https://github.com/Tanq16/local-content-share";
license = lib.licenses.mit;
mainProgram = "local-content-share";
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ e-v-o-l-v-e ];
};
})

View File

@@ -0,0 +1,67 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
openssl,
protobuf_21,
catch2,
boost,
icu,
}:
let
boost' = boost.override { enableStatic = true; };
protobuf = protobuf_21.override { enableShared = false; };
in
stdenv.mkDerivation (finalAttrs: {
pname = "localproxy";
version = "3.1.2";
src = fetchFromGitHub {
owner = "aws-samples";
repo = "aws-iot-securetunneling-localproxy";
rev = "v${finalAttrs.version}";
hash = "sha256-bIJLGJhSzBVqJaTWJj4Pmw/shA4Y0CzX4HhHtQZjfj0=";
};
patches = [
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/aws-samples/aws-iot-securetunneling-localproxy/commit/de8779630d14e4f4969c9b171d826acfa847822b.patch";
hash = "sha256-11k6mRvCx72+5G/5LZZx2qnx10yfKpcAZofn8t8BD3E=";
})
(fetchpatch {
name = "boost187.patch";
url = "https://github.com/aws-samples/aws-iot-securetunneling-localproxy/commit/12022770e89c6787c3eda4ca01a7cedaf2affa92.patch";
hash = "sha256-THY+dRkKhpbpK+wLskRjWvqr6uFuT0JMt/VHvgzKTzw=";
excludes = [ ".github/workflows/ci.yml" ];
})
];
nativeBuildInputs = [ cmake ];
buildInputs = [
openssl
protobuf
catch2
boost'
icu
];
postPatch = ''
sed -i '/set(OPENSSL_USE_STATIC_LIBS TRUE)/d' CMakeLists.txt
'';
# causes redefinition of _FORTIFY_SOURCE
hardeningDisable = [ "fortify3" ];
meta = with lib; {
description = "AWS IoT Secure Tunneling Local Proxy Reference Implementation C++";
homepage = "https://github.com/aws-samples/aws-iot-securetunneling-localproxy";
license = licenses.asl20;
maintainers = with maintainers; [ spalf ];
platforms = platforms.unix;
mainProgram = "localproxy";
};
})

View File

@@ -0,0 +1,144 @@
{
stdenv,
lib,
fetchurl,
asciidoc,
docbook-xsl-nons,
docbook_xml_dtd_45,
gettext,
itstool,
libxslt,
gexiv2,
tinysparql,
meson,
mesonEmulatorHook,
ninja,
pkg-config,
vala,
wrapGAppsNoGuiHook,
bzip2,
dbus,
exempi,
ffmpeg,
giflib,
glib,
gobject-introspection,
gnome,
icu,
json-glib,
libcue,
libexif,
libgsf,
libgudev,
libgxps,
libiptcdata,
libjpeg,
libosinfo,
libpng,
libseccomp,
libtiff,
libuuid,
libxml2,
poppler,
systemd,
taglib,
upower,
totem-pl-parser,
e2fsprogs,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "localsearch";
version = "3.9.0";
src = fetchurl {
url = "mirror://gnome/sources/localsearch/${lib.versions.majorMinor finalAttrs.version}/localsearch-${finalAttrs.version}.tar.xz";
hash = "sha256-1C9AjcP7KP5U9amrv18d7PWBjbnC6exRwJRkvf0MFLk=";
};
patches = [
./tracker-landlock-nix-store-permission.patch
];
nativeBuildInputs = [
asciidoc
docbook-xsl-nons
docbook_xml_dtd_45
gettext
glib
gobject-introspection
itstool
libxslt
meson
ninja
pkg-config
vala
wrapGAppsNoGuiHook
]
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
# TODO: add libenca, libosinfo
buildInputs = [
bzip2
dbus
exempi
ffmpeg
giflib
gexiv2
totem-pl-parser
tinysparql
icu
json-glib
libcue
libexif
libgsf
libgudev
libgxps
libiptcdata
libjpeg
libosinfo
libpng
libtiff
libuuid
libxml2
poppler
taglib
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libseccomp
systemd
upower
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
e2fsprogs
];
mesonFlags = [
# TODO: tests do not like our sandbox
"-Dfunctional_tests=false"
]
++ lib.optionals (!stdenv.hostPlatform.isLinux) [
"-Dbattery_detection=none"
"-Dnetwork_manager=disabled"
"-Dsystemd_user_services=false"
];
postInstall = ''
glib-compile-schemas "$out/share/glib-2.0/schemas"
'';
passthru = {
updateScript = gnome.updateScript { packageName = "localsearch"; };
};
meta = {
homepage = "https://gitlab.gnome.org/GNOME/localsearch";
description = "Desktop-neutral user information store, search tool and indexer";
teams = [ lib.teams.gnome ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
mainProgram = "localsearch";
};
})

View File

@@ -0,0 +1,15 @@
diff --git a/src/common/tracker-landlock.c b/src/common/tracker-landlock.c
index f26791d73..f03e8ddb9 100644
--- a/src/common/tracker-landlock.c
+++ b/src/common/tracker-landlock.c
@@ -185,6 +185,10 @@ gboolean
tracker_landlock_init (const gchar * const *indexed_folders)
{
TrackerLandlockRule stock_rules[] = {
+ { "/nix/store",
+ (LANDLOCK_ACCESS_FS_EXECUTE |
+ LANDLOCK_ACCESS_FS_READ_FILE |
+ LANDLOCK_ACCESS_FS_READ_DIR) },
/* Allow access to the executable itself */
{ LIBEXECDIR "/localsearch-extractor-3",
LANDLOCK_ACCESS_FS_READ_FILE |

View File

@@ -0,0 +1,139 @@
{
lib,
stdenv,
fetchurl,
fetchFromGitHub,
flutter327,
makeDesktopItem,
copyDesktopItems,
nixosTests,
libayatana-appindicator,
undmg,
makeBinaryWrapper,
}:
let
pname = "localsend";
version = "1.17.0";
linux = flutter327.buildFlutterApplication rec {
inherit pname version;
src = fetchFromGitHub {
owner = "localsend";
repo = "localsend";
tag = "v${version}";
hash = "sha256-1xMzlIcGEJ58laSM48bCKMxzHQ36eUHD5Mac0O1dnXk=";
};
sourceRoot = "${src.name}/app";
pubspecLock = lib.importJSON ./pubspec.lock.json;
gitHashes = {
permission_handler_windows = "sha256-+TP3neqlQRZnW6BxHaXr2EbmdITIx1Yo7AEn5iwAhwM=";
pasteboard = "sha256-lJA5OWoAHfxORqWMglKzhsL1IFr9YcdAQP/NVOLYB4o=";
};
postPatch = ''
substituteInPlace lib/util/native/autostart_helper.dart \
--replace-fail 'Exec=''${Platform.resolvedExecutable}' "Exec=localsend_app"
'';
nativeBuildInputs = [
copyDesktopItems
];
buildInputs = [ libayatana-appindicator ];
postInstall = ''
for s in 32 128 256 512; do
d=$out/share/icons/hicolor/''${s}x''${s}/apps
mkdir -p $d
cp ./assets/img/logo-''${s}.png $d/localsend.png
done
'';
extraWrapProgramArgs = ''
--prefix LD_LIBRARY_PATH : $out/app/localsend/lib
'';
desktopItems = [
(makeDesktopItem {
name = "LocalSend";
exec = "localsend_app %U";
icon = "localsend";
desktopName = "LocalSend";
startupWMClass = "localsend_app";
genericName = "An open source cross-platform alternative to AirDrop";
categories = [
"GTK"
"FileTransfer"
"Utility"
];
keywords = [
"Sharing"
"LAN"
"Files"
];
startupNotify = true;
})
];
passthru = {
updateScript = ./update.sh;
tests.localsend = nixosTests.localsend;
};
meta = metaCommon // {
mainProgram = "localsend_app";
};
};
darwin = stdenv.mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/localsend/localsend/releases/download/v${version}/LocalSend-${version}.dmg";
hash = "sha256-/fGkLuE+uf3WrpTcWIOYHooJWZ51i94j9uZ3xPq1yTw=";
};
nativeBuildInputs = [
undmg
makeBinaryWrapper
];
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/Applications
cp -r LocalSend.app $out/Applications
makeBinaryWrapper $out/Applications/LocalSend.app/Contents/MacOS/LocalSend $out/bin/localsend
runHook postInstall
'';
meta = metaCommon // {
mainProgram = "localsend";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [
"x86_64-darwin"
"aarch64-darwin"
];
};
};
metaCommon = {
description = "Open source cross-platform alternative to AirDrop";
homepage = "https://localsend.org/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
sikmir
linsui
pandapip1
];
};
in
if stdenv.hostPlatform.isDarwin then darwin else linux

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
#! /usr/bin/env nix-shell
#! nix-shell -I nixpkgs=./. -i bash -p curl gnused jq yq nix
set -eou pipefail
ROOT="$(dirname "$(readlink -f "$0")")"
latestVersion=$(curl --fail --silent https://api.github.com/repos/localsend/localsend/releases/latest | jq --raw-output .tag_name | sed 's/^v//')
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; localsend.version or (lib.getVersion localsend)" | tr -d '"')
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "package is up-to-date: $currentVersion"
exit 0
fi
sed -i "s/version = \".*\"/version = \"${latestVersion}\"/" "$ROOT/package.nix"
DARWIN_x64_URL="https://github.com/localsend/localsend/releases/download/v${latestVersion}/LocalSend-${latestVersion}.dmg"
DARWIN_X64_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url ${DARWIN_x64_URL}))
sed -i "/darwin/,/hash/{s|hash = \".*\"|hash = \"${DARWIN_X64_SHA}\"|}" "$ROOT/package.nix"
GIT_SRC_URL="https://github.com/localsend/localsend/archive/refs/tags/v${latestVersion}.tar.gz"
GIT_SRC_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url --unpack ${GIT_SRC_URL}))
sed -i "/linux/,/hash/{s|hash = \".*\"|hash = \"${GIT_SRC_SHA}\"|}" "$ROOT/package.nix"
curl https://raw.githubusercontent.com/localsend/localsend/v${latestVersion}/app/pubspec.lock | yq . > $ROOT/pubspec.lock.json

View File

@@ -0,0 +1,75 @@
{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication rec {
pname = "localstack";
version = "4.9.1";
pyproject = true;
src = fetchFromGitHub {
owner = "localstack";
repo = "localstack";
tag = "v${version}";
hash = "sha256-vyk86iuYI6dGUCtijauwT7p4hSWNXluz5cHHRm8zdOE=";
};
build-system = with python3.pkgs; [
setuptools
setuptools-scm
];
propagatedBuildInputs = with python3.pkgs; [
apispec
boto3
build
cachetools
click
cryptography
localstack-client
localstack-ext
plux
psutil
python-dotenv
pyyaml
packaging
requests
rich
semver
tailer
];
pythonRelaxDeps = [
"dill"
];
pythonImportsCheck = [ "localstack" ];
# Test suite requires boto, which has been removed from nixpkgs
# Just do minimal test, buildPythonPackage maps checkPhase
# to installCheckPhase, so we can test that entrypoint point works.
checkPhase = ''
runHook preCheck
export HOME=$(mktemp -d)
$out/bin/localstack --version
runHook postCheck
'';
# Propagating dependencies leaks them through $PYTHONPATH which causes issues
# when used in nix-shell.
postFixup = ''
rm $out/nix-support/propagated-build-inputs
'';
meta = with lib; {
description = "Fully functional local Cloud stack";
homepage = "https://github.com/localstack/localstack";
license = licenses.asl20;
maintainers = [ ];
mainProgram = "localstack";
};
}

View File

@@ -0,0 +1,45 @@
{
buildGoModule,
fetchFromGitHub,
lib,
m4,
}:
buildGoModule {
pname = "localtime";
version = "0-unstable-2022-02-20";
src = fetchFromGitHub {
owner = "Stebalien";
repo = "localtime";
rev = "c1e10aa4141ed2bb01986b48e0e942e618993c06";
hash = "sha256-bPQ1c2KUTkxx2g7IvLmrKgJKfRHTLlTXLR/QQ0O4CrI=";
};
vendorHash = "sha256-12JnEU41sp9qRP07p502EYogveE+aNdfmLwlDRbIdxU=";
nativeBuildInputs = [ m4 ];
buildPhase = ''
runHook preBuild
make PREFIX="$out"
runHook postBuild
'';
doCheck = false; # no tests
installPhase = ''
runHook preInstall
make PREFIX="$out" install
runHook postInstall
'';
meta = with lib; {
description = "Daemon for keeping the system timezone up-to-date based on the current location";
homepage = "https://github.com/Stebalien/localtime";
maintainers = with maintainers; [ lovesegfault ];
platforms = platforms.linux;
license = licenses.gpl3;
mainProgram = "localtimed";
};
}

View File

@@ -0,0 +1,77 @@
{
bats,
bash,
fetchFromGitHub,
lib,
resholve,
coreutils,
getopt,
}:
let
version = "0.0.1";
in
resholve.mkDerivation {
pname = "locate-dominating-file";
inherit version;
src = fetchFromGitHub {
owner = "roman";
repo = "locate-dominating-file";
rev = "v${version}";
hash = "sha256-gwh6fAw7BV7VFIkQN02QIhK47uxpYheMk64UeLyp2IY=";
};
postPatch = ''
for file in $(find src tests -type f); do
patchShebangs "$file"
done
'';
buildInputs = [
getopt
coreutils
];
checkInputs = [
(bats.withLibraries (p: [
p.bats-support
p.bats-assert
]))
];
doCheck = true;
checkPhase = ''
runHook preCheck
bats -t tests
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp src/locate-dominating-file.sh $out/bin/locate-dominating-file
runHook postInstall
'';
solutions.default = {
scripts = [ "bin/locate-dominating-file" ];
interpreter = "${bash}/bin/bash";
inputs = [
coreutils
getopt
];
};
meta = with lib; {
homepage = "https://github.com/roman/locate-dominating-file";
description = "Program that looks up in a directory hierarchy for a given filename";
license = licenses.mit;
maintainers = [ maintainers.roman ];
platforms = platforms.all;
mainProgram = "locate-dominating-file";
};
}

View File

@@ -0,0 +1,54 @@
{
lib,
buildGoModule,
fetchFromGitLab,
python3,
}:
buildGoModule rec {
pname = "loccount";
version = "2.16";
src = fetchFromGitLab {
owner = "esr";
repo = "loccount";
rev = version;
hash = "sha256-uHX45KZO6R0tgTU10csKLiVYZZ/ea2V6BwhF6vfKKtA=";
};
vendorHash = null;
excludedPackages = "tests";
nativeBuildInputs = [ python3 ];
ldflags = [
"-s"
"-w"
];
preBuild = ''
patchShebangs --build tablegen.py
go generate
'';
meta = with lib; {
description = "Re-implementation of sloccount in Go";
mainProgram = "loccount";
longDescription = ''
loccount is a re-implementation of David A. Wheeler's sloccount tool
in Go. It is faster and handles more different languages. Because
it's one source file in Go, it is easier to maintain and extend than the
multi-file, multi-language implementation of the original.
The algorithms are largely unchanged and can be expected to produce
identical numbers for languages supported by both tools. Python is
an exception; loccount corrects buggy counting of single-quote multiline
literals in sloccount 2.26.
'';
homepage = "https://gitlab.com/esr/loccount";
downloadPage = "https://gitlab.com/esr/loccount/tree/master";
license = licenses.bsd2;
maintainers = with maintainers; [ calvertvl ];
};
}

View File

@@ -0,0 +1,64 @@
{
lib,
stdenv,
appstream,
blueprint-compiler,
desktop-file-utils,
fetchFromGitHub,
gdk-pixbuf,
glib,
gpgme,
gtk4,
libadwaita,
meson,
ninja,
nix-update-script,
pkg-config,
wrapGAppsHook4,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lock";
version = "1.8.0";
src = fetchFromGitHub {
owner = "konstantintutsch";
repo = "Lock";
tag = "v${finalAttrs.version}";
hash = "sha256-t472uLuuT5QPmfxkRP6wPalblMU68iD2wyKOxSrJfeU=";
};
strictDeps = true;
nativeBuildInputs = [
appstream
blueprint-compiler
desktop-file-utils
glib # For `glib-compile-schemas`
gtk4 # For `gtk-update-icon-cache`
meson
ninja
pkg-config
wrapGAppsHook4
];
buildInputs = [
gdk-pixbuf
gpgme
gtk4
libadwaita
];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Process data with GnuPG";
homepage = "https://konstantintutsch.com/Lock";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ getchoo ];
mainProgram = "com.konstantintutsch.Lock";
inherit (gpgme.meta) platforms;
};
})

View File

@@ -0,0 +1,89 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
gtk3,
glib,
gobject-introspection,
gdk-pixbuf,
libxkbcommon,
vulkan-loader,
makeDesktopItem,
autoPatchelfHook,
copyDesktopItems,
}:
let
desc = "Private, polished note-taking platform";
in
rustPlatform.buildRustPackage rec {
pname = "lockbook-desktop";
version = "25.10.7";
src = fetchFromGitHub {
owner = "lockbook";
repo = "lockbook";
tag = version;
hash = "sha256-EzVMTJaxPeIOJUdwmaShMLEe1XQcJx+0i1Rl0ILi5+c=";
};
cargoHash = "sha256-ze82Iu2lH0n3ucKibLu3/VWMaaDWhs0oFFe/na2GbmY=";
nativeBuildInputs = [
pkg-config
autoPatchelfHook
copyDesktopItems
];
buildInputs = [
gtk3
glib
gobject-introspection
gdk-pixbuf
libxkbcommon
];
runtimeDependencies = [
vulkan-loader
];
doCheck = false; # there are no cli tests
cargoBuildFlags = [
"--package"
"lockbook-linux"
];
desktopItems = makeDesktopItem {
desktopName = "Lockbook";
name = "lockbook-desktop";
comment = desc;
icon = "lockbook";
exec = "lockbook-desktop";
categories = [
"Office"
"Documentation"
"Utility"
];
};
postInstall = ''
mv $out/bin/lockbook-linux $out/bin/lockbook-desktop
install -D public_site/favicon.svg $out/share/icons/hicolor/scalable/apps/lockbook.svg
'';
meta = {
description = desc;
longDescription = ''
Write notes, sketch ideas, and store files in one secure place.
Share seamlessly, keep data synced, and access it on any
platformeven offline. Lockbook encrypts files so even we
cant see them, but dont take our word for it:
Lockbook is 100% open-source.
'';
homepage = "https://lockbook.net";
license = lib.licenses.unlicense;
platforms = lib.platforms.linux;
changelog = "https://github.com/lockbook/lockbook/releases/tag/${version}";
maintainers = [ lib.maintainers.parth ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
}:
rustPlatform.buildRustPackage rec {
pname = "lockbook";
version = "25.10.7";
src = fetchFromGitHub {
owner = "lockbook";
repo = "lockbook";
tag = version;
hash = "sha256-EzVMTJaxPeIOJUdwmaShMLEe1XQcJx+0i1Rl0ILi5+c=";
};
cargoHash = "sha256-ze82Iu2lH0n3ucKibLu3/VWMaaDWhs0oFFe/na2GbmY=";
doCheck = false; # there are no cli tests
cargoBuildFlags = [
"--package"
"lockbook"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --bash --name lockbook.bash <($out/bin/lockbook completions bash)
installShellCompletion --zsh --name _lockbook <($out/bin/lockbook completions zsh)
installShellCompletion --fish --name lockbook.fish <($out/bin/lockbook completions fish)
'';
meta = {
description = "Private, polished note-taking platform";
longDescription = ''
Write notes, sketch ideas, and store files in one secure place.
Share seamlessly, keep data synced, and access it on any
platformeven offline. Lockbook encrypts files so even we
cant see them, but dont take our word for it:
Lockbook is 100% open-source.
'';
homepage = "https://lockbook.net";
license = lib.licenses.unlicense;
platforms = lib.platforms.all;
changelog = "https://github.com/lockbook/lockbook/releases";
maintainers = [ lib.maintainers.parth ];
};
}

View File

@@ -0,0 +1,79 @@
{
lib,
stdenv,
fetchurl,
bash,
flex,
bison,
valgrind,
}:
stdenv.mkDerivation rec {
pname = "lockdep";
# it would be nice to be able to pick a kernel version in sync with something
# else we already ship, but it seems userspace lockdep isn't very well maintained
# and appears broken in many kernel releases
version = "5.0.21";
fullver = "5.0.21";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
sha256 = "1my2m9hvnvdrvzcg0fgqgaga59y2cd5zlpv7xrfj2nn98sjhglwq";
};
# ensure *this* kernel's userspace-headers are picked up before we
# fall back to those in glibc, as they will be from a mismatched
# kernel version
postPatch = ''
substituteInPlace tools/lib/lockdep/Makefile \
--replace 'CONFIG_INCLUDES =' $'CONFIG_INCLUDES = -I../../../usr/include\n#'
'';
nativeBuildInputs = [
flex
bison
];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: lockdep.o:/build/linux-5.0.21/tools/lib/lockdep/../../include/linux/rcu.h:5: multiple definition of
# `rcu_scheduler_active'; common.o:/build/linux-5.0.21/tools/lib/lockdep/../../include/linux/rcu.h:5: first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
buildPhase = ''
make defconfig
make headers_install
cd tools/lib/lockdep
make
'';
doCheck = true;
nativeCheckInputs = [ valgrind ];
checkPhase = ''
# there are more /bin/bash references than just shebangs
for f in lockdep run_tests.sh tests/*.sh; do
substituteInPlace $f \
--replace '/bin/bash' '${bash}/bin/bash'
done
./run_tests.sh
'';
installPhase = ''
mkdir -p $out/bin $out/lib $out/include
cp -R include/liblockdep $out/include
make install DESTDIR=$out prefix=""
substituteInPlace $out/bin/lockdep --replace "./liblockdep.so" "$out/lib/liblockdep.so.$fullver"
'';
meta = {
description = "Userspace locking validation tool built on the Linux kernel";
mainProgram = "lockdep";
homepage = "https://kernel.org/";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.thoughtpolice ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchurl,
liblockfile,
}:
stdenv.mkDerivation rec {
pname = "lockfile-progs";
version = "0.1.19";
src = fetchurl {
url = "mirror://debian/pool/main/l/lockfile-progs/lockfile-progs_${version}.tar.gz";
sha256 = "sha256-LFcEsByPR0+CkheA5Fkqknsr9qbXYWNUpsXXzVZkhX4=";
};
buildInputs = [ liblockfile ];
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU (toString [
# Needed with GCC 12
"-Wno-error=format-overflow"
]);
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/man/man1
install bin/* $out/bin
install man/*.1 $out/man/man1
runHook postInstall
'';
meta = {
description = "Programs for locking and unlocking files and mailboxes";
homepage = "http://packages.debian.org/sid/lockfile-progs";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
rustPlatform,
fetchCrate,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "loco";
version = "0.16.2";
src = fetchCrate {
inherit pname version;
hash = "sha256-yctOGUfKd1zaIArtHESYEr1q79ZrJqL7H6bvpAFrE+8=";
};
cargoHash = "sha256-IdYicJ7ZIoVOQU91S8yIPYGeY+DaeAMztGOmriTGW38=";
#Skip trycmd integration tests
checkFlags = [ "--skip=cli_tests" ];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Loco CLI is a powerful command-line tool designed to streamline the process of generating Loco websites";
homepage = "https://loco.rs";
changelog = "https://github.com/loco-rs/loco/blob/master/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ sebrut ];
mainProgram = "loco";
};
}

View File

@@ -0,0 +1,40 @@
From 6a8571098024d1eb69efaae1f1622b3a91417b5f Mon Sep 17 00:00:00 2001
From: tropf <tropf@users.noreply.github.com>
Date: Tue, 26 Aug 2025 15:08:07 +0200
Subject: [PATCH 1/2] replace version check using package.json
In the distributed (nix) version, package.json is not available under
the expected path. As nix can inject the version during build time, this
patch removes the reference to package.json, and injects a marker for
the version to be replaced during the patchPhase.
---
packages/web/nextjs/next.config.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/packages/web/nextjs/next.config.js b/packages/web/nextjs/next.config.js
index 9b2b364..db9d680 100644
--- a/packages/web/nextjs/next.config.js
+++ b/packages/web/nextjs/next.config.js
@@ -5,10 +5,6 @@ const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true"
});
-const packageJson = require(`${
- fs.existsSync(path.join(__dirname, "package.json")) ? "./" : "../"
-}package.json`);
-
module.exports = withBundleAnalyzer({
reactStrictMode: true,
target: "serverless",
@@ -16,7 +12,7 @@ module.exports = withBundleAnalyzer({
trailingSlash: true,
serverRuntimeConfig: {
PROJECT_ROOT: __dirname, // https://github.com/vercel/next.js/issues/8251
- VERSION: packageJson.version
+ VERSION: "@NIX_LOG4BRAINS_VERSION@",
},
webpack(config, { webpack, buildId }) {
// For cache invalidation purpose (thanks https://github.com/vercel/next.js/discussions/14743)
--
2.50.1

View File

@@ -0,0 +1,72 @@
From 8c7af30fe7377235037c1a385f484f201ecfe063 Mon Sep 17 00:00:00 2001
From: tropf <tropf@users.noreply.github.com>
Date: Tue, 26 Aug 2025 15:15:19 +0200
Subject: [PATCH 2/2] move nextjs build into temporary directory
For the build command, upstream invokes a nextjs-base build inside
node_modules. As this is read-only in nix, the corresponding directory
is copied into a newly-created directory in the temporary directory
(e.g. /tmp), from where the build can successfully run.
---
packages/web/cli/commands/build.ts | 38 +++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/packages/web/cli/commands/build.ts b/packages/web/cli/commands/build.ts
index b611cd9..213e82f 100644
--- a/packages/web/cli/commands/build.ts
+++ b/packages/web/cli/commands/build.ts
@@ -16,6 +16,36 @@ type Deps = {
appConsole: AppConsole;
};
+const fs = require('fs');
+const os = require('os');
+
+// Helper: Recursively copy directory
+function copyDirSync(src: any, dest: any) {
+ if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
+ for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
+ const srcPath = path.join(src, entry.name);
+ const destPath = path.join(dest, entry.name);
+ if (entry.isDirectory()) {
+ copyDirSync(srcPath, destPath);
+ } else {
+ fs.copyFileSync(srcPath, destPath);
+ }
+ }
+}
+
+// Helper: Recursively set writeable flag
+function setWriteableSync(target: any) {
+ const stat = fs.statSync(target);
+ if (stat.isDirectory()) {
+ fs.chmodSync(target, 0o755);
+ for (const entry of fs.readdirSync(target)) {
+ setWriteableSync(path.join(target, entry));
+ }
+ } else {
+ fs.chmodSync(target, 0o644);
+ }
+}
+
export async function buildCommand(
{ appConsole }: Deps,
outPath: string,
@@ -24,7 +54,13 @@ export async function buildCommand(
process.env.NEXT_TELEMETRY_DISABLED = "1";
appConsole.println("Building Log4brains...");
- const nextDir = getNextJsDir();
+ const oldNextDir = getNextJsDir();
+
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'log4brains-nextjs-'));
+ copyDirSync(oldNextDir, tmpDir);
+ setWriteableSync(tmpDir);
+ const nextDir = tmpDir;
+
// eslint-disable-next-line global-require,import/no-dynamic-require,@typescript-eslint/no-var-requires
const nextConfig = require(path.join(nextDir, "next.config.js")) as Record<
string,
--
2.50.1

View File

@@ -0,0 +1,118 @@
{
lib,
stdenv,
callPackage,
fetchFromGitHub,
fetchYarnDeps,
yarnConfigHook,
yarnBuildHook,
yarnInstallHook,
nodejs,
yarn,
moreutils,
jq,
makeBinaryWrapper,
fetchpatch2,
replaceVars,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "log4brains";
version = "1.1.0";
src = fetchFromGitHub {
owner = "thomvaill";
repo = "log4brains";
tag = "v${finalAttrs.version}";
hash = "sha256-2EAETbICK3XSjAEoLV0KP2xeOYlw8qgctit+shMp5Qs=";
};
yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-HHiWlOYwR+PhfpQlUfuTXUiQ+6w1HATGlmflQvqdNlg=";
};
# generated from https://codeberg.org/tropf/log4brains
patches = [
# This replaces a version check by accessing package.json, which
# in the nix packaging is not at the expected path
(replaceVars ./0001-replace-version-check-using-package.json.patch {
NIX_LOG4BRAINS_VERSION = finalAttrs.version;
})
./0002-move-nextjs-build-into-temporary-directory.patch
];
postPatch = ''
# Top-level is just a workspace (actual packages reside in packages/
# subdir), but w/o `version` the yarn hooks refuse to run.
jq '.version = "${finalAttrs.version}"' < package.json | sponge package.json
'';
# = Notes =
#
# Not copying the full node_modules yields:
# Error: Cannot find module 'chalk'
#
# The log4brains version in src/ and the default install differ,
# hence remove the copied version and let installPhase handle it.
#
# An alternative approach is to bundle log4brains binary using (tested only in devshell):
# npx pkg --target 'node*-linux-x64' .
preInstall = ''
mkdir -p $out/lib
cp -aLrt $out/lib node_modules
# will get installed by the installPhase, so avoid conflicts
rm -r $out/lib/node_modules/log4brains
# the desired final package is inside of a subdir; switch there
pushd packages/global-cli
'';
# w/o yarn it just generated cryptic errors ENOENT
#
# There are some builds at runtime (marked as "hack" in the src),
# hence we need node_modules set
postInstall = ''
popd
wrapProgram $out/bin/log4brains \
--suffix PATH : ${
lib.makeBinPath [
nodejs
yarn
]
} \
--set NODE_PATH $out/lib/node_modules
'';
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
yarnInstallHook
# Needed for executing package.json scripts
nodejs
makeBinaryWrapper
moreutils # sponge
jq
];
passthru.tests.basic-scenario = callPackage ./test-basic-scenario.nix {
log4brains = finalAttrs.finalPackage;
};
meta = {
description = "Architecture Decision Records (ADR) management and publication tool";
longDescription = ''
Log4brains is a docs-as-code knowledge base for your development and infrastructure projects.
It enables you to log Architecture Decision Records (ADR) right from your IDE and to publish them automatically as a static website.
'';
homepage = "https://github.com/thomvaill/log4brains";
license = lib.licenses.asl20;
mainProgram = "log4brains";
maintainers = with lib.maintainers; [ tropf ];
platforms = lib.platforms.all;
};
})

View File

@@ -0,0 +1,33 @@
{
testers,
log4brains,
}:
testers.runCommand {
name = "log4brains-test-basic-scenario";
# the build runs for *quite* a while
meta.timeout = 90;
nativeBuildInputs = [ log4brains ];
script = ''
log4brains | grep 'Log4brains CLI'
mkdir project && cd project
log4brains init --defaults
test -f docs/adr/index.md
log4brains adr new --quiet 'Test ADR'
grep -r 'Test ADR' docs/adr/ >/dev/null
# Note: Preview is difficult to check (and hence not checked):
# (1) It requires some timeout for the page to become ready.
# (2) The signal & process handling is screwed; on kill the
# process serving in the background stays alive.
log4brains build --out www
test -f www/index.html
grep -r 'Test ADR' www >/dev/null
touch $out
'';
}

View File

@@ -0,0 +1,29 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "log4cplus";
version = "2.1.2";
src = fetchurl {
url = "mirror://sourceforge/log4cplus/log4cplus-${version}.tar.bz2";
hash = "sha256-JFDfu0qzXdLJ5k2MdQxRS/cpO4HY8yr3qxJEF/cK360=";
};
nativeBuildInputs = [ pkg-config ];
enableParallelBuilding = true;
strictDeps = true;
meta = {
homepage = "http://log4cplus.sourceforge.net/";
description = "Port the log4j library from Java to C++";
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,25 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "log4cpp";
version = "1.1.4";
src = fetchurl {
url = "mirror://sourceforge/log4cpp/${pname}-${version}.tar.gz";
sha256 = "sha256-aWETZZ5CZUBiUnSoslEFLMBDBtjuXEKgx2OfOcqQydY=";
};
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://log4cpp.sourceforge.net/";
description = "Logging framework for C++ patterned after Apache log4j";
mainProgram = "log4cpp-config";
license = licenses.lgpl21Plus;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchurl,
libtool,
cmake,
libxml2,
cppunit,
boost,
apr,
aprutil,
db,
expat,
}:
stdenv.mkDerivation rec {
pname = "log4cxx";
version = "1.5.0";
src = fetchurl {
url = "mirror://apache/logging/log4cxx/${version}/apache-${pname}-${version}.tar.gz";
hash = "sha256-qiP0fDFkqiz4SMIli0tLw3Lnlk1KPtR8K0pKkVxd+jc=";
};
postPatch = ''
substituteInPlace CMakeLists.txt --replace "\\\''${prefix}/" ""
'';
buildInputs = [
libxml2
cppunit
boost
apr
aprutil
db
expat
];
nativeBuildInputs = [
libtool
cmake
];
meta = {
homepage = "https://logging.apache.org/log4cxx/index.html";
description = "Logging framework for C++ patterned after Apache log4j";
license = lib.licenses.asl20;
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,39 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication {
pname = "log4j-detect";
version = "0-unstable-2021-12-14";
format = "other";
src = fetchFromGitHub {
owner = "takito1812";
repo = "log4j-detect";
rev = "2f5b7a598a6d0b4aee8111bb574ea72c6a1c76d6";
sha256 = "sha256-fFKW7uPBfrnze0UoPL3Mfwd4sFOuHYuDP7kv6VtdM3o=";
};
propagatedBuildInputs = with python3.pkgs; [
requests
];
postPatch = ''
sed -i "1 i #!/usr/bin/python" log4j-detect.py
'';
installPhase = ''
runHook preInstall
install -vD log4j-detect.py $out/bin/log4j-detect
runHook postInstall
'';
meta = with lib; {
description = "Tool to detect the log4j vulnerability";
homepage = "https://github.com/takito1812/log4j-detect";
license = licenses.unfree;
maintainers = with maintainers; [ fab ];
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication {
pname = "log4j-scan";
version = "unstable-2021-12-18";
format = "other";
src = fetchFromGitHub {
owner = "fullhunt";
repo = "log4j-scan";
rev = "070fbd00f0945645bd5e0daa199a554ef3884b95";
sha256 = "sha256-ORSc4KHyAMjuA7QHReDh6SYY5yZRunBBN1+lkCayqL4=";
};
propagatedBuildInputs = with python3.pkgs; [
pycryptodome
requests
termcolor
];
postPatch = ''
substituteInPlace log4j-scan.py \
--replace "headers.txt" "../share/headers.txt"
'';
installPhase = ''
runHook preInstall
install -vD log4j-scan.py $out/bin/log4j-scan
install -vD headers.txt headers-large.txt -t $out/share
runHook postInstall
'';
meta = with lib; {
description = "Scanner for finding hosts which are vulnerable for log4j";
mainProgram = "log4j-scan";
homepage = "https://github.com/fullhunt/log4j-scan";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
buildGoModule,
fetchFromGitHub,
gitMinimal,
}:
buildGoModule rec {
pname = "log4j-sniffer";
version = "1.9.0";
src = fetchFromGitHub {
owner = "palantir";
repo = "log4j-sniffer";
rev = "v${version}";
sha256 = "sha256-pO6difzNvQvKQtRLyksXmExtQHlnnwyF3iNEmSBgUmU=";
};
vendorHash = null;
nativeCheckInputs = [
gitMinimal
];
preCheck = ''
export HOME=$(mktemp -d);
cd $HOME
git init
'';
meta = with lib; {
description = "Tool that scans archives to check for vulnerable log4j versions";
mainProgram = "log4j-sniffer";
homepage = "https://github.com/palantir/log4j-sniffer";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ fab ];
};
}

View File

@@ -0,0 +1,31 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "log4j-vuln-scanner";
version = "0.13";
src = fetchFromGitHub {
owner = "hillu";
repo = "local-log4j-vuln-scanner";
rev = "v${version}";
sha256 = "sha256-YMD2233EdrrF1SLjwiRcNr53b7Rf5Tu8CZC43QhSY7c=";
};
vendorHash = null;
postInstall = ''
mv $out/bin/scanner $out/bin/$pname
mv $out/bin/patcher $out/bin/log4j-vuln-patcher
'';
meta = with lib; {
description = "Local log4j vulnerability scanner";
homepage = "https://github.com/hillu/local-log4j-vuln-scanner";
license = with licenses; [ gpl3Only ];
maintainers = with maintainers; [ fab ];
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication {
pname = "log4jcheck";
version = "0-unstable-2021-12-14";
format = "other";
src = fetchFromGitHub {
owner = "NorthwaveSecurity";
repo = "log4jcheck";
rev = "736f1f4044e8a9b7bf5db515e2d1b819253f0f6d";
sha256 = "sha256-1al7EMYbE/hFXKV4mYZlkEWTUIKYxgXYU3qBLlczYvs=";
};
propagatedBuildInputs = with python3.pkgs; [
requests
];
installPhase = ''
runHook preInstall
install -vD nw_log4jcheck.py $out/bin/log4jcheck
runHook postInstall
'';
meta = with lib; {
description = "Tool to check for vulnerable Log4j (CVE-2021-44228) systems";
homepage = "https://github.com/NorthwaveSecurity/log4jcheck";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
mainProgram = "log4jcheck";
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication {
pname = "log4shell-detector";
version = "0-unstable-2021-12-16";
format = "pyproject";
src = fetchFromGitHub {
owner = "Neo23x0";
repo = "log4shell-detector";
rev = "622b88e7ea36819da23ce6ac090785cd6cca77f9";
sha256 = "sha256-N81x9hq473LfM+bQIQLWizCAsVc/pzyB84PV7/N5jk4=";
};
build-system = with python3.pkgs; [
setuptools
];
dependencies = with python3.pkgs; [
zstandard
];
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];
installPhase = ''
runHook preInstall
install -vD log4shell-detector.py $out/bin/log4shell-detector
install -vd $out/${python3.sitePackages}/
cp -R Log4ShellDetector $out/${python3.sitePackages}
runHook postInstall
'';
meta = with lib; {
description = "Detector for Log4Shell exploitation attempts";
homepage = "https://github.com/Neo23x0/log4shell-detector";
license = licenses.mit;
maintainers = with maintainers; [ fab ];
mainProgram = "log4shell-detector";
};
}

View File

@@ -0,0 +1,29 @@
{
lib,
stdenv,
fetchgit,
autoreconfHook,
}:
stdenv.mkDerivation {
pname = "log4shib";
version = "1.0.9";
src = fetchgit {
url = "https://git.shibboleth.net/git/cpp-log4shib.git";
rev = "a1afe19b7b49c32fcb03e6d72809501b8965cf85";
sha256 = "06rrc5l6qxlc8abzim2jcxwz2c577qrjqx15cbfqq1zfqagj9hix";
};
nativeBuildInputs = [ autoreconfHook ];
CXXFLAGS = "-std=c++11";
meta = with lib; {
description = "Forked version of log4cpp that has been created for the Shibboleth project";
mainProgram = "log4shib-config";
maintainers = [ ];
license = licenses.lgpl21;
homepage = "http://log4cpp.sf.net";
};
}

View File

@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchurl,
lockfileProgs,
perlPackages,
}:
stdenv.mkDerivation rec {
pname = "logcheck";
version = "1.4.7";
_name = "logcheck_${version}";
src = fetchurl {
url = "mirror://debian/pool/main/l/logcheck/${_name}.tar.xz";
sha256 = "sha256-zBYMvKwo85OI6LluRixOYtAFRTtpV/Hw6qjAk/+c898=";
};
prePatch = ''
# do not set sticky bit in nix store.
substituteInPlace Makefile --replace 2750 0750
'';
preConfigure = ''
substituteInPlace src/logtail --replace "/usr/bin/perl" "${perlPackages.perl}/bin/perl"
substituteInPlace src/logtail2 --replace "/usr/bin/perl" "${perlPackages.perl}/bin/perl"
sed -i -e 's|! -f /usr/bin/lockfile|! -f ${lockfileProgs}/bin/lockfile|' \
-e 's|^\([ \t]*\)lockfile-|\1${lockfileProgs}/bin/lockfile-|' \
-e "s|/usr/sbin/logtail2|$out/sbin/logtail2|" \
-e 's|mime-construct|${perlPackages.mimeConstruct}/bin/mime-construct|' \
-e 's|\$(run-parts --list "\$dir")|"$dir"/*|' src/logcheck
'';
makeFlags = [
"DESTDIR=$(out)"
"SBINDIR=sbin"
"BINDIR=bin"
"SHAREDIR=share/logtail/detectrotate"
];
meta = with lib; {
description = "Mails anomalies in the system logfiles to the administrator";
longDescription = ''
Mails anomalies in the system logfiles to the administrator.
Logcheck helps spot problems and security violations in your logfiles automatically and will send the results to you by e-mail.
Logcheck was part of the Abacus Project of security tools, but this version has been rewritten.
'';
homepage = "https://salsa.debian.org/debian/logcheck";
license = licenses.gpl2Plus;
};
}

View File

@@ -0,0 +1,70 @@
{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "logdy";
version = "0.17.1";
src = fetchFromGitHub {
owner = "logdyhq";
repo = "logdy-core";
tag = "v${version}";
hash = "sha256-NV1vgHUeIH1k1E5hdO3fXrXl1+B30AUM2aexlxz5g8o=";
};
vendorHash = "sha256-kFhcbBMymzlJ+2zw7l09LJfCdps26Id+VzOehqrLDWU=";
ldflags = [
"-s"
"-w"
];
nativeBuildInputs = [ installShellFiles ];
# After the build this derivation will generate two binaries.
# The first one is getting renamed based on the documentation
# The second one is just to launch a demo. This functionality could be achieved with the first one
postInstall = ''
mv $out/bin/logdy-core $out/bin/logdy
rm -f $out/bin/example-app
installShellCompletion --cmd logdy \
--bash <($out/bin/logdy completion bash) \
--fish <($out/bin/logdy completion fish) \
--zsh <($out/bin/logdy completion zsh)
'';
checkFlags =
let
skippedTests = [
"TestClientLoad" # index out of range
"TestLogdyE2E_(No|Stdin)Command" # hang forever
];
in
[
"-timeout=60s" # assume the test is hanging
"-skip=^${lib.concatStringsSep "|" skippedTests}$"
];
__darwinAllowLocalNetworking = true;
meta = {
description = "Web based real-time log viewer";
longDescription = ''
Web based real-time log viewer.
Stream ANY content to a web UI with autogenerated filters.
Parse any format with TypeScript
'';
homepage = "https://github.com/logdyhq/logdy-core";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
sigmanificient
ByteSudoer
];
mainProgram = "logdy";
};
}

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
glib,
udev,
libevdev,
libconfig,
}:
stdenv.mkDerivation (oldAttrs: {
pname = "logiops";
version = "0.3.5";
src = fetchFromGitHub {
owner = "PixlOne";
repo = "logiops";
tag = "v${oldAttrs.version}";
hash = "sha256-GAnlPqjIFGyOWwYFs7gth2m9ITc1jyiaW0sWwQ2zFOs=";
# In v0.3.0, the `ipcgull` submodule was added as a dependency
# https://github.com/PixlOne/logiops/releases/tag/v0.3.0
fetchSubmodules = true;
};
patches = [
./pkgs0001-Make-DBUS_SYSTEM_POLICY_INSTALL_DIR-externally-overr.patch
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
udev
libevdev
libconfig
glib
];
cmakeFlags = [
"-DLOGIOPS_VERSION=${oldAttrs.version}"
"-DDBUS_SYSTEM_POLICY_INSTALL_DIR=${placeholder "out"}/share/dbus-1/system.d"
];
PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
meta = with lib; {
description = "Unofficial userspace driver for HID++ Logitech devices";
mainProgram = "logid";
homepage = "https://github.com/PixlOne/logiops";
license = licenses.gpl3Plus;
maintainers = [ ];
platforms = with platforms; linux;
};
})

View File

@@ -0,0 +1,30 @@
From b7588376e20661c8d79e7472732244c70b8e7d3f Mon Sep 17 00:00:00 2001
From: ckie <git-525ff67@ckie.dev>
Date: Mon, 16 Oct 2023 02:02:38 +0300
Subject: [PATCH] Make DBUS_SYSTEM_POLICY_INSTALL_DIR externally overrideable
---
src/logid/CMakeLists.txt | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/logid/CMakeLists.txt b/src/logid/CMakeLists.txt
index b2616c8..58d6719 100644
--- a/src/logid/CMakeLists.txt
+++ b/src/logid/CMakeLists.txt
@@ -111,9 +111,11 @@ elseif (NOT SYSTEMD_FOUND AND SYSTEMD_SERVICES_INSTALL_DIR)
endif ()
# Install DBus conf
-# TODO: Is there a better way of setting the system policy directory?
-set(DBUS_SYSTEM_POLICY_INSTALL_DIR "/usr/share/dbus-1/system.d")
configure_file(logiops-dbus.conf.in ${CMAKE_BINARY_DIR}/pizza.pixl.LogiOps.conf)
+if (NOT DEFINED DBUS_SYSTEM_POLICY_INSTALL_DIR)
+ # TODO: Is there a better way of setting the system policy directory?
+ set(DBUS_SYSTEM_POLICY_INSTALL_DIR "/usr/share/dbus-1/system.d")
+endif ()
message(STATUS "dbus system policy will be installed at ${DBUS_SYSTEM_POLICY_INSTALL_DIR}")
install(FILES ${CMAKE_BINARY_DIR}/pizza.pixl.LogiOps.conf
DESTINATION ${DBUS_SYSTEM_POLICY_INSTALL_DIR}
--
2.42.0

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
udev,
libevdev,
libconfig,
}:
stdenv.mkDerivation rec {
pname = "logiops";
version = "0.2.3";
src = fetchFromGitHub {
owner = "pixlone";
repo = "logiops";
rev = "v${version}";
hash = "sha256-1v728hbIM2ODtB+r6SYzItczRJCsbuTvhYD2OUM1+/E=";
};
PKG_CONFIG_SYSTEMD_SYSTEMDSYSTEMUNITDIR = "${placeholder "out"}/lib/systemd/system";
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
udev
libevdev
libconfig
];
meta = with lib; {
description = "Unofficial userspace driver for HID++ Logitech devices";
mainProgram = "logid";
homepage = "https://github.com/PixlOne/logiops";
license = licenses.gpl3Plus;
maintainers = [ ];
platforms = with platforms; linux;
};
}

View File

@@ -0,0 +1,69 @@
{
lib,
stdenv,
fetchurl,
jre,
makeBinaryWrapper,
copyDesktopItems,
makeDesktopItem,
desktopToDarwinBundle,
unzip,
}:
let
icon = fetchurl {
url = "https://github.com/logisim-evolution/logisim-evolution/raw/9e0afa3cd6a8bfa75dab61830822cde83c70bb4b/artwork/logisim-evolution-icon.svg";
hash = "sha256-DNRimhNFt6jLdjqv7o2cNz38K6XnevxD0rGymym3xBs=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "logisim-evolution";
version = "3.9.0";
src = fetchurl {
url = "https://github.com/logisim-evolution/logisim-evolution/releases/download/v${finalAttrs.version}/logisim-evolution-${finalAttrs.version}-all.jar";
hash = "sha256-QxU1h6LKzWy25wtXgEufPT0KsIsLhrKnq9CRcS4Mlzc=";
};
dontUnpack = true;
nativeBuildInputs = [
makeBinaryWrapper
copyDesktopItems
unzip
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
desktopToDarwinBundle
];
desktopItems = [
(makeDesktopItem {
name = "logisim-evolution";
desktopName = "Logisim-evolution";
exec = "logisim-evolution";
icon = "logisim-evolution";
comment = finalAttrs.meta.description;
categories = [ "Education" ];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src"
install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/logisim-evolution.svg
runHook postInstall
'';
meta = {
changelog = "https://github.com/logisim-evolution/logisim-evolution/releases/tag/v${finalAttrs.version}";
homepage = "https://github.com/logisim-evolution/logisim-evolution";
description = "Digital logic designer and simulator";
mainProgram = "logisim-evolution";
maintainers = with lib.maintainers; [ emilytrau ];
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.gpl3Only;
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,68 @@
{
lib,
stdenv,
fetchurl,
jre,
makeBinaryWrapper,
copyDesktopItems,
makeDesktopItem,
desktopToDarwinBundle,
unzip,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "logisim";
version = "2.7.1";
src = fetchurl {
url = "mirror://sourceforge/project/circuit/${lib.versions.majorMinor finalAttrs.version}.x/${finalAttrs.version}/logisim-generic-${finalAttrs.version}.jar";
hash = "sha256-Nip4wSrRjCA/7YaIcsSgHNnBIUE3nZLokrviw35ie8I=";
};
dontUnpack = true;
nativeBuildInputs = [
makeBinaryWrapper
copyDesktopItems
unzip
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
desktopToDarwinBundle
];
desktopItems = [
(makeDesktopItem {
name = "logisim";
desktopName = "Logisim";
exec = "logisim";
icon = "logisim";
comment = finalAttrs.meta.description;
categories = [ "Education" ];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/logisim --add-flags "-jar $src"
# Create icons
unzip $src "resources/logisim/img/*"
for size in 16 20 24 48 64 128
do
install -Dm444 "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim.png"
done
runHook postInstall
'';
meta = {
homepage = "http://www.cburch.com/logisim/";
description = "Educational tool for designing and simulating digital logic circuits";
mainProgram = "logisim";
maintainers = with lib.maintainers; [ emilytrau ];
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.gpl2Only;
platforms = lib.platforms.unix;
};
})

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
autoconf,
automake,
which,
procps,
kbd,
}:
stdenv.mkDerivation {
pname = "logkeys";
version = "2018-01-22";
src = fetchFromGitHub {
owner = "kernc";
repo = "logkeys";
rev = "7a9f19fb6b152d9f00a0b3fe29ab266ff1f88129";
sha256 = "1k6kj0913imwh53lh6hrhqmrpygqg2h462raafjsn7gbd3vkgx8n";
};
nativeBuildInputs = [
autoconf
automake
];
buildInputs = [
which
procps
kbd
];
postPatch = ''
substituteInPlace src/Makefile.am --replace 'root' '$(id -u)'
substituteInPlace configure.ac --replace '/dev/input' '/tmp'
sed -i '/chmod u+s/d' src/Makefile.am
'';
preConfigure = "./autogen.sh";
meta = with lib; {
description = "GNU/Linux keylogger that works";
license = licenses.gpl3;
homepage = "https://github.com/kernc/logkeys";
maintainers = with maintainers; [
mikoim
offline
];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication {
pname = "logmap";
version = "0-unstable-2021-12-15";
format = "other";
src = fetchFromGitHub {
owner = "zhzyker";
repo = "logmap";
rev = "5040707b4ae260830072de93ccd6a23615073abf";
sha256 = "sha256-LOGjK5l/gaKObWbC9vaLruE8DdDsabztnEW/TjvCdtE=";
};
propagatedBuildInputs = with python3.pkgs; [
requests
];
installPhase = ''
runHook preInstall
install -vD logmap.py $out/bin/logmap
runHook postInstall
'';
meta = with lib; {
description = "Tools for fuzzing Log4j2 jndi injection";
homepage = "https://github.com/zhzyker/logmap";
license = licenses.gpl3Only;
maintainers = with maintainers; [ fab ];
mainProgram = "logmap";
};
}

View File

@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchurl,
}:
let
arch =
if stdenv.hostPlatform.system == "x86_64-linux" then
"x64"
else if stdenv.hostPlatform.system == "i686-linux" then
"x86"
else
throwSystem;
throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
sha256 =
if stdenv.hostPlatform.system == "x86_64-linux" then
"0zy0jzvdqccfsg42m2lq1rj8r2c4iypd1h9vxl9824cbl92yim37"
else if stdenv.hostPlatform.system == "i686-linux" then
"03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62"
else
throwSystem;
libraries = lib.makeLibraryPath [ stdenv.cc.cc ];
in
stdenv.mkDerivation rec {
pname = "logmein-hamachi";
version = "2.1.0.203";
src = fetchurl {
url = "https://vpn.net/installers/${pname}-${version}-${arch}.tgz";
inherit sha256;
};
installPhase = ''
patchelf \
--set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
--set-rpath ${libraries} \
hamachid
install -D -m755 hamachid $out/bin/hamachid
ln -s $out/bin/hamachid $out/bin/hamachi
'';
dontStrip = true;
dontPatchELF = true;
meta = with lib; {
description = "Hosted VPN service that lets you securely extend LAN-like networks to distributed teams";
homepage = "https://secure.logmein.com/products/hamachi/";
changelog = "https://support.logmeininc.com/central/help/whats-new-in-hamachi";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfreeRedistributable;
maintainers = [ ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
gzip,
popt,
autoreconfHook,
aclSupport ? stdenv.hostPlatform.isLinux,
acl,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "logrotate";
version = "3.22.0";
src = fetchFromGitHub {
owner = "logrotate";
repo = "logrotate";
rev = version;
sha256 = "sha256-D7E2mpC7v2kbsb1EyhR6hLvGbnIvGB2MK1n1gptYyKI=";
};
# Logrotate wants to access the 'mail' program; to be done.
configureFlags = [
"--with-compress-command=${gzip}/bin/gzip"
"--with-uncompress-command=${gzip}/bin/gunzip"
];
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ popt ] ++ lib.optionals aclSupport [ acl ];
passthru.tests = {
nixos-logrotate = nixosTests.logrotate;
};
meta = with lib; {
homepage = "https://github.com/logrotate/logrotate";
description = "Rotates and compresses system logs";
license = licenses.gpl2Plus;
maintainers = [ maintainers.tobim ];
platforms = platforms.all;
mainProgram = "logrotate";
};
}

View File

@@ -0,0 +1,24 @@
diff --git a/resources/forge.config.js b/resources/forge.config.js
index 5a349a2..f967102 100644
--- a/resources/forge.config.js
+++ b/resources/forge.config.js
@@ -13,19 +13,6 @@ module.exports = {
"schemes": "logseq"
}
],
- osxSign: {
- identity: 'Developer ID Application: Tiansheng Qin',
- 'hardened-runtime': true,
- entitlements: 'entitlements.plist',
- 'entitlements-inherit': 'entitlements.plist',
- 'signature-flags': 'library'
- },
- osxNotarize: {
- tool: 'notarytool',
- appleId: process.env['APPLE_ID'],
- appleIdPassword: process.env['APPLE_ID_PASSWORD'],
- teamId: process.env['APPLE_TEAM_ID']
- },
},
makers: [
{

View File

@@ -0,0 +1,13 @@
diff --git a/resources/package.json b/resources/package.json
index 3445cbb..03927d4 100644
--- a/resources/package.json
+++ b/resources/package.json
@@ -10,7 +10,7 @@
"scripts": {
"electron:dev": "electron-forge start",
"electron:debug": "electron-forge start --inspect-electron",
- "electron:make": "electron-forge make",
+ "electron:make": "electron-forge package",
"electron:make-linux-arm64": "electron-forge make --platform=linux --arch=arm64",
"electron:make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
"electron:publish:github": "electron-forge publish",

View File

@@ -0,0 +1,98 @@
diff --git a/bb.edn b/bb.edn
index 76e1ba1..43d2c73 100644
--- a/bb.edn
+++ b/bb.edn
@@ -4,8 +4,7 @@
{:mvn/version "0.10.0"}
logseq/bb-tasks
#_{:local/root "../bb-tasks"}
- {:git/url "https://github.com/logseq/bb-tasks"
- :git/sha "70d3edeb287f5cec7192e642549a401f7d6d4263"}
+ {:local/root "@bb_tasks_src@"}
logseq/graph-parser
{:local/root "deps/graph-parser"}
org.clj-commons/digest
diff --git a/deps.edn b/deps.edn
index 9fb41e5..2b45436 100644
--- a/deps.edn
+++ b/deps.edn
@@ -11,8 +11,7 @@
cljs-bean/cljs-bean {:mvn/version "1.5.0"}
prismatic/dommy {:mvn/version "1.1.0"}
org.clojure/core.match {:mvn/version "1.0.0"}
- com.andrewmcveigh/cljs-time {:git/url "https://github.com/logseq/cljs-time" ;; fork
- :sha "5704fbf48d3478eedcf24d458c8964b3c2fd59a9"}
+ com.andrewmcveigh/cljs-time {:local/root "@cljs_time_src@"}
cljs-drag-n-drop/cljs-drag-n-drop {:mvn/version "0.1.0"}
cljs-http/cljs-http {:mvn/version "0.1.46"}
org.babashka/sci {:mvn/version "0.3.2"}
diff --git a/deps/common/bb.edn b/deps/common/bb.edn
index 3188222..1dba8a9 100644
--- a/deps/common/bb.edn
+++ b/deps/common/bb.edn
@@ -2,8 +2,7 @@
:deps
{logseq/bb-tasks
#_{:local/root "../../../bb-tasks"}
- {:git/url "https://github.com/logseq/bb-tasks"
- :git/sha "70d3edeb287f5cec7192e642549a401f7d6d4263"}}
+ {:local/root "@bb_tasks_src@"}}
:pods
{clj-kondo/clj-kondo {:version "2023.05.26"}}
diff --git a/deps/db/bb.edn b/deps/db/bb.edn
index 2bf0931..e3d5ea8 100644
--- a/deps/db/bb.edn
+++ b/deps/db/bb.edn
@@ -3,8 +3,7 @@
:deps
{logseq/bb-tasks
#_{:local/root "../../../bb-tasks"}
- {:git/url "https://github.com/logseq/bb-tasks"
- :git/sha "70d3edeb287f5cec7192e642549a401f7d6d4263"}}
+ {:local/root "@bb_tasks_src@"}}
:pods
{clj-kondo/clj-kondo {:version "2023.05.26"}}
diff --git a/deps/graph-parser/bb.edn b/deps/graph-parser/bb.edn
index 5093ff5..9cb7c54 100644
--- a/deps/graph-parser/bb.edn
+++ b/deps/graph-parser/bb.edn
@@ -2,8 +2,7 @@
:deps
{logseq/bb-tasks
#_{:local/root "../../../bb-tasks"}
- {:git/url "https://github.com/logseq/bb-tasks"
- :git/sha "70d3edeb287f5cec7192e642549a401f7d6d4263"}}
+ {:local/root "@bb_tasks_src@"}}
:pods
{clj-kondo/clj-kondo {:version "2023.05.26"}}
diff --git a/deps/graph-parser/deps.edn b/deps/graph-parser/deps.edn
index 4675c30..57abe35 100644
--- a/deps/graph-parser/deps.edn
+++ b/deps/graph-parser/deps.edn
@@ -1,8 +1,7 @@
{:paths ["src"]
:deps
;; External deps should be kept in sync with https://github.com/logseq/nbb-logseq/blob/main/bb.edn
- {com.andrewmcveigh/cljs-time {:git/url "https://github.com/logseq/cljs-time" ;; fork
- :sha "5704fbf48d3478eedcf24d458c8964b3c2fd59a9"}
+ {com.andrewmcveigh/cljs-time {:local/root "@cljs_time_src@"}
;; local deps
logseq/db {:local/root "../db"}
logseq/common {:local/root "../common"}
diff --git a/deps/publishing/bb.edn b/deps/publishing/bb.edn
index 878757b..2fce25a 100644
--- a/deps/publishing/bb.edn
+++ b/deps/publishing/bb.edn
@@ -2,8 +2,7 @@
:deps
{logseq/bb-tasks
#_{:local/root "../../../bb-tasks"}
- {:git/url "https://github.com/logseq/bb-tasks"
- :git/sha "70d3edeb287f5cec7192e642549a401f7d6d4263"}}
+ {:local/root "@bb_tasks_src@"}}
:pods
{clj-kondo/clj-kondo {:version "2023.05.26"}}

View File

@@ -0,0 +1,289 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
replaceVars,
writeShellScriptBin,
copyDesktopItems,
cctools,
clojure,
darwin,
makeDesktopItem,
makeWrapper,
nodejs,
removeReferencesTo,
yarnBuildHook,
yarnConfigHook,
xcbuild,
zip,
electron,
git,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "logseq";
version = "0.10.12";
src = fetchFromGitHub {
owner = "logseq";
repo = "logseq";
tag = finalAttrs.version;
hash = "sha256-SUzt4hYHE6XJOEMxFp2a0om2oVUk1MHQUteGFiM9Lkc=";
};
patches = [
(replaceVars ./hardcode-git-paths.patch {
cljs_time_src = fetchFromGitHub {
owner = "logseq";
repo = "cljs-time";
rev = "5704fbf48d3478eedcf24d458c8964b3c2fd59a9";
hash = "sha256-IApL+SEm7AhbTN7J/1KiAKTx7rd53hchRh3jmPQ412g=";
};
bb_tasks_src = fetchFromGitHub {
owner = "logseq";
repo = "bb-tasks";
rev = "70d3edeb287f5cec7192e642549a401f7d6d4263";
hash = "sha256-xVJj5XCkqfaNjnhYZkuqTSJN0ry8UVMaN44r9pxggB0=";
};
})
./electron-forge-package-instead-of-make.patch
./electron-forge-disable-signing.patch
];
mavenRepo = stdenv.mkDerivation {
name = "logseq-${finalAttrs.version}-maven-deps";
inherit (finalAttrs) src patches;
nativeBuildInputs = [ clojure ];
buildPhase = ''
runHook preBuild
export HOME="$(mktemp -d)"
mkdir -p "$out"
# -P -> resolve all normal deps
# -M:alias -> resolve extra-deps of the listed aliases
clj -Sdeps "{:mvn/local-repo \"$out\"}" -P -M:cljs
runHook postBuild
'';
# copied from buildMavenPackage
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside
installPhase = ''
runHook preInstall
find $out -type f \( \
-name \*.lastUpdated \
-o -name resolver-status.properties \
-o -name _remote.repositories \) \
-delete
runHook postInstall
'';
dontFixup = true;
outputHash = "sha256-gcq9zP5AQtpZU7sC9Oq3PkTj6uDo2NSShigkcuglV98=";
outputHashMode = "recursive";
outputHashAlgo = "sha256";
};
yarnOfflineCacheRoot = fetchYarnDeps {
name = "logseq-${finalAttrs.version}-yarn-deps-root";
inherit (finalAttrs) src;
hash = "sha256-sbC6WQLjEHIKTuejSQXplQOWZwUmBJdGXuAkilQGjYs=";
};
# ./static and ./resources are combined into ./static by the build process
# ./static contains the lockfile and ./resources contains everything else
yarnOfflineCacheStaticResources = fetchYarnDeps {
name = "logseq-${finalAttrs.version}-yarn-deps-static-resources";
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/static";
hash = "sha256-01t6lolMbBL5f6SFk4qTkTx6SQXWtHuVkBhDwW+HScc=";
};
yarnOfflineCacheAmplify = fetchYarnDeps {
name = "logseq-${finalAttrs.version}-yarn-deps-amplify";
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/packages/amplify";
hash = "sha256-IOhSwIf5goXCBDGHCqnsvWLf3EUPqq75xfQg55snIp4=";
};
yarnOfflineCacheTldraw = fetchYarnDeps {
name = "logseq-${finalAttrs.version}-yarn-deps-tldraw";
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/tldraw";
hash = "sha256-CtMl3MPlyO5nWfFhCC1SLb/+1HUM3YfFATAPqJg3rUo=";
};
strictDeps = true;
nativeBuildInputs =
let
clojureWithCache = writeShellScriptBin "clojure" ''
exec ${lib.getExe' clojure "clojure"} -Sdeps '{:mvn/local-repo "${finalAttrs.mavenRepo}"}' "$@"
'';
# the build process runs `git describe --long --always --dirty`
fakeGit = writeShellScriptBin "git" ''
echo "${finalAttrs.src.rev or finalAttrs.version}@nixpkgs"
'';
in
[
clojureWithCache
copyDesktopItems
fakeGit
makeWrapper
nodejs
(nodejs.python.withPackages (ps: [ ps.setuptools ]))
removeReferencesTo
yarnBuildHook
yarnConfigHook
zip
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cctools
darwin.autoSignDarwinBinariesHook
xcbuild
];
# we'll run the hook manually multiple times
dontYarnInstallDeps = true;
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
postConfigure = ''
yarnOfflineCache="$yarnOfflineCacheRoot" yarnConfigHook
cp resources/package.json static/package.json
pushd static
yarnOfflineCache="$yarnOfflineCacheStaticResources" yarnConfigHook
popd
pushd packages/amplify
yarnOfflineCache="$yarnOfflineCacheAmplify" yarnConfigHook
popd
pushd tldraw
cp yarn.lock apps/tldraw-logseq/yarn.lock
yarnOfflineCache="$yarnOfflineCacheTldraw" yarnConfigHook
pushd apps/tldraw-logseq
yarnOfflineCache="$yarnOfflineCacheTldraw" yarnConfigHook
popd
popd
# this has to be done after everything is set up, because for some reason
# the shebangs somehow get unpatched... I don't know why...
patchShebangs node_modules
patchShebangs static/node_modules
patchShebangs packages/amplify/node_modules
patchShebangs tldraw/node_modules
patchShebangs tldraw/apps/tldraw-logseq/node_modules
yarn --offline --cwd tldraw postinstall
export npm_config_nodedir=${nodejs}
pushd packages/amplify
npm rebuild --verbose
popd
export npm_config_nodedir=${electron.headers}
pushd static
# we want to use our own git, don't try downloading it
substituteInPlace node_modules/dugite/package.json \
--replace-fail '"postinstall"' '"_postinstall"'
# this doesn't seem to build with electron.headers
rm node_modules/macos-alias/binding.gyp
# the electron-rebuild command deadlocks for some reason, let's just use normal npm rebuild (since we overrode the nodedir anyways)
npm rebuild --verbose
# remove most references to electron.headers
shopt -s globstar
rm -r node_modules/**/{*.target.mk,config.gypi,Makefile,Release/.deps}
shopt -u globstar
popd
cp -r ${electron.dist} electron-dist
chmod -R u+w electron-dist
pushd electron-dist
zip -0Xqr ../electron.zip .
popd
rm -r electron-dist
substituteInPlace static/node_modules/@electron/packager/dist/packager.js \
--replace-fail "await this.getElectronZipPath(downloadOpts)" "\"$(pwd)/electron.zip\""
cp -r static/node_modules resources/node_modules
'';
yarnBuildScript = "release-electron";
installPhase = ''
runHook preInstall
# remove references to nodejs
find static/out/*/resources/app/node_modules -type f -executable -exec remove-references-to -t ${nodejs} '{}' \;
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm644 static/icons/logseq.png "$out/share/icons/hicolor/512x512/apps/logseq.png"
mkdir -p $out/share/logseq
cp -r static/out/*/{locales,resources{,.pak}} $out/share/logseq
makeWrapper ${lib.getExe electron} $out/bin/logseq \
--add-flags $out/share/logseq/resources/app \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--set-default LOCAL_GIT_DIRECTORY ${git} \
--inherit-argv0
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
cp -r static/out/*/Logseq.app $out/Applications
wrapProgram $out/Applications/Logseq.app/Contents/MacOS/Logseq \
--set-default LOCAL_GIT_DIRECTORY ${git}
makeWrapper $out/Applications/Logseq.app/Contents/MacOS/Logseq $out/bin/logseq
''
+ ''
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "Logseq";
desktopName = "Logseq";
exec = "logseq %U";
terminal = false;
icon = "logseq";
startupWMClass = "Logseq";
comment = "A privacy-first, open-source platform for knowledge management and collaboration.";
mimeTypes = [ "x-scheme-handler/logseq" ];
categories = [ "Utility" ];
})
];
meta = {
description = "Privacy-first, open-source platform for knowledge management and collaboration";
homepage = "https://github.com/logseq/logseq";
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [ tomasajt ];
mainProgram = "logseq";
platforms = electron.meta.platforms;
};
})

View File

@@ -0,0 +1,80 @@
{
lib,
stdenv,
fetchurl,
SDL2,
ftgl,
pkg-config,
libpng,
libjpeg,
pcre2,
SDL2_image,
glew,
libGLU,
libGL,
libX11,
boost,
glm,
freetype,
}:
stdenv.mkDerivation rec {
pname = "logstalgia";
version = "1.1.4";
src = fetchurl {
url = "https://github.com/acaudwell/Logstalgia/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
hash = "sha256-wEnv9AXpJANSIu2ya8xse18AoIkmq9t7Rn4kSSQnkKk=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
glew
SDL2
ftgl
libpng
libjpeg
libX11
pcre2
SDL2_image
libGLU
libGL
boost
glm
freetype
];
configureFlags = [
"--with-boost-system=boost_system"
"--with-boost-filesystem=boost_filesystem"
];
meta = with lib; {
homepage = "https://logstalgia.io/";
description = "Website traffic visualization tool";
license = licenses.gpl3Plus;
longDescription = ''
Logstalgia is a website traffic visualization that replays or
streams web-server access logs as a pong-like battle between the
web server and an never ending torrent of requests.
Requests appear as colored balls (the same color as the host)
which travel across the screen to arrive at the requested
location. Successful requests are hit by the paddle while
unsuccessful ones (eg 404 - File Not Found) are missed and pass
through.
The paths of requests are summarized within the available space by
identifying common path prefixes. Related paths are grouped
together under headings. For instance, by default paths ending in
png, gif or jpg are grouped under the heading Images. Paths that
dont match any of the specified groups are lumped together under
a Miscellaneous section.
'';
platforms = platforms.gnu ++ platforms.linux;
maintainers = with maintainers; [ pSub ];
mainProgram = "logstalgia";
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
ncurses,
uthash,
pkg-config,
}:
stdenv.mkDerivation rec {
pname = "logtop";
version = "0.7";
src = fetchFromGitHub {
rev = "logtop-${version}";
owner = "JulienPalard";
repo = "logtop";
sha256 = "1f8vk9gybldxvc0kwz38jxmwvzwangsvlfslpsx8zf04nvbkqi12";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
ncurses
uthash
];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
installFlags = [ "DESTDIR=$(out)" ];
postConfigure = ''
substituteInPlace Makefile --replace /usr ""
'';
meta = with lib; {
description = "Displays a real-time count of strings received from stdin";
longDescription = ''
logtop displays a real-time count of strings received from stdin.
It can be useful in some cases, like getting the IP flooding your
server or the top buzzing article of your blog
'';
license = licenses.bsd2;
homepage = "https://github.com/JulienPalard/logtop";
platforms = platforms.unix;
maintainers = [ maintainers.starcraft66 ];
mainProgram = "logtop";
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
}:
stdenv.mkDerivation {
pname = "loguru";
version = "2.1.0-unstable-2023-04-06";
src = fetchFromGitHub {
owner = "emilk";
repo = "loguru";
rev = "4adaa185883e3c04da25913579c451d3c32cfac1";
hash = "sha256-NpMKyjCC06bC5B3xqgDr2NgA9RsPEeiWr9GbHrHHzZ8=";
};
patches = [
# See https://github.com/emilk/loguru/issues/249
# The following patches are coming from a fork and fix builds on Darwin
# Hopefully they will be merged in the main repository soon.
(fetchpatch {
url = "https://github.com/virtuosonic/loguru/commit/e1ffdc4149083cc221d44b666a0f7e3ec4a87259.patch";
hash = "sha256-fYdS8+qfgyj1J+T6H434jDGK/L+VYq+L22CQ7M/uiXE=";
})
(fetchpatch {
url = "https://github.com/virtuosonic/loguru/commit/743777bea361642349d4673e6a0a55912849c14f.patch";
hash = "sha256-3FhH7zdkzHuXSirSCr8A3uHg8UpSfEM02AkR0ZSG0Yw=";
})
];
cmakeFlags = [
"-DLOGURU_WITH_STREAMS=1"
];
nativeBuildInputs = [
cmake
];
meta = {
description = "Lightweight C++ logging library";
homepage = "https://github.com/emilk/loguru";
license = lib.licenses.unlicense;
maintainers = [ ];
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "lokalise2-cli";
version = "3.1.4";
src = fetchFromGitHub {
owner = "lokalise";
repo = "lokalise-cli-2-go";
rev = "v${version}";
sha256 = "sha256-weqYHKxu6HvdrFduzKtHtCVnJ0GVRGIPABLrsW4f0VA=";
};
vendorHash = "sha256-thD8NtG9uVI4KwNQiNsVCUdyUcgAmnr+szsUQ2Ika1c=";
doCheck = false;
postInstall = ''
mv $out/bin/lokalise-cli-2-go $out/bin/lokalise2
'';
meta = with lib; {
description = "Translation platform for developers. Upload language files, translate, integrate via API";
homepage = "https://lokalise.com";
license = licenses.bsd3;
maintainers = with maintainers; [ timstott ];
mainProgram = "lokalise2";
};
}

View File

@@ -0,0 +1,34 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "loki";
version = "0.1.7";
src = fetchurl {
url = "mirror://sourceforge/loki-lib/Loki/Loki%20${version}/loki-${version}.tar.gz";
sha256 = "1xhwna961fl4298ac5cc629x5030zlw31vx4h8zws290amw5860g";
};
buildPhase = ''
substituteInPlace Makefile.common --replace /usr $out
make build-shared
'';
env.NIX_CFLAGS_COMPILE = toString [
"-std=c++11"
];
enableParallelBuilding = true;
meta = with lib; {
description = "C++ library of designs, containing flexible implementations of common design patterns and idioms";
homepage = "https://loki-lib.sourceforge.net";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ peterhoeg ];
};
}

View File

@@ -0,0 +1,74 @@
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
cmake,
libevent,
libsodium,
libuv,
nlohmann_json,
pkg-config,
spdlog,
sqlite,
systemd,
unbound,
zeromq,
}:
stdenv.mkDerivation rec {
pname = "lokinet";
version = "0.9.13";
src = fetchFromGitHub {
owner = "oxen-io";
repo = "lokinet";
tag = "v${version}";
fetchSubmodules = true;
hash = "sha256-6TVMuT4O8zJj97873BTsR1PJU8NaBgYr/nBkc/EfQuQ=";
};
patches = [
# Fix gcc-13 compatibility:
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/oxen-io/lokinet/commit/89c5c73be48788ba14a55cb6d82d57208b487eaf.patch";
hash = "sha256-yCy4WXs6p67TMe4uPNAuQyJvtP3IbpJS81AeomNu9lU=";
})
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
libevent
libuv
libsodium
nlohmann_json
spdlog
sqlite
systemd
unbound
zeromq
];
cmakeFlags = [
"-DGIT_VERSION=v${version}"
"-DWITH_BOOTSTRAP=OFF" # we provide bootstrap files manually
"-DWITH_SETCAP=OFF"
];
meta = {
# Upstream has received reports of incompatibilities with fmt, and other
# dependencies, see: https://github.com/oxen-io/lokinet/issues/2200.
# But our version of spdlog doesn't support fmt_9
broken = true;
description = "Anonymous, decentralized and IP based overlay network for the internet";
homepage = "https://lokinet.org/";
changelog = "https://github.com/oxen-io/lokinet/releases/tag/v${version}";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ wyndon ];
};
}

View File

@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
ncurses,
ninja,
pkg-config,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "loksh";
version = "7.7";
src = fetchFromGitHub {
owner = "dimkr";
repo = "loksh";
tag = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-BxQ7SZwRP9PlD2MV7DqG7tQ2lqzlkTwmaKwbgC7NYrc=";
};
outputs = [
"out"
"doc"
"man"
];
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
ncurses
];
strictDeps = true;
postInstall = ''
mv $out/bin/ksh $out/bin/loksh
pushd $man/share/man/man1/
mv ksh.1 loksh.1
mv sh.1 loksh-sh.1
popd
'';
passthru = {
shellPath = "/bin/loksh";
};
meta = {
homepage = "https://github.com/dimkr/loksh";
description = "Linux port of OpenBSD's ksh";
mainProgram = "loksh";
longDescription = ''
loksh is a Linux port of OpenBSD's ksh.
Unlike other ports of ksh, loksh targets only one platform, follows
upstream closely and keeps changes to a minimum. loksh does not add any
extra features; this reduces the risk of introducing security
vulnerabilities and makes loksh a good fit for resource-constrained
systems.
'';
license = with lib.licenses; [ publicDomain ];
maintainers = with lib.maintainers; [ cameronnemo ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,46 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
doxygen,
cmake,
readline,
}:
stdenv.mkDerivation rec {
pname = "lolcode";
version = "0.11.2";
src = fetchFromGitHub {
owner = "justinmeza";
repo = "lci";
rev = "v${version}";
sha256 = "sha256-VMBW3/sw+1kI6iuOckSPU1TIeY6QORcSfFLFkRYw3Gs=";
};
nativeBuildInputs = [
pkg-config
cmake
doxygen
];
buildInputs = [ readline ];
# Maybe it clashes with lci scientific logic software package...
postInstall = "mv $out/bin/lci $out/bin/lolcode-lci";
meta = with lib; {
homepage = "http://lolcode.org";
description = "Esoteric programming language";
longDescription = ''
LOLCODE is a funny esoteric programming language, a bit Pascal-like,
whose keywords are LOLspeak.
'';
license = licenses.gpl3;
maintainers = [ ];
mainProgram = "lolcode-lci";
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,120 @@
{
lib,
fetchFromGitLab,
nix-update-script,
meson,
ninja,
pkg-config,
python3,
gtk3,
gst_all_1,
libhandy,
libsecret,
libsoup_3,
appstream-glib,
desktop-file-utils,
totem-pl-parser,
gobject-introspection,
glib-networking,
gdk-pixbuf,
glib,
pango,
kid3,
wrapGAppsHook3,
lastFMSupport ? true,
youtubeSupport ? true,
kid3Support ? true,
}:
python3.pkgs.buildPythonApplication rec {
pname = "lollypop";
version = "1.4.40";
format = "other";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World";
repo = "lollypop";
rev = version;
fetchSubmodules = true;
hash = "sha256-hdReviNgcigXuNqJns6aPW+kixlpmRXtqrLlm/LGHBo=";
};
nativeBuildInputs = [
appstream-glib
desktop-file-utils
gobject-introspection
meson
ninja
pkg-config
wrapGAppsHook3
];
buildInputs =
(with gst_all_1; [
gst-libav
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
gstreamer
])
++ [
gdk-pixbuf
glib
glib-networking
gtk3
libhandy
libsoup_3
pango
totem-pl-parser
]
++ lib.optional lastFMSupport libsecret;
propagatedBuildInputs =
(with python3.pkgs; [
beautifulsoup4
pillow
pycairo
pygobject3
])
++ lib.optional lastFMSupport python3.pkgs.pylast
++ lib.optional youtubeSupport python3.pkgs.yt-dlp
++ lib.optional kid3Support kid3;
postPatch = ''
chmod +x meson_post_install.py
patchShebangs meson_post_install.py
'';
postFixup = ''
wrapPythonProgramsIn $out/libexec "$out $propagatedBuildInputs"
'';
strictDeps = false;
# Produce only one wrapper using wrap-python passing
# gappsWrapperArgs to wrap-python additional wrapper
# argument
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
passthru = {
updateScript = nix-update-script { };
};
meta = {
changelog = "https://gitlab.gnome.org/World/lollypop/tags/${version}";
description = "Modern music player for GNOME";
homepage = "https://gitlab.gnome.org/World/lollypop";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ lovesegfault ];
platforms = lib.platforms.linux;
mainProgram = "lollypop";
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
jdk,
}:
stdenv.mkDerivation rec {
pname = "lombok";
version = "1.18.42";
src = fetchurl {
url = "https://projectlombok.org/downloads/lombok-${version}.jar";
sha256 = "sha256-NIik6ZlMJllrqs7r7ljK02pQ472uxb5ytYNNPDtWAwY=";
};
nativeBuildInputs = [ makeWrapper ];
outputs = [
"out"
"bin"
];
buildCommand = ''
mkdir -p $out/share/java
cp $src $out/share/java/lombok.jar
makeWrapper ${jdk}/bin/java $bin/bin/lombok \
--add-flags "-cp ${jdk}/lib/openjdk/lib/tools.jar:$out/share/java/lombok.jar" \
--add-flags lombok.launch.Main
'';
meta = {
description = "Library that can write a lot of boilerplate for your Java project";
mainProgram = "lombok";
platforms = lib.platforms.all;
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.mit;
homepage = "https://projectlombok.org/";
maintainers = [ lib.maintainers.CrystalGamma ];
};
}

View File

@@ -0,0 +1,52 @@
{
rustPlatform,
lib,
fetchFromGitHub,
makeBinaryWrapper,
nix-prefetch-git,
gitMinimal,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
pname = "lon";
version = "0.8.0";
src = fetchFromGitHub {
owner = "nikstur";
repo = "lon";
tag = version;
hash = "sha256-bxu83mbdfAeDZYOnjZQYyjTs5WgZS8o6Q2irlzgbYs0=";
};
sourceRoot = "source/rust/lon";
cargoHash = "sha256-x+qxn0s64fPJpTG/d0PgzAdzMXegYdnsC1FFFuBpsaI=";
nativeBuildInputs = [ makeBinaryWrapper ];
postInstall = ''
wrapProgram $out/bin/lon --prefix PATH : ${
lib.makeBinPath [
nix-prefetch-git
gitMinimal
]
}
'';
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Lock & update Nix dependencies";
homepage = "https://github.com/nikstur/lon";
changelog = "https://github.com/nikstur/lon/blob/${version}/CHANGELOG.md";
maintainers = with lib.maintainers; [
ma27
nikstur
];
license = lib.licenses.mit;
mainProgram = "lon";
};
}

View File

@@ -0,0 +1,28 @@
{
lib,
stdenv,
fetchurl,
}:
let
version = "1.2.0";
in
stdenv.mkDerivation {
pname = "long-shebang";
inherit version;
src = fetchurl {
url = "https://github.com/shlevy/long-shebang/releases/download/v${version}/long-shebang-${version}.tar.xz";
sha256 = "10h29w1c5bm0rlscyjiz1kzb134rn92as6v4y7i8mhhmdh6mmf79";
};
meta = {
description = "Tool for #! scripts with more than one argument";
homepage = "https://github.com/shlevy/long-shebang";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
mainProgram = "long-shebang";
};
}

View File

@@ -0,0 +1,36 @@
{
lib,
buildGoModule,
fetchFromGitHub,
nix-update-script,
}:
let
version = "0.0.12";
in
buildGoModule {
pname = "longcat";
inherit version;
src = fetchFromGitHub {
owner = "mattn";
repo = "longcat";
tag = "v${version}";
hash = "sha256-MiUkI7qCN/rDJUkBCyET19CH4iYnl1HwKjRZD2dCTVM=";
};
vendorHash = "sha256-ka58YOoyBKLX8Z9ak2+rERXsY3rPUaOanfIFErCJCdE=";
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/mattn/longcat";
description = "Renders a picture of a long cat on the terminal";
license = lib.licenses.mit;
platforms = lib.platforms.all;
mainProgram = "longcat";
maintainers = with lib.maintainers; [
bubblepipe
];
};
}

View File

@@ -0,0 +1,38 @@
diff -ru longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Logger.pm longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Logger.pm
--- longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Logger.pm 2015-10-28 17:15:32.816515318 +0000
+++ longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Logger.pm 2015-10-28 18:00:50.760332026 +0000
@@ -26,9 +26,7 @@
my ( $self, $message ) = @_;
my $ts = strftime( '%m/%d %T', localtime );
- $self->{logger}->write(
- sprintf( '%s %s Longview[%i] - %s', $ts, uc($level), $$, $message ),
- $levels->{$level} );
+ printf( "%s %s Longview[%i] - %s\n", $ts, uc($level), $$, $message );
die "$message" if $level eq 'logdie';
};
}
@@ -37,12 +35,6 @@
my ( $class, $level ) = @_;
my $self = {};
- mkpath($LOGDIR) unless (-d $LOGDIR);
- $self->{logger}
- = Log::LogLite->new( $LOGDIR . 'longview.log', $level )
- or die "Couldn't create logger object: $!";
- $self->{logger}->template("<message>\n");
-
return bless $self, $class;
}
diff -ru longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Util.pm longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Util.pm
--- longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Util.pm 2015-10-28 17:15:32.816515318 +0000
+++ longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Util.pm 2015-10-28 19:20:30.894314658 +0000
@@ -225,7 +225,6 @@
#<<< perltidy ignore
chdir '/' or $logger->logdie("Can't chdir to /: $!");
open STDIN, '<', '/dev/null' or $logger->logdie("Can't read /dev/null: $!");
- open STDOUT, '>>', '/dev/null' or $logger->logdie("Can't write to /dev/null: $!");
open STDERR, '>>', '/dev/null' or $logger->logdie("Can't write to /dev/null: $!");
tie *STDERR, "Linode::Longview::STDERRLogger";
defined( my $pid = fork ) or $logger->logdie("Can't fork: $!");

View File

@@ -0,0 +1,84 @@
{
lib,
stdenv,
fetchFromGitHub,
perl,
perlPackages,
makeWrapper,
glibc,
}:
stdenv.mkDerivation rec {
version = "1.1.5";
pname = "longview";
src = fetchFromGitHub {
owner = "linode";
repo = "longview";
rev = "v${version}";
sha256 = "1i9lli8iw8sb1bd633i82fzhx5gz85ma9d1hra41pkv2p3h823pa";
};
patches = [
# log to systemd journal
./log-stdout.patch
];
# Read all configuration from /run/longview
postPatch = ''
substituteInPlace Linode/Longview/Util.pm \
--replace /var/run/longview.pid /run/longview/longview.pid \
--replace /etc/linode /run/longview
substituteInPlace Linode/Longview.pl \
--replace /etc/linode /run/longview
'';
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
perl
glibc
]
++ (with perlPackages; [
LWP
LWPProtocolHttps
MozillaCA
CryptSSLeay
IOSocketINET6
LinuxDistribution
JSONPP
JSON
LogLogLite
TryTiny
DBI
DBDmysql
]);
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/usr
mv Linode $out
ln -s ../Linode/Longview.pl $out/bin/longview
for h in syscall.h sys/syscall.h asm/unistd.h asm/unistd_32.h asm/unistd_64.h bits/wordsize.h bits/syscall.h; do
${perl}/bin/h2ph -d $out ${glibc.dev}/include/$h
mkdir -p $out/usr/include/$(dirname $h)
mv $out${glibc.dev}/include/''${h%.h}.ph $out/usr/include/$(dirname $h)
done
wrapProgram $out/Linode/Longview.pl --prefix PATH : ${perl}/bin:$out/bin \
--suffix PERL5LIB : $out/Linode --suffix PERL5LIB : $PERL5LIB \
--suffix PERL5LIB : $out --suffix INC : $out
'';
meta = with lib; {
homepage = "https://www.linode.com/longview";
description = "Collects all of your system-level metrics and sends them to Linode";
mainProgram = "longview";
license = licenses.gpl2Plus;
maintainers = [ maintainers.rvl ];
inherit version;
platforms = [
"x86_64-linux"
"i686-linux"
];
};
}

View File

@@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3755adc..55e1eb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,6 +25,7 @@ include(OptimizeForNative) # option(OPTIMIZE_FOR_NATIVE)
include(UninstallTarget)
find_package(PkgConfig)
+find_package(NanoSVG REQUIRED)
pkg_check_modules(FONTCONFIG REQUIRED IMPORTED_TARGET fontconfig)
option(ENABLE_OPENGL "Enable the OpenGL renderer" ON)
@@ -106,7 +107,6 @@ include_directories(
${PROJECT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/include
- ${PROJECT_TOP}/repos/nanosvg/src
)
link_libraries(
@@ -161,6 +161,7 @@ target_compile_definitions(looking-glass-client PRIVATE CIMGUI_DEFINE_ENUMS_AND_
target_link_libraries(looking-glass-client
${EXE_FLAGS}
PkgConfig::FONTCONFIG
+ NanoSVG::nanosvg
lg_resources
lg_common
displayservers

View File

@@ -0,0 +1,139 @@
{
stdenv,
lib,
fetchFromGitHub,
pkg-config,
cmake,
freefont_ttf,
spice-protocol,
nettle,
libbfd,
fontconfig,
libffi,
expat,
libGL,
nanosvg,
libX11,
libxkbcommon,
libXext,
libXrandr,
libXi,
libXScrnSaver,
libXinerama,
libXcursor,
libXpresent,
libXdmcp,
wayland,
wayland-protocols,
wayland-scanner,
pipewire,
pulseaudio,
libsamplerate,
openGLSupport ? true,
xorgSupport ? true,
waylandSupport ? true,
pipewireSupport ? true,
pulseSupport ? true,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "looking-glass-client";
version = "B7";
src = fetchFromGitHub {
owner = "gnif";
repo = "LookingGlass";
rev = finalAttrs.version;
hash = "sha256-I84oVLeS63mnR19vTalgvLvA5RzCPTXV+tSsw+ImDwQ=";
fetchSubmodules = true;
};
patches = [
./nanosvg-unvendor.diff
];
nativeBuildInputs = [
cmake
pkg-config
wayland-scanner
];
buildInputs = [
libX11
libGL
freefont_ttf
spice-protocol
expat
libbfd
nettle
fontconfig
libffi
nanosvg
]
++ lib.optionals xorgSupport [
libxkbcommon
libXi
libXScrnSaver
libXinerama
libXcursor
libXpresent
libXext
libXrandr
libXdmcp
]
++ lib.optionals waylandSupport [
libxkbcommon
wayland
wayland-protocols
]
++ lib.optionals pipewireSupport [
pipewire
libsamplerate
]
++ lib.optionals pulseSupport [
pulseaudio
libsamplerate
];
cmakeFlags = [
"-DOPTIMIZE_FOR_NATIVE=OFF"
]
++ lib.optionals (!openGLSupport) [ "-DENABLE_OPENGL=no" ]
++ lib.optionals (!xorgSupport) [ "-DENABLE_X11=no" ]
++ lib.optionals (!waylandSupport) [ "-DENABLE_WAYLAND=no" ]
++ lib.optionals (!pulseSupport) [ "-DENABLE_PULSEAUDIO=no" ]
++ lib.optionals (!pipewireSupport) [ "-DENABLE_PIPEWIRE=no" ];
postUnpack = ''
echo ${finalAttrs.src.rev} > source/VERSION
export sourceRoot="source/client"
'';
postInstall = ''
mkdir -p $out/share/pixmaps
cp $src/resources/lg-logo.png $out/share/pixmaps
'';
meta = with lib; {
description = "KVM Frame Relay (KVMFR) implementation";
longDescription = ''
Looking Glass is an open source application that allows the use of a KVM
(Kernel-based Virtual Machine) configured for VGA PCI Pass-through
without an attached physical monitor, keyboard or mouse. This is the final
step required to move away from dual booting with other operating systems
for legacy programs that require high performance graphics.
'';
homepage = "https://looking-glass.io/";
license = licenses.gpl2Plus;
mainProgram = "looking-glass-client";
maintainers = with maintainers; [
alexbakker
babbaj
j-brn
];
platforms = [ "x86_64-linux" ];
};
})

View File

@@ -0,0 +1,51 @@
{
stdenvNoCC,
lib,
fetchurl,
unzip,
makeWrapper,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "loopwm";
version = "1.3.0";
src = fetchurl {
url = "https://github.com/MrKai77/Loop/releases/download/${finalAttrs.version}/Loop.zip";
hash = "sha256-UiEUdRKQLJdOj+fI4fmTi71TreP1gM+jr+53dhtESRE=";
};
sourceRoot = ".";
nativeBuildInputs = [
unzip
makeWrapper
];
dontPatch = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/{Applications,bin}
cp -r Loop.app $out/Applications
makeWrapper $out/Applications/Loop.app/Contents/MacOS/Loop $out/bin/loopwm \
--set LOOP_SKIP_UPDATE_CHECK 1
runHook postInstall
'';
passthru = {
updateScript = ./update.sh;
};
meta = {
description = "macOS Window management made elegant";
homepage = "https://github.com/MrKai77/Loop";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ matteopacini ];
mainProgram = "loopwm";
platforms = lib.platforms.darwin;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq gnused
set -euo pipefail
cd "$(dirname "$0")" || exit 1
# Grab latest release version
LOOPWM_LATEST_VER="$(curl --fail -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/MrKai77/Loop/releases/latest" | jq -r '.tag_name' | sed 's/^v//')"
LOOPWM_CURRENT_VER="$(grep -oP 'version = "\K[^"]+' package.nix)"
if [[ "$LOOPWM_LATEST_VER" == "$LOOPWM_CURRENT_VER" ]]; then
echo "loopwm is up-to-date"
exit 0
fi
LOOPWM_DARWIN_HASH="$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "https://github.com/MrKai77/Loop/releases/download/${LOOPWM_LATEST_VER}/Loop.zip")")"
sed -i "s#hash = \".*\"#hash = \"$LOOPWM_DARWIN_HASH\"#g" package.nix
sed -i "s#version = \".*\";#version = \"$LOOPWM_LATEST_VER\";#g" package.nix

View File

@@ -0,0 +1,40 @@
{
lib,
stdenvNoCC,
fetchFromGitHub,
nix-update-script,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "lora";
version = "3.006";
src = fetchFromGitHub {
owner = "cyrealtype";
repo = "lora";
tag = "v${finalAttrs.version}";
hash = "sha256-nNl2IC/KqYO6uS6ah0qWgesqm2cG8cIix/MhxbkOeAM=";
};
dontConfigure = true;
dontBuild = true;
passthru.updateScript = nix-update-script { };
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts/truetype
cp -R $src/fonts/ttf/*.ttf $out/share/fonts/truetype
runHook postInstall
'';
meta = {
description = "Lora Font: well-balanced contemporary serif with roots in calligraphy";
homepage = "https://github.com/cyrealtype/lora";
license = lib.licenses.ofl;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ ofalvai ];
};
})

View File

@@ -0,0 +1,35 @@
{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication rec {
pname = "loramon";
version = "0.9.7";
pyproject = true;
src = fetchFromGitHub {
owner = "markqvist";
repo = "LoRaMon";
tag = version;
hash = "sha256-94tXhuAoaS1y/zGz63PPqOayRylGK0Ei2a6H4/BCB30";
};
nativeBuildInputs = with python3.pkgs; [
setuptools
];
propagatedBuildInputs = with python3.pkgs; [
pyserial
];
meta = {
description = "LoRa packet sniffer for RNode hardware";
mainProgram = "loramon";
homepage = "https://github.com/markqvist/LoRaMon";
changelog = "https://github.com/markqvist/LoRaMon/releases/tag/${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ erethon ];
};
}

View File

@@ -0,0 +1,66 @@
{
lib,
cargo,
desktop-file-utils,
fetchFromGitLab,
glib,
gtk4,
libadwaita,
meson,
ninja,
nix-update-script,
pkg-config,
rustPlatform,
rustc,
stdenv,
wrapGAppsHook4,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lorem";
version = "1.5";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "World/design";
repo = "lorem";
rev = finalAttrs.version;
hash = "sha256-q6gpxxNebf2G/lT5wWXT/lVp3zR8QLWB8/sdK+wLTJ8=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-4JYYcfsEoCGJWZCp0273gXrf8hfuHL/QSsLEHvNa4uA=";
};
nativeBuildInputs = [
cargo
desktop-file-utils
meson
ninja
pkg-config
rustPlatform.cargoSetupHook
rustc
wrapGAppsHook4
];
buildInputs = [
glib
gtk4
libadwaita
];
passthru = {
updateScript = nix-update-script { };
};
meta = {
changelog = "https://gitlab.gnome.org/World/design/lorem/-/releases/${finalAttrs.version}";
description = "Generate placeholder text";
homepage = "https://apps.gnome.org/Lorem/";
license = lib.licenses.gpl3Plus;
mainProgram = "lorem";
teams = [ lib.teams.gnome-circle ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,141 @@
{
lib,
stdenv,
fetchFromGitHub,
autoPatchelfHook,
copyDesktopItems,
makeDesktopItem,
godot3-export-templates,
godot3-headless,
alsa-lib,
libGL,
libGLU,
libpulseaudio,
libX11,
libXcursor,
libXext,
libXfixes,
libXi,
libXinerama,
libXrandr,
libXrender,
zlib,
udev, # for libudev
}:
let
preset =
if stdenv.hostPlatform.isLinux then
"Linux/X11"
else if stdenv.hostPlatform.isDarwin then
"Mac OSX"
else
throw "unsupported platform";
in
stdenv.mkDerivation rec {
pname = "lorien";
version = "0.6.0";
src = fetchFromGitHub {
owner = "mbrlabs";
repo = "Lorien";
rev = "v${version}";
sha256 = "sha256-mPv/3hyLGF3IUy6cKfGoABidIsyw4UfmhfhS4AD72K8=";
};
nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
godot3-headless
];
buildInputs = [
alsa-lib
libGL
libGLU
libX11
libXcursor
libXext
libXfixes
libXi
libXinerama
libXrandr
libXrender
zlib
udev
];
desktopItems = [
(makeDesktopItem {
name = "lorien";
exec = "lorien";
icon = "lorien";
desktopName = "Lorien";
genericName = "Whiteboard";
comment = meta.description;
categories = [
"Graphics"
"Office"
];
keywords = [ "whiteboard" ];
})
];
buildPhase = ''
runHook preBuild
# Cannot create file '/homeless-shelter/.config/godot/projects/...'
export HOME=$TMPDIR
# Link the export-templates to the expected location. The --export commands
# expects the template-file at .../templates/{godot-version}.stable/linux_x11_64_release
mkdir -p $HOME/.local/share/godot
ln -s ${godot3-export-templates}/share/godot/templates $HOME/.local/share/godot
mkdir -p $out/share/lorien
godot3-headless --path lorien --export "${preset}" $out/share/lorien/lorien
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
ln -s $out/share/lorien/lorien $out/bin
# Patch binaries.
interpreter=$(cat $NIX_CC/nix-support/dynamic-linker)
patchelf \
--set-interpreter $interpreter \
--set-rpath ${lib.makeLibraryPath buildInputs} \
$out/share/lorien/lorien
install -Dm644 images/lorien.png $out/share/pixmaps/lorien.png
runHook postInstall
'';
runtimeDependencies = map lib.getLib [
alsa-lib
libpulseaudio
udev
];
meta = with lib; {
homepage = "https://github.com/mbrlabs/Lorien";
description = "Infinite canvas drawing/note-taking app";
longDescription = ''
An infinite canvas drawing/note-taking app that is focused on performance,
small savefiles and simplicity
'';
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ hqurve ];
mainProgram = "lorien";
};
}

View File

@@ -0,0 +1,78 @@
{
lib,
pkgs,
rustPackages,
fetchFromGitHub,
rustPlatform,
writers,
nixosTests,
}:
let
# Run `eval $(nix-build -A lorri.updater)` after updating the revision!
# It will copy some required files if necessary.
# Also dont forget to run `nix-build -A lorri.tests`
version = "1.7.1";
sha256 = "sha256-dEdKMgE4Jd8CCvtGQDZNDCYOomZAV8aR7Cmtyn8RfTo=";
cargoHash = "sha256-pRtc0cDVIBqbCbC1weFOhZP29rKAE1XdmM6HE5nJKRU=";
in
(rustPlatform.buildRustPackage rec {
pname = "lorri";
inherit version;
src = fetchFromGitHub {
owner = "nix-community";
repo = "lorri";
rev = version;
inherit sha256;
};
outputs = [
"out"
"man"
"doc"
];
inherit cargoHash;
doCheck = false;
BUILD_REV_COUNT = src.revCount or 1;
RUN_TIME_CLOSURE = pkgs.callPackage ./runtime.nix { };
nativeBuildInputs = [ rustPackages.rustfmt ];
# copy the docs to the $man and $doc outputs
postInstall = ''
install -Dm644 lorri.1 $man/share/man/man1/lorri.1
install -Dm644 -t $doc/share/doc/lorri/ \
README.md \
CONTRIBUTING.md \
LICENSE \
MAINTAINERS.md
cp -r contrib/ $doc/share/doc/lorri/contrib
'';
passthru = {
updater = writers.writeBash "copy-runtime-nix.sh" ''
set -euo pipefail
cp ${src}/nix/runtime.nix ${toString ./runtime.nix}
cp ${src}/nix/runtime-closure.nix.template ${toString ./runtime-closure.nix.template}
'';
tests = {
nixos = nixosTests.lorri;
};
};
meta = with lib; {
description = "Your project's nix-env";
homepage = "https://github.com/nix-community/lorri";
license = licenses.asl20;
maintainers = with maintainers; [
grahamc
Profpatsch
nyarly
];
mainProgram = "lorri";
};
})

View File

@@ -0,0 +1,37 @@
# Nix with sandboxing requires every path used at build time be
# explicitly declared. If we simply passed in the paths, they
# would be copied in as sources. Using builtins.storePath we're
# able to tell Nix that, no, in fact, treat these not as sources
# to copy, but instead of a regular store path.
#
# Include the explicit closure, too, otherwise we'll get mysterious
# "file not found" errors due to the glibc interpreter being
# missing.
let
# Magic inspired by Nix's config.nix:
# https://github.com/NixOS/nix/blob/f9a2ea44867cd1dbb408bca4df0ced806137b7f7/corepkgs/config.nix.in#L23
#
# If the dependency is in the Nix store we're using, refer to
# it as a literal store path. If it isn't, refer to it "normally".
#
# This makes sandboxing happy when in a nix-build, and the
# evaluation happy when in a «cargo build».
tools_build_host = @tools_build_host@;
# Compare the stringified version of the tools_build_host Nix store
# path to the evaluator's stringified Nix store path. Otherwise,
# Nix will read the sources in to the /nix/store, and, well,
# you can only copy the /nix/store in to the /nix/store so many
# times before you run out of disk space.
dep = if ("${toString (dirOf tools_build_host)}" == "${toString builtins.storeDir}")
then (builtins.trace "using storePath" builtins.storePath)
else (builtins.trace "using toString" toString) # assume we have no sandboxing
;
tools = dep tools_build_host;
in {
path = "${tools}/bin";
builder = "${tools}/bin/bash";
closure = import @runtime_closure_list@ { inherit dep; };
}

View File

@@ -0,0 +1,41 @@
{
# Plumbing tools:
closureInfo,
runCommand,
buildEnv,
# Actual dependencies to propagate:
bash,
coreutils,
}:
let
tools = buildEnv {
name = "lorri-runtime-tools";
paths = [
coreutils
bash
];
};
runtimeClosureInfo = closureInfo {
rootPaths = [ tools ];
};
closureToNix = runCommand "closure.nix" { } ''
(
echo '{ dep, ... }: ['
sed -E 's/^(.*)$/ (dep \1)/' ${runtimeClosureInfo}/store-paths
echo ']'
) > $out
'';
runtimeClosureInfoAsNix =
runCommand "runtime-closure.nix"
{
runtime_closure_list = closureToNix;
tools_build_host = tools;
}
''
substituteAll ${./runtime-closure.nix.template} $out
'';
in
runtimeClosureInfoAsNix

View File

@@ -0,0 +1,36 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
}:
stdenv.mkDerivation {
pname = "losslessaudiochecker";
version = "2.0.5";
src = fetchurl {
url = "https://web.archive.org/web/20211119122205/https://losslessaudiochecker.com/dl/LAC-Linux-64bit.tar.gz";
sha256 = "1i1zbl7sqwxwmhw89lgz922l5k85in3y76zb06h8j3zd0lb20wkq";
};
nativeBuildInputs = [ autoPatchelfHook ];
sourceRoot = ".";
dontBuild = true;
installPhase = ''
install LAC -D -t $out/bin
'';
meta = {
description = "Utility to check whether audio is truly lossless or not";
homepage = "https://losslessaudiochecker.com";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ p-h ];
mainProgram = "LAC";
};
}

View File

@@ -0,0 +1,50 @@
{
appimageTools,
fetchurl,
makeWrapper,
pname,
version,
hash,
metaCommon ? { },
}:
let
src = fetchurl {
url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-linux-x86_64.AppImage";
inherit hash;
};
extracted = appimageTools.extractType2 {
inherit pname version src;
};
in
appimageTools.wrapType2 {
inherit pname version src;
nativeBuildInputs = [ makeWrapper ];
profile = ''
export LC_ALL=C.UTF-8
'';
extraInstallCommands = ''
(
mkdir -p $out/share
cd ${extracted}/usr
find share -mindepth 1 -type d -exec mkdir -p $out/{} \;
find share -mindepth 1 -type f,l -exec ln -s $PWD/{} $out/{} \;
)
ln -s ${extracted}/losslesscut.png $out/share/icons/losslesscut.png
mkdir $out/share/applications
cp ${extracted}/losslesscut.desktop $out/share/applications
substituteInPlace $out/share/applications/losslesscut.desktop \
--replace AppRun losslesscut
wrapProgram "$out/bin/losslesscut" \
--add-flags "--disable-seccomp-filter-sandbox"
'';
meta = metaCommon // {
platforms = [ "x86_64-linux" ];
mainProgram = "losslesscut";
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenvNoCC,
fetchurl,
_7zz,
pname,
version,
hash,
isAarch64,
metaCommon ? { },
}:
stdenvNoCC.mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-mac-${
if isAarch64 then "arm64" else "x64"
}.dmg";
inherit hash;
};
nativeBuildInputs = [ _7zz ];
sourceRoot = "LosslessCut.app";
installPhase = ''
runHook preInstall
mkdir -p "$out/Applications"
cd ..
mv "$sourceRoot" "$out/Applications"
mkdir -p "$out/bin"
ln -s "$out/Applications/$(basename "$sourceRoot")/Contents/MacOS/LosslessCut" "$out/bin/losslesscut"
runHook postInstall
'';
meta =
metaCommon
// (with lib; {
platforms = if isAarch64 then [ "aarch64-darwin" ] else platforms.darwin;
mainProgram = "losslesscut";
});
}

View File

@@ -0,0 +1,45 @@
{
lib,
stdenvNoCC,
fetchurl,
p7zip,
pname,
version,
hash,
metaCommon ? { },
}:
stdenvNoCC.mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-win-x64.7z";
inherit hash;
};
nativeBuildInputs = [ p7zip ];
unpackPhase = ''
runHook preUnpack
7z x "$src" -o"$sourceRoot"
runHook postUnpack
'';
sourceRoot = "LosslessCut-win-x64";
installPhase = ''
runHook preInstall
mkdir -p "$out/bin" "$out/libexec"
cd ..
mv "$sourceRoot" "$out/libexec"
ln -s "$out/libexec/$(basename "$sourceRoot")/LosslessCut.exe" "$out/bin/LosslessCut.exe"
runHook postInstall
'';
meta =
metaCommon
// (with lib; {
platforms = platforms.windows;
mainProgram = "LosslessCut.exe";
});
}

View File

@@ -0,0 +1,66 @@
{
lib,
stdenv,
callPackage,
buildPackages,
}:
let
pname = "losslesscut";
version = "3.64.0";
metaCommon = with lib; {
description = "Swiss army knife of lossless video/audio editing";
homepage = "https://mifi.no/losslesscut/";
license = licenses.gpl2Only;
maintainers = with maintainers; [ ShamrockLee ];
mainProgram = "losslesscut";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
};
x86_64-appimage = callPackage ./build-from-appimage.nix {
inherit pname version metaCommon;
hash = "sha256-K90cJuJFcIkPuAQusJcOBkZ5PQ8T25q7IFIhtmK+jzc=";
inherit (buildPackages) makeWrapper;
};
x86_64-dmg = callPackage ./build-from-dmg.nix {
inherit pname version metaCommon;
hash = "sha256-BO2KoYAevbVL0Eix1knvaPVBkWucYI89VkueWYRTcXY=";
isAarch64 = false;
};
aarch64-dmg = callPackage ./build-from-dmg.nix {
inherit pname version metaCommon;
hash = "sha256-/M5yafZQDqCoDzHpjZBC80CcL9KMO5lwvyCcq19caRg=";
isAarch64 = true;
};
x86_64-windows = callPackage ./build-from-windows.nix {
inherit pname version metaCommon;
hash = "sha256-FYrnTiZ5ATT+Y08zceIIHbVM//5Bg2ozIEyC5UxmIno=";
};
in
(
if stdenv.hostPlatform.system == "aarch64-darwin" then
aarch64-dmg
else if stdenv.hostPlatform.isDarwin then
x86_64-dmg
else if stdenv.hostPlatform.isCygwin then
x86_64-windows
else
x86_64-appimage
).overrideAttrs
(oldAttrs: {
passthru = (oldAttrs.passthru or { }) // {
inherit
x86_64-appimage
x86_64-dmg
aarch64-dmg
x86_64-windows
;
};
meta = oldAttrs.meta // {
platforms = lib.unique (
x86_64-appimage.meta.platforms
++ x86_64-dmg.meta.platforms
++ aarch64-dmg.meta.platforms
++ x86_64-windows.meta.platforms
);
};
})

View File

@@ -0,0 +1,51 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
libpng,
rlottie,
giflib,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "lottieconverter";
version = "0.2";
src = fetchFromGitHub {
owner = "sot-tech";
repo = "lottieconverter";
rev = "r${finalAttrs.version}";
hash = "sha256-oCFQsOQbWzmzClaTOeuEtGo7uXoKYtaJuSLLgqAQP1M=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
libpng
rlottie
giflib
];
cmakeFlags = [
"-DSYSTEM_RL=1"
"-DSYSTEM_GL=1"
];
installPhase = ''
runHook preInstall
install -Dm755 lottieconverter "$out/bin/lottieconverter"
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/sot-tech/LottieConverter/";
description = "Lottie converter utility";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [
CRTified
nickcao
];
mainProgram = "lottieconverter";
};
})

View File

@@ -0,0 +1,23 @@
From ad9c7f8ddf0907d408b3d2fbf4d00ecb55af8d13 Mon Sep 17 00:00:00 2001
From: Hugh McMaster <hugh.mcmaster@outlook.com>
Date: Mon, 29 Jul 2024 23:13:16 +1000
Subject: [PATCH] src/scan.c: Declare "AVCodec" to be "const AVCodec"
This fixes compilation with GCC-14.
---
src/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scan.c b/src/scan.c
index 85b36b3..e02ed86 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -115,7 +115,7 @@ int scan_file(const char *file, unsigned index) {
AVFormatContext *container = NULL;
- AVCodec *codec;
+ const AVCodec *codec;
AVCodecContext *ctx;
AVFrame *frame;

View File

@@ -0,0 +1,58 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
ffmpeg,
libebur128,
libresample,
taglib_1,
zlib,
}:
stdenv.mkDerivation rec {
pname = "loudgain";
version = "0.6.8";
src = fetchFromGitHub {
owner = "Moonbase59";
repo = "loudgain";
rev = "v${version}";
hash = "sha256-XLj+n0GlY/GAkJlW2JVMd0jxMzgdv/YeSTuF6QUIGwU=";
};
patches = [
# src/scan.c: Only call av_register_all() if using libavformat < 58.9.100
# https://github.com/Moonbase59/loudgain/pull/50
./support-ffmpeg-5.patch
# src/scan.c: Declare "AVCodec" to be "const AVCodec"
# https://github.com/Moonbase59/loudgain/pull/65
./fix-gcc-14.patch
# src/scan.c: Update for FFmpeg 7.0
# https://github.com/Moonbase59/loudgain/pull/66
./support-ffmpeg-7.patch
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
ffmpeg
libebur128
libresample
taglib_1
zlib
];
postInstall = ''
sed -e "1aPATH=$out/bin:\$PATH" -i "$out/bin/rgbpm"
'';
meta = src.meta // {
license = lib.licenses.free;
};
}

View File

@@ -0,0 +1,29 @@
From 977332e9e45477b1b41a5af7a2484f92b340413b Mon Sep 17 00:00:00 2001
From: Hugh McMaster <hugh.mcmaster@outlook.com>
Date: Thu, 1 Sep 2022 14:44:17 +1000
Subject: [PATCH] src/scan.c: Only call av_register_all() if using libavformat
< 58.9.100
This function is deprecated.
Thanks to Leigh Scott for suggesting this patch.
---
src/scan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/scan.c b/src/scan.c
index 85b36b3..ee72cf8 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -69,9 +69,9 @@ int scan_init(unsigned nb_files) {
* It is now useless
* https://github.com/FFmpeg/FFmpeg/blob/70d25268c21cbee5f08304da95be1f647c630c15/doc/APIchanges#L86
*/
- if (avformat_version() < AV_VERSION_INT(58,9,100))
+#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(58,9,100)
av_register_all();
-
+#endif
av_log_set_callback(scan_av_log);
scan_nb_files = nb_files;

View File

@@ -0,0 +1,123 @@
From 50741b98fb4b932759f05e8d208d80d93bcc8261 Mon Sep 17 00:00:00 2001
From: Hugh McMaster <hugh.mcmaster@outlook.com>
Date: Mon, 29 Jul 2024 23:15:35 +1000
Subject: [PATCH] src/scan.c: Update for FFmpeg 7.0
---
src/scan.c | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/src/scan.c b/src/scan.c
index 85b36b3..91eb261 100644
--- a/src/scan.c
+++ b/src/scan.c
@@ -119,7 +119,7 @@ int scan_file(const char *file, unsigned index) {
AVCodecContext *ctx;
AVFrame *frame;
- AVPacket packet;
+ AVPacket *packet;
SwrContext *swr;
@@ -177,8 +177,8 @@ int scan_file(const char *file, unsigned index) {
}
// try to get default channel layout (they arent specified in .wav files)
- if (!ctx->channel_layout)
- ctx->channel_layout = av_get_default_channel_layout(ctx->channels);
+ if (ctx->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC)
+ av_channel_layout_default(&ctx->ch_layout, ctx->ch_layout.nb_channels);
// show some information about the file
// only show bits/sample where it makes sense
@@ -187,21 +187,21 @@ int scan_file(const char *file, unsigned index) {
snprintf(infotext, sizeof(infotext), "%d bit, ",
ctx->bits_per_raw_sample > 0 ? ctx->bits_per_raw_sample : ctx->bits_per_coded_sample);
}
- av_get_channel_layout_string(infobuf, sizeof(infobuf), -1, ctx->channel_layout);
+ av_channel_layout_describe(&ctx->ch_layout, infobuf, sizeof(infobuf));
ok_printf("Stream #%d: %s, %s%d Hz, %d ch, %s",
- stream_id, codec->long_name, infotext, ctx->sample_rate, ctx->channels, infobuf);
+ stream_id, codec->long_name, infotext, ctx->sample_rate, ctx->ch_layout.nb_channels, infobuf);
scan_codecs[index] = codec -> id;
- av_init_packet(&packet);
+ packet = av_packet_alloc();
- packet.data = buffer;
- packet.size = buffer_size;
+ packet->data = buffer;
+ packet->size = buffer_size;
swr = swr_alloc();
*ebur128 = ebur128_init(
- ctx -> channels, ctx -> sample_rate,
+ ctx->ch_layout.nb_channels, ctx->sample_rate,
EBUR128_MODE_S | EBUR128_MODE_I | EBUR128_MODE_LRA |
EBUR128_MODE_SAMPLE_PEAK | EBUR128_MODE_TRUE_PEAK
);
@@ -222,10 +222,10 @@ int scan_file(const char *file, unsigned index) {
progress_bar(0, 0, 0, 0);
- while (av_read_frame(container, &packet) >= 0) {
- if (packet.stream_index == stream_id) {
+ while (av_read_frame(container, packet) >= 0) {
+ if (packet->stream_index == stream_id) {
- rc = avcodec_send_packet(ctx, &packet);
+ rc = avcodec_send_packet(ctx, packet);
if (rc < 0) {
err_printf("Error while sending a packet to the decoder");
break;
@@ -252,7 +252,7 @@ int scan_file(const char *file, unsigned index) {
av_frame_unref(frame);
}
- av_packet_unref(&packet);
+ av_packet_unref(packet);
}
// complete progress bar for very short files (only cosmetic)
@@ -263,9 +263,11 @@ int scan_file(const char *file, unsigned index) {
av_frame_free(&frame);
+ av_packet_free(&packet);
+
swr_free(&swr);
- avcodec_close(ctx);
+ avcodec_free_context(&ctx);
avformat_close_input(&container);
@@ -413,12 +415,12 @@ static void scan_frame(ebur128_state *ebur128, AVFrame *frame,
int out_linesize;
enum AVSampleFormat out_fmt = AV_SAMPLE_FMT_S16;
- av_opt_set_channel_layout(swr, "in_channel_layout", frame -> channel_layout, 0);
- av_opt_set_channel_layout(swr, "out_channel_layout", frame -> channel_layout, 0);
+ av_opt_set_chlayout(swr, "in_chlayout", &frame->ch_layout, 0);
+ av_opt_set_chlayout(swr, "out_chlayout", &frame->ch_layout, 0);
// add channel count to properly handle .wav reading
- av_opt_set_int(swr, "in_channel_count", frame -> channels, 0);
- av_opt_set_int(swr, "out_channel_count", frame -> channels, 0);
+ av_opt_set_int(swr, "in_channel_count", frame->ch_layout.nb_channels, 0);
+ av_opt_set_int(swr, "out_channel_count", frame->ch_layout.nb_channels, 0);
av_opt_set_int(swr, "in_sample_rate", frame -> sample_rate, 0);
av_opt_set_int(swr, "out_sample_rate", frame -> sample_rate, 0);
@@ -434,7 +436,7 @@ static void scan_frame(ebur128_state *ebur128, AVFrame *frame,
}
out_size = av_samples_get_buffer_size(
- &out_linesize, frame -> channels, frame -> nb_samples, out_fmt, 0
+ &out_linesize, frame->ch_layout.nb_channels, frame->nb_samples, out_fmt, 0
);
out_data = av_malloc(out_size);

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
fetchurl,
openssl,
libidn,
glib,
pkg-config,
zlib,
}:
stdenv.mkDerivation rec {
version = "1.5.3";
pname = "loudmouth";
src = fetchurl {
url = "https://mcabber.com/files/loudmouth/${pname}-${version}.tar.bz2";
sha256 = "0b6kd5gpndl9nzis3n6hcl0ldz74bnbiypqgqa1vgb0vrcar8cjl";
};
configureFlags = [ "--with-ssl=openssl" ];
propagatedBuildInputs = [
openssl
libidn
glib
zlib
];
nativeBuildInputs = [ pkg-config ];
meta = with lib; {
description = "Lightweight C library for the Jabber protocol";
platforms = platforms.all;
downloadPage = "http://mcabber.com/files/loudmouth/";
license = licenses.lgpl21;
};
}

View File

@@ -0,0 +1,55 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
ninja,
sassc,
gtk3,
gnome-shell,
gdk-pixbuf,
librsvg,
gtk-engine-murrine,
}:
stdenv.mkDerivation rec {
pname = "lounge-gtk-theme";
version = "1.24";
src = fetchFromGitHub {
owner = "monday15";
repo = "lounge-gtk-theme";
rev = version;
sha256 = "0ima0aa5j296xn4y0d1zj6vcdrdpnihqdidj7bncxzgbnli1vazs";
};
nativeBuildInputs = [
meson
ninja
sassc
gtk3
];
buildInputs = [
gdk-pixbuf
librsvg
];
propagatedUserEnvPkgs = [ gtk-engine-murrine ];
mesonFlags = [
"-D gnome_version=${lib.versions.majorMinor gnome-shell.version}"
];
postFixup = ''
gtk-update-icon-cache "$out"/share/icons/Lounge-aux;
'';
meta = with lib; {
description = "Simple and clean GTK theme with vintage scrollbars, inspired by Absolute, based on Adwaita";
homepage = "https://github.com/monday15/lounge-gtk-theme";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = [ maintainers.romildo ];
};
}

View File

@@ -0,0 +1,125 @@
{
stdenv,
lib,
fetchurl,
cargo,
desktop-file-utils,
itstool,
meson,
ninja,
pkg-config,
rustc,
wrapGAppsHook4,
gtk4,
lcms2,
libadwaita,
libgweather,
libseccomp,
glycin-loaders,
gnome,
common-updater-scripts,
_experimental-update-script-combinators,
rustPlatform,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "loupe";
version = "48.1";
src = fetchurl {
url = "mirror://gnome/sources/loupe/${lib.versions.major finalAttrs.version}/loupe-${finalAttrs.version}.tar.xz";
hash = "sha256-EHE9PpZ4nQd659M4lFKl9sOX3fQ6UMBxy/4tEnJZcN4=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
name = "loupe-deps-${finalAttrs.version}";
hash = "sha256-PKkyZDd4FLWGZ/kDKWkaSV8p8NDniSQGcR9Htce6uCg=";
};
postPatch = ''
substituteInPlace src/meson.build --replace-fail \
"'src' / rust_target / meson.project_name()," \
"'src' / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / meson.project_name()," \
'';
nativeBuildInputs = [
cargo
desktop-file-utils
itstool
meson
ninja
pkg-config
rustc
rustPlatform.cargoSetupHook
wrapGAppsHook4
];
buildInputs = [
gtk4
lcms2
libadwaita
libgweather
libseccomp
];
preConfigure = ''
# Dirty approach to add patches after cargoSetupPostUnpackHook
# We should eventually use a cargo vendor patch hook instead
pushd ../$(stripHash $cargoDeps)/glycin-2.*
patch -p3 < ${glycin-loaders.passthru.glycinPathsPatch}
popd
'';
preFixup = ''
# Needed for the glycin crate to find loaders.
# https://gitlab.gnome.org/sophie-h/glycin/-/blob/0.1.beta.2/glycin/src/config.rs#L44
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${glycin-loaders}/share"
)
'';
# For https://gitlab.gnome.org/GNOME/loupe/-/blob/0e6ddb0227ac4f1c55907f8b43eaef4bb1d3ce70/src/meson.build#L34-35
env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;
passthru = {
updateScript =
let
updateSource = gnome.updateScript {
packageName = "loupe";
};
updateLockfile = {
command = [
"sh"
"-c"
''
PATH=${
lib.makeBinPath [
common-updater-scripts
]
}
update-source-version loupe --ignore-same-version --source-key=cargoDeps.vendorStaging > /dev/null
''
];
# Experimental feature: do not copy!
supportedFeatures = [ "silent" ];
};
in
_experimental-update-script-combinators.sequence [
updateSource
updateLockfile
];
};
meta = with lib; {
homepage = "https://gitlab.gnome.org/GNOME/loupe";
changelog = "https://gitlab.gnome.org/GNOME/loupe/-/blob/${finalAttrs.version}/NEWS?ref_type=tags";
description = "Simple image viewer application written with GTK4 and Rust";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ jk ];
teams = [ teams.gnome ];
platforms = platforms.unix;
mainProgram = "loupe";
};
})

View File

@@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
ghostscript,
}:
stdenv.mkDerivation rec {
pname = "lout";
version = "3.43.2";
src = fetchFromGitHub {
owner = "william8000";
repo = "lout";
rev = version;
hash = "sha256-8WMRnlb1EGtUo8g9yoIBinKb1ICZMqUZka/5950Lc1M=";
};
buildInputs = [ ghostscript ];
makeFlags = [
"PREFIX=$(out)/"
"CC=${stdenv.cc.targetPrefix}cc"
];
meta = {
description = "Document layout system similar in style to LaTeX";
longDescription = ''
The Lout document formatting system is now reads a high-level
description of a document similar in style to LaTeX and produces
a PostScript or plain text output file.
Lout offers an unprecedented range of advanced features,
including optimal paragraph and page breaking, automatic
hyphenation, PostScript EPS file inclusion and generation,
equation formatting, tables, diagrams, rotation and scaling,
sorted indexes, bibliographic databases, running headers and
odd-even pages, automatic cross referencing, multilingual
documents including hyphenation (most European languages are
supported), formatting of computer programs, and much more, all
ready to use. Furthermore, Lout is easily extended with
definitions which are very much easier to write than troff of
TeX macros because Lout is a high-level, purely functional
language, the outcome of an eight-year research project that
went back to the beginning.
'';
homepage = "https://github.com/william8000/lout";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
maintainers = [ ];
};
}

View File

@@ -0,0 +1,31 @@
{
stdenv,
fetchFromGitHub,
cmake,
lib,
unstableGitUpdater,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "louvain-community";
version = "0-unstable-2024-01-30";
src = fetchFromGitHub {
owner = "meelgroup";
repo = "louvain-community";
rev = "681a711a530ded0b25af72ee4881d453a80ac8ac";
hash = "sha256-mp2gneTtm/PaCqz4JNOZgdKmFoV5ZRVwNYjHc4s2KuY=";
};
nativeBuildInputs = [ cmake ];
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "Louvain Community Detection Library";
homepage = "https://github.com/meelgroup/louvain-community";
license = licenses.lgpl3Only;
maintainers = with maintainers; [ t4ccer ];
platforms = platforms.unix;
};
})

View File

@@ -0,0 +1,83 @@
{
lib,
stdenv,
fetchFromGitHub,
meson,
ninja,
pkg-config,
fontconfig,
icu,
libdrm,
libGL,
libinput,
libX11,
libXcursor,
libxkbcommon,
libgbm,
pixman,
seatd,
srm-cuarzo,
udev,
wayland,
xorgproto,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "louvre";
version = "2.18.1-1";
src = fetchFromGitHub {
owner = "CuarzoSoftware";
repo = "Louvre";
rev = "v${finalAttrs.version}";
hash = "sha256-wkOY3ARq7x3roRflRN8rMSbrI5B4amI+0CVJmfLYx2w=";
};
sourceRoot = "${finalAttrs.src.name}/src";
postPatch = ''
substituteInPlace examples/meson.build \
--replace-fail "/usr/local/share/wayland-sessions" "${placeholder "out"}/share/wayland-sessions"
'';
nativeBuildInputs = [
meson
ninja
pkg-config
];
buildInputs = [
fontconfig
icu
libdrm
libGL
libinput
libX11
libXcursor
libxkbcommon
libgbm
pixman
seatd
srm-cuarzo
udev
wayland
xorgproto
];
outputs = [
"out"
"dev"
];
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "C++ library for building Wayland compositors";
homepage = "https://github.com/CuarzoSoftware/Louvre";
mainProgram = "louvre-views";
maintainers = [ ];
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,53 @@
{
fetchFromGitHub,
rustPlatform,
lib,
versionCheckHook,
writeShellScript,
lua,
}:
let
version = "0.7.1";
in
rustPlatform.buildRustPackage {
pname = "lovely-injector";
inherit version;
src = fetchFromGitHub {
owner = "ethangreen-dev";
repo = "lovely-injector";
tag = "v${version}";
hash = "sha256-j03/DOnLFfFYTwGGh+7BalS779jyg+p0UqtcTTyHgv4=";
};
cargoHash = "sha256-hHq26kSKcqEldxUb6bn1laTpKGFplP9/2uogsal8T5A=";
# no tests
doCheck = false;
# lovely-injector depends on nightly rust features
env.RUSTC_BOOTSTRAP = 1;
nativeBuildInputs = [
lua
];
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgramArg = [ "${placeholder "out"}" ];
versionCheckProgram = writeShellScript "lovely-version-check" ''
export LD_PRELOAD="$1/lib/liblovely.so"
exec ${lua}/bin/lua < /dev/null
'';
meta = {
description = "Runtime lua injector for games built with LÖVE";
longDescription = ''
Lovely is a lua injector which embeds code into a LÖVE 2d game at runtime.
Unlike executable patchers, mods can be installed, updated, and removed over and over again without requiring a partial or total game reinstallation.
This is accomplished through in-process lua API detouring and an easy to use (and distribute) patch system.
'';
license = lib.licenses.mit;
homepage = "https://github.com/ethangreen-dev/lovely-injector";
downloadPage = "https://github.com/ethangreen-dev/lovely-injector/releases";
maintainers = [ lib.maintainers.antipatico ];
platforms = [ "x86_64-linux" ];
};
}

View File

@@ -0,0 +1,126 @@
{
lib,
stdenv,
fetchurl,
fixDarwinDylibNames,
which,
dieHook,
bmake,
enableShared ? !stdenv.hostPlatform.isStatic,
enableStatic ? stdenv.hostPlatform.isStatic,
enableDarwinSandbox ? true,
# for passthru.tests
nix,
}:
stdenv.mkDerivation rec {
pname = "lowdown${
lib.optionalString (stdenv.hostPlatform.isDarwin && !enableDarwinSandbox) "-unsandboxed"
}";
version = "2.0.2";
outputs = [
"out"
"lib"
"dev"
"man"
];
src = fetchurl {
url = "https://kristaps.bsd.lv/lowdown/snapshots/lowdown-${version}.tar.gz";
hash = "sha512-cfzhuF4EnGmLJf5EGSIbWqJItY3npbRSALm+GarZ7SMU7Hr1xw0gtBFMpOdi5PBar4TgtvbnG4oRPh+COINGlA==";
};
nativeBuildInputs = [
which
dieHook
bmake # Uses FreeBSD's dialect
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
# The Darwin sandbox calls fail inside Nix builds, presumably due to
# being nested inside another sandbox.
preConfigure = lib.optionalString (stdenv.hostPlatform.isDarwin && !enableDarwinSandbox) ''
echo 'HAVE_SANDBOX_INIT=0' > configure.local
'';
configurePhase = ''
runHook preConfigure
./configure PREFIX=''${!outputDev} \
BINDIR=''${!outputBin}/bin \
LIBDIR=''${!outputLib}/lib \
MANDIR=''${!outputMan}/share/man
runHook postConfigure
'';
# Fix rpath change on darwin to avoid failure like:
# error: install_name_tool: changing install names or
# rpaths can't be redone for: liblowdown.1.dylib (for architecture
# arm64) because larger
# https://github.com/NixOS/nixpkgs/pull/344532#issuecomment-238475791
env.NIX_CFLAGS_LINK = lib.optionalString stdenv.hostPlatform.isDarwin "-headerpad_max_install_names";
makeFlags = [
"bins" # prevents shared object from being built unnecessarily
];
installTargets = [
"install"
]
++ lib.optionals enableShared [
"install_shared"
]
++ lib.optionals enableStatic [
"install_static"
];
postInstall =
let
soVersion = "2";
in
# Check that soVersion is up to date even if we are not on darwin
lib.optionalString (enableShared && !stdenv.hostPlatform.isDarwin) ''
test -f $lib/lib/liblowdown.so.${soVersion} || \
die "postInstall: expected $lib/lib/liblowdown.so.${soVersion} is missing"
''
# Fix lib extension so that fixDarwinDylibNames detects it, see
# <https://github.com/kristapsdz/lowdown/issues/87#issuecomment-1532243650>.
+ lib.optionalString (enableShared && stdenv.hostPlatform.isDarwin) ''
darwinDylib="$lib/lib/liblowdown.${soVersion}.dylib"
mv "$lib/lib/liblowdown.so.${soVersion}" "$darwinDylib"
# Make sure we are re-creating a symbolic link here
test -L "$lib/lib/liblowdown.so" || \
die "postInstall: expected $lib/lib/liblowdown.so to be a symlink"
ln -s "$darwinDylib" "$lib/lib/liblowdown.dylib"
rm "$lib/lib/liblowdown.so"
'';
doInstallCheck = true;
installCheckPhase = lib.optionalString (!stdenv.hostPlatform.isDarwin || !enableDarwinSandbox) ''
runHook preInstallCheck
echo '# TEST' > test.md
$out/bin/lowdown test.md
runHook postInstallCheck
'';
doCheck = true;
checkTarget = "regress";
passthru.tests = {
# most important consumer in nixpkgs
inherit nix;
};
meta = with lib; {
homepage = "https://kristaps.bsd.lv/lowdown/";
description = "Simple markdown translator";
license = licenses.isc;
maintainers = [ maintainers.sternenseemann ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
openssl,
stdenv,
alsa-lib,
}:
rustPlatform.buildRustPackage rec {
pname = "lowfi";
version = "1.7.2";
src = fetchFromGitHub {
owner = "talwat";
repo = "lowfi";
tag = version;
hash = "sha256-0Oim1nGll76APjjfNCuJgjOlEJxAU6vZteECEFhsWkI=";
};
cargoHash = "sha256-vInuM96TJuewhFafDkhOiZiyxwc6SeBsSH8Fs8YIRRs=";
buildFeatures = lib.optionals stdenv.hostPlatform.isLinux [ "mpris" ];
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
];
buildInputs = [
openssl
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
];
meta = {
description = "Extremely simple lofi player";
homepage = "https://github.com/talwat/lowfi";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ zsenai ];
mainProgram = "lowfi";
};
}

View File

@@ -0,0 +1,54 @@
{
lib,
python3,
fetchFromGitHub,
}:
python3.pkgs.buildPythonApplication {
pname = "loxodo";
version = "0-unstable-2021-02-08";
format = "pyproject";
src = fetchFromGitHub {
owner = "sommer";
repo = "loxodo";
rev = "7add982135545817e9b3e2bbd0d27a2763866133";
sha256 = "1cips4pvrqga8q1ibs23vjrf8dwan860x8jvjmc52h6qvvvv60yl";
};
patches = [ ./wxpython.patch ];
build-system = with python3.pkgs; [
setuptools
];
dependencies = with python3.pkgs; [
six
wxpython
];
postInstall = ''
mv $out/bin/loxodo.py $out/bin/loxodo
mkdir -p $out/share/applications
cat > $out/share/applications/loxodo.desktop <<EOF
[Desktop Entry]
Type=Application
Exec=$out/bin/loxodo
Icon=$out/${python3.sitePackages}/resources/loxodo-icon.png
Name=Loxodo
GenericName=Password Vault
Categories=Application;Other;
EOF
'';
doCheck = false; # Tests are interactive.
meta = with lib; {
description = "Password Safe V3 compatible password vault";
mainProgram = "loxodo";
homepage = "https://www.christoph-sommer.de/loxodo/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ ];
};
}

Some files were not shown because too many files have changed in this diff Show More