commit
db6a26db02
@ -0,0 +1,6 @@ |
||||
# Linking NixOS tests to packages {#sec-linking-nixos-tests-to-packages} |
||||
|
||||
You can link NixOS module tests to the packages that they exercised, |
||||
so that the tests can be run automatically during code review when the package gets changed. |
||||
This is |
||||
[described in the nixpkgs manual](https://nixos.org/manual/nixpkgs/stable/#ssec-nixos-tests-linking). |
@ -0,0 +1,10 @@ |
||||
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-linking-nixos-tests-to-packages"> |
||||
<title>Linking NixOS tests to packages</title> |
||||
<para> |
||||
You can link NixOS module tests to the packages that they exercised, |
||||
so that the tests can be run automatically during code review when |
||||
the package gets changed. This is |
||||
<link xlink:href="https://nixos.org/manual/nixpkgs/stable/#ssec-nixos-tests-linking">described |
||||
in the nixpkgs manual</link>. |
||||
</para> |
||||
</section> |
@ -0,0 +1,41 @@ |
||||
{ mkDerivation, lib, fetchFromGitLab, fetchpatch, qtsvg, qtbase, libcsys, libcprime, cmake, ninja, }: |
||||
|
||||
mkDerivation rec { |
||||
pname = "coreaction"; |
||||
version = "4.2.0"; |
||||
|
||||
src = fetchFromGitLab { |
||||
owner = "cubocore/coreapps"; |
||||
repo = pname; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-5qEZNLvbgLoAOXij0wXoVw2iyvytsYZikSJDm6F6ddc="; |
||||
}; |
||||
|
||||
patches = [ |
||||
## Fix Plugin Error: "The shared library was not found." "libbatery.so" |
||||
(fetchpatch { |
||||
url = "https://gitlab.com/cubocore/coreapps/coreaction/-/commit/1d1307363614a117978723eaad2332e6e8c05b28.patch"; |
||||
sha256 = "039x19rsm23l9vxd5mnbl6gvc3is0igahf47kv54v6apz2q72l3f"; |
||||
}) |
||||
]; |
||||
|
||||
nativeBuildInputs = [ |
||||
cmake |
||||
ninja |
||||
]; |
||||
|
||||
buildInputs = [ |
||||
qtsvg |
||||
qtbase |
||||
libcsys |
||||
libcprime |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
description = "A side bar for showing widgets from the C Suite"; |
||||
homepage = "https://gitlab.com/cubocore/coreapps/coreaction"; |
||||
license = licenses.gpl3Plus; |
||||
maintainers = with maintainers; [ dan4ik605743 ]; |
||||
platforms = platforms.linux; |
||||
}; |
||||
} |
@ -0,0 +1,31 @@ |
||||
{ mkDerivation, lib, fetchFromGitLab, udisks2, qtbase, cmake, ninja, }: |
||||
|
||||
mkDerivation rec { |
||||
pname = "libcsys"; |
||||
version = "4.2.0"; |
||||
|
||||
src = fetchFromGitLab { |
||||
owner = "cubocore"; |
||||
repo = pname; |
||||
rev = "v${version}"; |
||||
sha256 = "sha256-9LH95uJJIn4FHfnikGi5UCI6nUNW+1cSZnJ/KpZDI5Y="; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ |
||||
cmake |
||||
ninja |
||||
]; |
||||
|
||||
buildInputs = [ |
||||
qtbase |
||||
udisks2 |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
description = "Library for managing drive and getting system resource information in real time"; |
||||
homepage = "https://gitlab.com/cubocore/libcsys"; |
||||
license = licenses.gpl3Plus; |
||||
maintainers = with maintainers; [ dan4ik605743 ]; |
||||
platforms = platforms.linux; |
||||
}; |
||||
} |
@ -0,0 +1,27 @@ |
||||
{ lib, buildPythonPackage, fetchFromGitHub, requests, mock, httpretty, pytestCheckHook }: |
||||
|
||||
buildPythonPackage rec { |
||||
pname = "youtube-transcript-api"; |
||||
version = "0.4.1"; |
||||
|
||||
# PyPI tarball is missing some test files |
||||
src = fetchFromGitHub { |
||||
owner = "jdepoix"; |
||||
repo = "youtube-transcript-api"; |
||||
rev = "v${version}"; |
||||
sha256 = "1gpk13j1n2bifwsg951gmrfnq8kfxjr15rq46dxn1bhyk9hr1zql"; |
||||
}; |
||||
|
||||
propagatedBuildInputs = [ requests ]; |
||||
|
||||
checkInputs = [ mock httpretty pytestCheckHook ]; |
||||
|
||||
pythonImportsCheck = [ "youtube_transcript_api" ]; |
||||
|
||||
meta = with lib; { |
||||
description = "Python API which allows you to get the transcripts/subtitles for a given YouTube video"; |
||||
homepage = "https://github.com/jdepoix/youtube-transcript-api"; |
||||
license = licenses.mit; |
||||
maintainers = [ maintainers.marsam ]; |
||||
}; |
||||
} |
@ -1,80 +1,82 @@ |
||||
{stdenv, lib, dict}: |
||||
({dictlist, allowList ? ["127.0.0.1"], denyList ? []}: |
||||
{ stdenv, lib, dict }: |
||||
({ dictlist, allowList ? [ "127.0.0.1" ], denyList ? [ ] }: |
||||
|
||||
/* |
||||
dictlist is a list of form |
||||
[ { filename = /path/to/files/basename; |
||||
name = "name"; } ] |
||||
basename.dict.dz and basename.index should be |
||||
dict files. Or look below for other options. |
||||
allowList is a list of IP/domain *-wildcarded strings |
||||
denyList is the same.. |
||||
dictlist is a list of form |
||||
[ { filename = /path/to/files/basename; |
||||
name = "name"; } ] |
||||
basename.dict.dz and basename.index should be |
||||
dict files. Or look below for other options. |
||||
allowList is a list of IP/domain *-wildcarded strings |
||||
denyList is the same.. |
||||
*/ |
||||
|
||||
let |
||||
link_arguments = map |
||||
(x: '' "${x.filename}" '') |
||||
dictlist; |
||||
databases = lib.concatStrings (map (x : |
||||
"${x.name} ${x.filename}\n") dictlist); |
||||
allow = lib.concatStrings (map (x: "allow ${x}\n") allowList); |
||||
deny = lib.concatStrings (map (x: "deny ${x}\n") denyList); |
||||
accessSection = " |
||||
access { |
||||
${allow} |
||||
${deny} |
||||
} |
||||
"; |
||||
installPhase = '' |
||||
mkdir -p $out/share/dictd |
||||
cd $out/share/dictd |
||||
echo "${databases}" >databases.names |
||||
echo "${accessSection}" > dictd.conf |
||||
for j in ${toString link_arguments}; do |
||||
name="$(egrep ' '"$j"\$ databases.names)" |
||||
name=''${name% $j} |
||||
if test -d "$j"; then |
||||
if test -d "$j"/share/dictd ; then |
||||
echo "Got store path $j" |
||||
j="$j"/share/dictd |
||||
fi |
||||
echo "Directory reference: $j" |
||||
i=$(ls "$j""/"*.index) |
||||
i="''${i%.index}"; |
||||
else |
||||
i="$j"; |
||||
fi |
||||
echo "Basename is $i" |
||||
locale=$(cat "$(dirname "$i")"/locale) |
||||
base="$(basename "$i")" |
||||
echo "Locale is $locale" |
||||
export LC_ALL=$locale |
||||
export LANG=$locale |
||||
if test -e "$i".dict.dz; then |
||||
ln -s "$i".dict.dz |
||||
else |
||||
cp "$i".dict . |
||||
dictzip "$base".dict |
||||
fi |
||||
ln -s "$i".index . |
||||
dictfmt_index2word --locale $locale < "$base".index > "$base".word || true |
||||
dictfmt_index2suffix --locale $locale < "$base".index > "$base".suffix || true |
||||
link_arguments = map |
||||
(x: '' "${x.filename}" '') |
||||
dictlist; |
||||
databases = lib.concatStrings (map |
||||
(x: |
||||
"${x.name} ${x.filename}\n") |
||||
dictlist); |
||||
allow = lib.concatStrings (map (x: "allow ${x}\n") allowList); |
||||
deny = lib.concatStrings (map (x: "deny ${x}\n") denyList); |
||||
accessSection = " |
||||
access { |
||||
${allow} |
||||
${deny} |
||||
} |
||||
"; |
||||
installPhase = '' |
||||
mkdir -p $out/share/dictd |
||||
cd $out/share/dictd |
||||
echo "${databases}" >databases.names |
||||
echo "${accessSection}" > dictd.conf |
||||
for j in ${toString link_arguments}; do |
||||
name="$(egrep ' '"$j"\$ databases.names)" |
||||
name=''${name% $j} |
||||
if test -d "$j"; then |
||||
if test -d "$j"/share/dictd ; then |
||||
echo "Got store path $j" |
||||
j="$j"/share/dictd |
||||
fi |
||||
echo "Directory reference: $j" |
||||
i=$(ls "$j""/"*.index) |
||||
i="''${i%.index}"; |
||||
else |
||||
i="$j"; |
||||
fi |
||||
echo "Basename is $i" |
||||
locale=$(cat "$(dirname "$i")"/locale) |
||||
base="$(basename "$i")" |
||||
echo "Locale is $locale" |
||||
export LC_ALL=$locale |
||||
export LANG=$locale |
||||
if test -e "$i".dict.dz; then |
||||
ln -s "$i".dict.dz |
||||
else |
||||
cp "$i".dict . |
||||
dictzip "$base".dict |
||||
fi |
||||
ln -s "$i".index . |
||||
dictfmt_index2word --locale $locale < "$base".index > "$base".word || true |
||||
dictfmt_index2suffix --locale $locale < "$base".index > "$base".suffix || true |
||||
|
||||
echo "database $name {" >> dictd.conf |
||||
echo " data $out/share/dictd/$base.dict.dz" >> dictd.conf |
||||
echo " index $out/share/dictd/$base.index" >> dictd.conf |
||||
echo " index_word $out/share/dictd/$base.word" >> dictd.conf |
||||
echo " index_suffix $out/share/dictd/$base.suffix" >> dictd.conf |
||||
echo "}" >> dictd.conf |
||||
done |
||||
''; |
||||
echo "database $name {" >> dictd.conf |
||||
echo " data $out/share/dictd/$base.dict.dz" >> dictd.conf |
||||
echo " index $out/share/dictd/$base.index" >> dictd.conf |
||||
echo " index_word $out/share/dictd/$base.word" >> dictd.conf |
||||
echo " index_suffix $out/share/dictd/$base.suffix" >> dictd.conf |
||||
echo "}" >> dictd.conf |
||||
done |
||||
''; |
||||
|
||||
in |
||||
|
||||
stdenv.mkDerivation { |
||||
name = "dictd-dbs"; |
||||
|
||||
phases = ["installPhase"]; |
||||
buildInputs = [dict]; |
||||
buildInputs = [ dict ]; |
||||
|
||||
inherit installPhase; |
||||
}) |
||||
|
Loading…
Reference in new issue