diff options
19 files changed, 492 insertions, 103 deletions
diff --git a/maintainers/scripts/nix-generate-from-cpan.pl b/maintainers/scripts/nix-generate-from-cpan.pl index 2dda39fd12e..e04d3713e9a 100755 --- a/maintainers/scripts/nix-generate-from-cpan.pl +++ b/maintainers/scripts/nix-generate-from-cpan.pl @@ -226,7 +226,7 @@ sub pkg_to_attr { sub get_pkg_name { my ($module) = @_; - return $module->package_name . '-' . $module->package_version; + return ( $module->package_name, $module->package_version =~ s/^v(\d)/$1/r ); } sub read_meta { @@ -375,13 +375,13 @@ die "module $module_name not found\n" if scalar @modules == 0; die "multiple packages that match module $module_name\n" if scalar @modules > 1; my $module = $modules[0]; -my $pkg_name = get_pkg_name $module; +my ($pkg_name, $pkg_version) = get_pkg_name $module; my $attr_name = pkg_to_attr $module; INFO( "attribute name: ", $attr_name ); INFO( "module: ", $module->module ); INFO( "version: ", $module->version ); -INFO( "package: ", $module->package, " (", $pkg_name, ", ", $attr_name, ")" ); +INFO( "package: ", $module->package, " (", "$pkg_name-$pkg_version", ", ", $attr_name, ")" ); INFO( "path: ", $module->path ); my $tar_path = $module->fetch(); @@ -436,10 +436,11 @@ my $build_fun = -e "$pkg_path/Build.PL" print STDERR "===\n"; print <<EOF; - ${\(is_reserved($attr_name) ? "\"$attr_name\"" : $attr_name)} = $build_fun rec { - name = "$pkg_name"; + ${\(is_reserved($attr_name) ? "\"$attr_name\"" : $attr_name)} = $build_fun { + pname = "$pkg_name"; + version = "$pkg_version"; src = fetchurl { - url = "mirror://cpan/${\$module->path}/\${name}.${\$module->package_extension}"; + url = "mirror://cpan/${\$module->path}/${\$module->package}"; sha256 = "${\$module->status->checksum_value}"; }; EOF diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 0c7c45a4708..802ffcdc94e 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -66,6 +66,8 @@ with lib; (mkRenamedOptionModule [ "services" "clamav" "updater" "config" ] [ "services" "clamav" "updater" "extraConfig" ]) + (mkRemovedOptionModule [ "services" "pykms" "verbose" ] "Use services.pykms.logLevel instead") + (mkRemovedOptionModule [ "security" "setuidOwners" ] "Use security.wrappers instead") (mkRemovedOptionModule [ "security" "setuidPrograms" ] "Use security.wrappers instead") diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index f1b35124674..74702c97f55 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -224,6 +224,7 @@ in { KillSignal = "SIGINT"; PrivateTmp = true; RemoveIPC = true; + AmbientCapabilities = "cap_net_raw,cap_net_admin+eip"; }; path = [ "/run/wrappers" # needed for ping diff --git a/nixos/modules/services/misc/pykms.nix b/nixos/modules/services/misc/pykms.nix index ab00086e591..e2d1254602b 100644 --- a/nixos/modules/services/misc/pykms.nix +++ b/nixos/modules/services/misc/pykms.nix @@ -4,6 +4,7 @@ with lib; let cfg = config.services.pykms; + libDir = "/var/lib/pykms"; in { meta.maintainers = with lib.maintainers; [ peterhoeg ]; @@ -28,12 +29,6 @@ in { description = "The port on which to listen."; }; - verbose = mkOption { - type = types.bool; - default = false; - description = "Show verbose output."; - }; - openFirewallPort = mkOption { type = types.bool; default = false; @@ -45,30 +40,44 @@ in { default = "64M"; description = "How much memory to use at most."; }; + + logLevel = mkOption { + type = types.enum [ "CRITICAL" "ERROR" "WARNING" "INFO" "DEBUG" "MINI" ]; + default = "INFO"; + description = "How much to log"; + }; + + extraArgs = mkOption { + type = types.listOf types.str; + default = []; + description = "Additional arguments"; + }; }; }; config = mkIf cfg.enable { networking.firewall.allowedTCPPorts = lib.mkIf cfg.openFirewallPort [ cfg.port ]; - systemd.services.pykms = let - home = "/var/lib/pykms"; - in { + systemd.services.pykms = { description = "Python KMS"; after = [ "network.target" ]; wantedBy = [ "multi-user.target" ]; # python programs with DynamicUser = true require HOME to be set - environment.HOME = home; + environment.HOME = libDir; serviceConfig = with pkgs; { DynamicUser = true; - StateDirectory = baseNameOf home; - ExecStartPre = "${getBin pykms}/bin/create_pykms_db.sh ${home}/clients.db"; + StateDirectory = baseNameOf libDir; + ExecStartPre = "${getBin pykms}/libexec/create_pykms_db.sh ${libDir}/clients.db"; ExecStart = lib.concatStringsSep " " ([ - "${getBin pykms}/bin/server.py" + "${getBin pykms}/bin/server" + "--logfile STDOUT" + "--loglevel ${cfg.logLevel}" + ] ++ cfg.extraArgs ++ [ cfg.listenAddress (toString cfg.port) - ] ++ lib.optional cfg.verbose "--verbose"); - WorkingDirectory = home; + ]); + ProtectHome = "tmpfs"; + WorkingDirectory = libDir; Restart = "on-failure"; MemoryLimit = cfg.memoryLimit; }; diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix index 1917640fd2e..4d09f2ad5fe 100644 --- a/pkgs/applications/graphics/djview/default.nix +++ b/pkgs/applications/graphics/djview/default.nix @@ -1,8 +1,16 @@ -{ stdenv, fetchurl, pkgconfig -, djvulibre, qt4, xorg, libtiff -, darwin }: +{ stdenv +, mkDerivation +, fetchurl +, pkgconfig +, djvulibre +, qtbase +, qttools +, xorg +, libtiff +, darwin +}: -stdenv.mkDerivation rec { +mkDerivation rec { pname = "djview"; version = "4.10.6"; @@ -11,20 +19,56 @@ stdenv.mkDerivation rec { sha256 = "08bwv8ppdzhryfcnifgzgdilb12jcnivl4ig6hd44f12d76z6il4"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ + pkgconfig + qttools + ]; - buildInputs = [ djvulibre qt4 xorg.libXt libtiff ] - ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AGL ]; + buildInputs = [ + djvulibre + qtbase + xorg.libXt + libtiff + ] ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AGL; + + configureFlags = [ + "--disable-silent-rules" + "--disable-dependency-tracking" + "--with-x" + "--with-tiff" + # NOTE: 2019-09-19: experimental "--enable-npdjvu" fails + ] ++ stdenv.lib.optional stdenv.isDarwin "--enable-mac"; passthru = { mozillaPlugin = "/lib/mozilla/plugins"; }; meta = with stdenv.lib; { - homepage = http://djvu.sourceforge.net/djview4.html; - description = "A portable DjVu viewer and browser plugin"; + description = "A portable DjVu viewer (Qt5) and browser (nsdejavu) plugin"; + homepage = "http://djvu.sourceforge.net/djview4.html"; license = licenses.gpl2; platforms = platforms.unix; - maintainers = [ ]; + maintainers = with maintainers; [ Anton-Latukha ]; + longDescription = '' + The portable DjVu viewer (Qt5) and browser (nsdejavu) plugin. + + Djview highlights: + - entirely based on the public DjVulibre api. + - entirely written in portable Qt5. + - works natively under Unix/X11, MS Windows, and macOS X. + - continuous scrolling of pages + - side-by-side display of pages + - ability to specify a url to the djview command + - all plugin and cgi options available from the command line + - all silly annotations implemented + - display thumbnails as a grid + - display outlines + - page names supported (see djvused command set-page-title) + - metadata dialog (see djvused command set-meta) + - implemented as reusable Qt widgets + + nsdejavu: browser plugin for DjVu. It internally uses djview. + Has CGI-style arguments to configure the view of document (see man). + ''; }; } diff --git a/pkgs/applications/networking/mailreaders/trojita/default.nix b/pkgs/applications/networking/mailreaders/trojita/default.nix index 7f7296cd700..4b4c711042f 100644 --- a/pkgs/applications/networking/mailreaders/trojita/default.nix +++ b/pkgs/applications/networking/mailreaders/trojita/default.nix @@ -1,37 +1,50 @@ -{ mkDerivation -, lib -, fetchurl +{ akonadi-contacts , cmake +, fetchgit +, gpgme +, kcontacts +, lib +, mimetic +, mkDerivation +, pkgconfig +, qgpgme , qtbase -, qtwebkit +, qtkeychain , qttools +, qtwebkit }: mkDerivation rec { pname = "trojita"; - version = "0.7"; + version = "0.7.20190618"; - src = fetchurl { - url = "mirror://sourceforge/trojita/trojita/${pname}-${version}.tar.xz"; - sha256 = "1n9n07md23ny6asyw0xpih37vlwzp7vawbkprl7a1bqwfa0si3g0"; + src = fetchgit { + url = "https://anongit.kde.org/trojita.git"; + rev = "90b417b131853553c94ff93aef62abaf301aa8f1"; + sha256 = "0xpxq5bzqaa68lkz90wima5q2m0mdcn0rvnigb66lylb4n20mnql"; }; buildInputs = [ + akonadi-contacts + gpgme + kcontacts + mimetic + qgpgme qtbase + qtkeychain qtwebkit ]; nativeBuildInputs = [ cmake + pkgconfig qttools ]; - meta = with lib; { description = "A Qt IMAP e-mail client"; - homepage = http://trojita.flaska.net/; + homepage = "http://trojita.flaska.net/"; license = with licenses; [ gpl2 gpl3 ]; platforms = platforms.linux; }; - } diff --git a/pkgs/development/python-modules/dotnetcore2/default.nix b/pkgs/development/python-modules/dotnetcore2/default.nix new file mode 100644 index 00000000000..caafeb54740 --- /dev/null +++ b/pkgs/development/python-modules/dotnetcore2/default.nix @@ -0,0 +1,59 @@ +{ stdenv, lib, buildPythonPackage, fetchPypi, python, isPy27 +, dotnet-sdk +, substituteAll +, distro +, unzip +}: + +buildPythonPackage rec { + pname = "dotnetcore2"; + version = "2.1.8.1"; + format = "wheel"; + disabled = isPy27; + + src = fetchPypi { + inherit pname version format; + python = "py3"; + platform = "manylinux1_x86_64"; + sha256 = "13zrff5j767d3f8drl397sjhl28winsrfa8pa20svf00xfcsy34s"; + }; + + nativeBuildInputs = [ unzip ]; + + propagatedBuildInputs = [ distro ]; + + # needed to apply patches + prePatch = '' + unzip dist/dotnet* + ''; + + patches = [ + ( substituteAll { + src = ./runtime.patch; + dotnet = dotnet-sdk; + } + ) + ]; + + # unfortunately the noraml pip install fails because the manylinux1 format check fails with NixOS + installPhase = '' + mkdir -p $out/${python.sitePackages}/${pname} + # copy metadata + cp -r dotnetcore2-2* $out/${python.sitePackages} + # copy non-dotnetcore related files + cp -r dotnetcore2/{__init__.py,runtime.py} $out/${python.sitePackages}/${pname} + ''; + + # no tests, ensure it's one useful function works + checkPhase = '' + ${python.interpreter} -c 'from dotnetcore2 import runtime; print(runtime.get_runtime_path())' + ''; + + meta = with lib; { + description = "DotNet Core runtime"; + homepage = "https://github.com/dotnet/core"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ jonringer ]; + }; +} diff --git a/pkgs/development/python-modules/dotnetcore2/runtime.patch b/pkgs/development/python-modules/dotnetcore2/runtime.patch new file mode 100644 index 00000000000..54322087a78 --- /dev/null +++ b/pkgs/development/python-modules/dotnetcore2/runtime.patch @@ -0,0 +1,19 @@ +diff a/dotnetcore2/runtime.py b/dotnetcore2/runtime.py +--- a/dotnetcore2/runtime.py ++++ b/dotnetcore2/runtime.py +@@ -39,13 +39,13 @@ def _get_bin_folder() -> str: + + + def get_runtime_path(): ++ return "@dotnet@/dotnet" + search_string = os.path.join(_get_bin_folder(), 'dotnet*') + matches = [f for f in glob.glob(search_string, recursive=True)] + return matches[0] + + def ensure_dependencies() -> Optional[str]: +- if dist is None: +- return None ++ return None + + bin_folder = _get_bin_folder() + deps_path = os.path.join(bin_folder, 'deps') diff --git a/pkgs/development/python-modules/impacket/default.nix b/pkgs/development/python-modules/impacket/default.nix new file mode 100644 index 00000000000..e4e14cf7bbf --- /dev/null +++ b/pkgs/development/python-modules/impacket/default.nix @@ -0,0 +1,24 @@ +{ lib, buildPythonPackage, fetchPypi, isPy3k }: + +buildPythonPackage rec { + pname = "impacket"; + version = "0.9.15"; + + src = fetchPypi { + inherit pname version; + sha256 = "1sq1698g7wqj731h24f7gr4lc0fz0mxrqv6mm3j4hm2j6h3rrbr6"; + }; + + disabled = isPy3k; + + # no tests + doCheck = false; + + meta = with lib; { + description = "Network protocols Constructors and Dissectors"; + homepage = "https://github.com/CoreSecurity/impacket"; + # Modified Apache Software License, Version 1.1 + license = licenses.free; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/pkgs/games/dxx-rebirth/default.nix b/pkgs/games/dxx-rebirth/default.nix index 518b63ed483..82806c7521c 100644 --- a/pkgs/games/dxx-rebirth/default.nix +++ b/pkgs/games/dxx-rebirth/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, fetchpatch, scons, pkgconfig +{ gcc6Stdenv, fetchurl, fetchpatch, scons, pkgconfig , SDL, SDL_mixer, libGLU_combined, physfs }: @@ -8,7 +8,7 @@ let sha256 = "05mz77vml396mff43dbs50524rlm4fyds6widypagfbh5hc55qdc"; }; -in stdenv.mkDerivation rec { +in gcc6Stdenv.mkDerivation rec { pname = "dxx-rebirth"; version = "0.59.100"; @@ -44,9 +44,9 @@ in stdenv.mkDerivation rec { install -Dm644 -t $out/share/doc/dxx-rebirth *.txt ''; - meta = with stdenv.lib; { + meta = with gcc6Stdenv.lib; { description = "Source Port of the Descent 1 and 2 engines"; - homepage = https://www.dxx-rebirth.com/; + homepage = "https://www.dxx-rebirth.com/"; license = licenses.free; maintainers = with maintainers; [ peterhoeg ]; platforms = with platforms; linux; diff --git a/pkgs/os-specific/linux/hyperv-daemons/default.nix b/pkgs/os-specific/linux/hyperv-daemons/default.nix index a209f1ab4bb..1a111a295a4 100644 --- a/pkgs/os-specific/linux/hyperv-daemons/default.nix +++ b/pkgs/os-specific/linux/hyperv-daemons/default.nix @@ -1,7 +1,10 @@ -{ stdenv, lib, python, kernel, makeWrapper, writeText }: +{ stdenv, lib, python, kernel, makeWrapper, writeText +, gawk, iproute }: let - daemons = stdenv.mkDerivation { + libexec = "libexec/hypervkvpd"; + + daemons = stdenv.mkDerivation rec { pname = "hyperv-daemons-bin"; inherit (kernel) src version; @@ -10,10 +13,15 @@ let # as of 4.9 compilation will fail due to -Werror=format-security hardeningDisable = [ "format" ]; - preConfigure = '' + postPatch = '' cd tools/hv + substituteInPlace hv_kvp_daemon.c \ + --replace /usr/libexec/hypervkvpd/ $out/${libexec}/ ''; + # We don't actually need the hv_get_{dhcp,dns}_info scripts on NixOS in + # their current incarnation but with them in place, we stop the spam of + # errors in the log. installPhase = '' runHook preInstall @@ -21,7 +29,9 @@ let install -Dm755 hv_''${f}_daemon -t $out/bin done - install -Dm755 hv_get_dns_info.sh lsvmbus -t $out/bin + install -Dm755 lsvmbus $out/bin/lsvmbus + install -Dm755 hv_get_dhcp_info.sh $out/${libexec}/hv_get_dhcp_info + install -Dm755 hv_get_dns_info.sh $out/${libexec}/hv_get_dns_info # I don't know why this isn't being handled automatically by fixupPhase substituteInPlace $out/bin/lsvmbus \ @@ -31,8 +41,8 @@ let ''; postFixup = '' - # kvp needs to be able to find the script(s) - wrapProgram $out/bin/hv_kvp_daemon --prefix PATH : $out/bin + wrapProgram $out/bin/hv_kvp_daemon \ + --prefix PATH : $out/bin:${lib.makeBinPath [ gawk iproute ]} ''; }; @@ -56,24 +66,19 @@ let in stdenv.mkDerivation { pname = "hyperv-daemons"; - inherit (kernel) version; # we just stick the bins into out as well as it requires "out" outputs = [ "bin" "lib" "out" ]; - phases = [ "installPhase" ]; - buildInputs = [ daemons ]; - installPhase = '' + buildCommand = '' system=$lib/lib/systemd/system - mkdir -p $system - - cp ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service - cp ${service "kvp" "key-value pair (KVP)" "" } $system/hv-kvp.service - cp ${service "vss" "volume shadow copy (VSS)" "" } $system/hv-vss.service + install -Dm444 ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service + install -Dm444 ${service "kvp" "key-value pair (KVP)" "" } $system/hv-kvp.service + install -Dm444 ${service "vss" "volume shadow copy (VSS)" "" } $system/hv-vss.service cat > $system/hyperv-daemons.target <<EOF [Unit] @@ -102,7 +107,7 @@ in stdenv.mkDerivation { Microsoft calls their guest agents "Integration Services" which is why we use that name here. ''; - homepage = https://kernel.org; + homepage = "https://kernel.org"; maintainers = with maintainers; [ peterhoeg ]; platforms = kernel.meta.platforms; }; diff --git a/pkgs/servers/monitoring/plugins/wmiplus/default.nix b/pkgs/servers/monitoring/plugins/wmiplus/default.nix new file mode 100644 index 00000000000..9a4e5d706e9 --- /dev/null +++ b/pkgs/servers/monitoring/plugins/wmiplus/default.nix @@ -0,0 +1,77 @@ +{ stdenv, fetchFromGitHub, makeWrapper, perlPackages, txt2man +, monitoring-plugins +, wmic-bin ? null }: + +stdenv.mkDerivation rec { + pname = "check-wmiplus"; + version = "1.64"; + + # We fetch from github.com instead of the proper upstream as nix-build errors + # out with 406 when trying to fetch the sources + src = fetchFromGitHub { + owner = "speartail"; + repo = "checkwmiplus"; + rev = "v${version}"; + sha256 = "1m36rd2wnc5dk4mm9q4ch67w19144dl112p9s6lhc1sh6h25ln6r"; + }; + + patches = [ + ./wmiplus_fix_manpage.patch + ]; + + propagatedBuildInputs = with perlPackages; [ + BHooksEndOfScope ClassDataInheritable ClassInspector ClassSingleton + ConfigIniFiles DateTime DateTimeLocale DateTimeTimeZone DevelStackTrace + EvalClosure ExceptionClass FileShareDir ModuleImplementation ModuleRuntime + MROCompat namespaceautoclean namespaceclean NumberFormat PackageStash + ParamsValidate ParamsValidationCompiler RoleTiny Specio + SubExporterProgressive SubIdentify TryTiny + ]; + + nativeBuildInputs = [ makeWrapper txt2man ]; + + dontConfigure = true; + dontBuild = true; + doCheck = false; # no checks + + postPatch = '' + substituteInPlace check_wmi_plus.pl \ + --replace /usr/bin/wmic ${wmic-bin}/bin/wmic \ + --replace /etc/check_wmi_plus $out/etc/check_wmi_plus \ + --replace /opt/nagios/bin/plugins $out/etc/check_wmi_plus \ + --replace /usr/lib/nagios/plugins ${monitoring-plugins}/libexec \ + --replace '$base_dir/check_wmi_plus_help.pl' "$out/bin/check_wmi_plus_help.pl" + + for f in *.pl ; do + substituteInPlace $f --replace /usr/bin/perl ${perlPackages.perl}/bin/perl + done + ''; + + installPhase = '' + runHook preInstall + + install -Dm755 -t $out/bin *.pl + install -Dm644 -t $out/share/doc/${pname} *.txt + cp -r etc $out/ + + runHook postInstall + ''; + + # 1. we need to wait until the main binary has been fixed up with proper perl paths before we can run it to generate the man page + # 2. txt2man returns exit code 3 even if it works, so we add the || true bit + postFixup = '' + wrapProgram $out/bin/check_wmi_plus.pl \ + --set PERL5LIB "${perlPackages.makePerlPath propagatedBuildInputs}" + + mkdir -p $out/share/man/man1 + $out/bin/check_wmi_plus.pl --help | txt2man -d 1970-01-01 -s 1 -t check_wmi_plus -r "Check WMI Plus ${version}" > $out/share/man/man1/check_wmi_plus.1 || true + gzip $out/share/man/man1/check_wmi_plus.1 + ''; + + meta = with stdenv.lib; { + description = "A sensu/nagios plugin using WMI to query Windows hosts"; + homepage = "http://edcint.co.nz/checkwmiplus"; + license = licenses.gpl2; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/pkgs/servers/monitoring/plugins/wmiplus/wmiplus_fix_manpage.patch b/pkgs/servers/monitoring/plugins/wmiplus/wmiplus_fix_manpage.patch new file mode 100644 index 00000000000..16e81d1014d --- /dev/null +++ b/pkgs/servers/monitoring/plugins/wmiplus/wmiplus_fix_manpage.patch @@ -0,0 +1,40 @@ +diff --git a/check_wmi_plus.makeman.sh b/check_wmi_plus.makeman.sh +index 38dc7a4..3fe4369 100755 +--- a/check_wmi_plus.makeman.sh ++++ b/check_wmi_plus.makeman.sh +@@ -19,15 +19,6 @@ mkdir -p "$manpage_dir/man1" + # the full path to the manpage file + manfile="$manpage_dir/man1/check_wmi_plus.1" + +-# if we are not running in a terminal then only show the text-based help +-if [ ! -t 0 ]; then +- # we are not running in a terminal +- echo "Not running in a terminal - showing text-based help" +- echo +- exec $check_wmi_plus_text_help +-fi +- +- + usage() + { + cat << EOT +diff --git a/check_wmi_plus_help.pl b/check_wmi_plus_help.pl +index 3440db2..2982da2 100755 +--- a/check_wmi_plus_help.pl ++++ b/check_wmi_plus_help.pl +@@ -24,7 +24,7 @@ if ($opt_help) { + # we have the script to make the manpage and have not been asked to show text only help + exec ("$make_manpage_script \"$0 --itexthelp\" \"$manpage_dir\"") or print STDERR "couldn't exec $make_manpage_script: $!"; + } else { +- print "Warning: Can not access/execute Manpage script ($make_manpage_script).\nShowing help in text-only format.\n\n"; ++ # print "Warning: Can not access/execute Manpage script ($make_manpage_script).\nShowing help in text-only format.\n\n"; + } + } + +@@ -692,4 +692,4 @@ show_ini_help_overview(1); + finish_program($ERRORS{'UNKNOWN'}); + } + +-1; +\ No newline at end of file ++1; diff --git a/pkgs/tools/networking/py-wmi-client/default.nix b/pkgs/tools/networking/py-wmi-client/default.nix new file mode 100644 index 00000000000..7a277400289 --- /dev/null +++ b/pkgs/tools/networking/py-wmi-client/default.nix @@ -0,0 +1,25 @@ +{ lib, pythonPackages, fetchFromGitHub }: + +pythonPackages.buildPythonApplication rec { + pname = "py-wmi-client"; + version = "unstable-20160601"; + + src = fetchFromGitHub { + owner = "dlundgren"; + repo = pname; + rev = "9702b036df85c3e0ecdde84a753b353069f58208"; + sha256 = "1kd12gi1knqv477f1shzqr0h349s5336vzp3fpfp3xl0b502ld8d"; + }; + + propagatedBuildInputs = with pythonPackages; [ impacket natsort pyasn1 pycrypto ]; + + # no tests + doCheck = false; + + meta = with lib; { + description = "Python WMI Client implementation"; + homepage = "https://github.com/dlundgren/py-wmi-client"; + license = licenses.mit; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/pkgs/tools/networking/pykms/default.nix b/pkgs/tools/networking/pykms/default.nix index fdfa0f808ec..e1a13b73120 100644 --- a/pkgs/tools/networking/pykms/default.nix +++ b/pkgs/tools/networking/pykms/default.nix @@ -1,7 +1,7 @@ -{ stdenv, fetchFromGitHub, python3Packages, writeText, writeScript +{ stdenv, runtimeShell, fetchFromGitHub, python3, writeText, writeScript , coreutils, sqlite }: -with python3Packages; +with python3.pkgs; let dbSql = writeText "create_pykms_db.sql" '' @@ -18,38 +18,45 @@ let ''; dbScript = writeScript "create_pykms_db.sh" (with stdenv.lib; '' - #!${stdenv.shell} -eu + #!${runtimeShell} - db=$1 + set -eEuo pipefail - ${getBin coreutils}/bin/install -d $(dirname $db) + db=$1 if [ ! -e $db ] ; then ${getBin sqlite}/bin/sqlite3 $db < ${dbSql} fi ''); -in buildPythonApplication { +in buildPythonApplication rec { pname = "pykms"; - version = "20180208"; + version = "20190611"; src = fetchFromGitHub { - owner = "ThunderEX"; + owner = "SystemRage"; repo = "py-kms"; - rev = "a1666a0ee5b404569a234afd05b164accc9a8845"; - sha256 = "17yj5n8byxp09l5zkap73hpphjy35px84wy68ps824w8l0l8kcd4"; + rev = "dead208b1593655377fe8bc0d74cc4bead617103"; + sha256 = "065qpkfqrahsam1rb43vnasmzrangan5z1pr3p6s0sqjz5l2jydp"; }; - propagatedBuildInputs = [ pytz ]; + sourceRoot = "source/py-kms"; - prePatch = '' - siteDir=$out/${python.sitePackages} + propagatedBuildInputs = [ systemd pytz tzlocal ]; - substituteInPlace kmsBase.py \ + postPatch = '' + siteDir=$out/${python3.sitePackages} + + substituteInPlace pykms_DB2Dict.py \ --replace "'KmsDataBase.xml'" "'$siteDir/KmsDataBase.xml'" + + # we are logging to journal + sed -i pykms_Misc.py \ + -e '6ifrom systemd import journal' \ + -e 's/log_obj.addHandler(log_handler)/log_obj.addHandler(journal.JournalHandler())/' ''; - dontBuild = true; + format = "other"; # there are no tests doCheck = false; @@ -57,18 +64,19 @@ in buildPythonApplication { installPhase = '' runHook preInstall - mkdir -p $out/{bin,share/doc/pykms} $siteDir + mkdir -p $siteDir mv * $siteDir - for b in client server ; do - makeWrapper ${python.interpreter} $out/bin/$b.py \ - --argv0 $b \ - --add-flags $siteDir/$b.py + for b in Client Server ; do + makeWrapper ${python.interpreter} $out/bin/''${b,,} \ + --argv0 ''${b,,} \ + --add-flags $siteDir/pykms_$b.py \ + --prefix PYTHONPATH : "$(toPythonPath ${systemd})" done - install -m755 ${dbScript} $out/bin/create_pykms_db.sh + install -Dm755 ${dbScript} $out/libexec/create_pykms_db.sh - mv $siteDir/README.md $out/share/doc/pykms/ + install -Dm644 ../README.md -t $out/share/doc/pykms ${python.interpreter} -m compileall $siteDir @@ -77,7 +85,7 @@ in buildPythonApplication { meta = with stdenv.lib; { description = "Windows KMS (Key Management Service) server written in Python"; - homepage = https://github.com/ThunderEX/py-kms; + homepage = "https://github.com/SystemRage/py-kms"; license = licenses.mit; maintainers = with maintainers; [ peterhoeg ]; }; diff --git a/pkgs/tools/security/thc-hydra/default.nix b/pkgs/tools/security/thc-hydra/default.nix index 252d73b479b..14fc89e9170 100644 --- a/pkgs/tools/security/thc-hydra/default.nix +++ b/pkgs/tools/security/thc-hydra/default.nix @@ -1,30 +1,37 @@ -{ stdenv, lib, fetchurl, zlib, openssl, ncurses, libidn, pcre, libssh, mysql, postgresql +{ stdenv, lib, fetchFromGitHub, zlib, openssl, ncurses, libidn, pcre, libssh, mysql, postgresql , withGUI ? false, makeWrapper, pkgconfig, gtk2 }: -let - makeDirs = output: subDir: pkgs: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) pkgs); - -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { pname = "thc-hydra"; - version = "8.5"; + version = "9.0"; - src = fetchurl { - url = "http://www.thc.org/releases/hydra-${version}.tar.gz"; - sha256 = "0vfx6xwmw0r7nd0s232y7rckcj58fc1iqjgp4s56rakpz22b4yjm"; + src = fetchFromGitHub { + owner = "vanhauser-thc"; + repo = "thc-hydra"; + rev = "v${version}"; + sha256 = "09d2f55wky1iabnl871d4r6dyyvr8zhp47d9j1p6d0pvdv93kl4z"; }; - preConfigure = '' + postPatch = let + makeDirs = output: subDir: lib.concatStringsSep " " (map (path: lib.getOutput output path + "/" + subDir) buildInputs); + in '' substituteInPlace configure \ - --replace "\$LIBDIRS" "${makeDirs "lib" "lib" buildInputs}" \ - --replace "\$INCDIRS" "${makeDirs "dev" "include" buildInputs}" \ + --replace '$LIBDIRS' "${makeDirs "lib" "lib"}" \ + --replace '$INCDIRS' "${makeDirs "dev" "include"}" \ --replace "/usr/include/math.h" "${lib.getDev stdenv.cc.libc}/include/math.h" \ --replace "libcurses.so" "libncurses.so" \ --replace "-lcurses" "-lncurses" ''; nativeBuildInputs = lib.optionals withGUI [ pkgconfig makeWrapper ]; - buildInputs = [ zlib openssl ncurses libidn pcre libssh mysql.connector-c postgresql ] - ++ lib.optional withGUI gtk2; + + buildInputs = [ + zlib openssl ncurses libidn pcre libssh mysql.connector-c postgresql + ] ++ lib.optional withGUI gtk2; + + enableParallelBuilding = true; + + DATADIR = "/share/${pname}"; postInstall = lib.optionalString withGUI '' wrapProgram $out/bin/xhydra \ @@ -33,9 +40,9 @@ in stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "A very fast network logon cracker which support many different services"; + homepage = "https://www.thc.org/thc-hydra/"; license = licenses.agpl3; - homepage = https://www.thc.org/thc-hydra/; - maintainers = with maintainers; [offline]; + maintainers = with maintainers; [ offline ]; platforms = platforms.linux; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 336408961b6..cd3bc17f4f0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15187,6 +15187,8 @@ in sensu-go-backend sensu-go-cli; + check-wmiplus = callPackage ../servers/monitoring/plugins/wmiplus { }; + uchiwa = callPackage ../servers/monitoring/uchiwa { }; shishi = callPackage ../servers/shishi { @@ -17811,7 +17813,7 @@ in djvu2pdf = callPackage ../tools/typesetting/djvu2pdf { }; - djview = callPackage ../applications/graphics/djview { }; + djview = libsForQt5.callPackage ../applications/graphics/djview { }; djview4 = pkgs.djview; dmenu = callPackage ../applications/misc/dmenu { }; @@ -20925,7 +20927,9 @@ in tribler = callPackage ../applications/networking/p2p/tribler { }; - trojita = libsForQt5.callPackage ../applications/networking/mailreaders/trojita { }; + trojita = libsForQt5.callPackage ../applications/networking/mailreaders/trojita { + inherit (kdeApplications) akonadi-contacts; + }; tudu = callPackage ../applications/office/tudu { }; @@ -24236,6 +24240,8 @@ in qMasterPassword = libsForQt5.callPackage ../applications/misc/qMasterPassword { }; + py-wmi-client = callPackage ../tools/networking/py-wmi-client { }; + redprl = callPackage ../applications/science/logic/redprl { }; retroarchBare = callPackage ../misc/emulators/retroarch { diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 8b1e7943fb6..eabcff964b9 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -12280,6 +12280,20 @@ let doCheck = false; # Test performs network access. }; + MustacheSimple = buildPerlPackage { + pname = "Mustache-Simple"; + version = "1.3.6"; + src = fetchurl { + url = "mirror://cpan/authors/id/C/CM/CMS/Mustache-Simple-v1.3.6.tar.gz"; + sha256 = "51db5d51ff4b25a670d8bfabe3902b6d45434ecf78b29bc1fff19af6e7383003"; + }; + propagatedBuildInputs = [ YAMLLibYAML ]; + meta = { + description = "A simple Mustache Renderer"; + license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + namespaceautoclean = buildPerlPackage { pname = "namespace-autoclean"; version = "0.28"; @@ -12665,6 +12679,21 @@ let }; }; + NetPrometheus = buildPerlModule { + pname = "Net-Prometheus"; + version = "0.07"; + src = fetchurl { + url = mirror://cpan/authors/id/P/PE/PEVANS/Net-Prometheus-0.07.tar.gz; + sha256 = "1dh498b26wdaip053hw52317jjmb2n2r5209a1zv5yfrlxpblqm7"; + }; + propagatedBuildInputs = [ RefUtil StructDumb ]; + buildInputs = [ TestFatal ]; + meta = { + description = "export monitoring metrics for F<prometheus>"; + license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + NetSCP = buildPerlPackage { pname = "Net-SCP"; version = "0.08.reprise"; @@ -15736,6 +15765,20 @@ let }; }; + StructDumb = buildPerlModule { + pname = "Struct-Dumb"; + version = "0.09"; + src = fetchurl { + url = mirror://cpan/authors/id/P/PE/PEVANS/Struct-Dumb-0.09.tar.gz; + sha256 = "0g9rziaqxkm00vh30g1yfwzq3b1xl23p8fbm4rszqsp641wr2z9k"; + }; + buildInputs = [ TestFatal ]; + meta = { + description = "make simple lightweight record-like structures"; + license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; + }; + }; + SubExporter = buildPerlPackage { pname = "Sub-Exporter"; version = "0.987"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 654f1c50f40..70c24129196 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -523,6 +523,10 @@ in { dominate = callPackage ../development/python-modules/dominate { }; + dotnetcore2 = callPackage ../development/python-modules/dotnetcore2 { + inherit (pkgs) substituteAll dotnet-sdk; + }; + emcee = callPackage ../development/python-modules/emcee { }; emailthreads = callPackage ../development/python-modules/emailthreads { }; @@ -1902,6 +1906,8 @@ in { eth-utils = callPackage ../development/python-modules/eth-utils { }; + impacket = callPackage ../development/python-modules/impacket { }; + jsonrpc-async = callPackage ../development/python-modules/jsonrpc-async { }; jsonrpc-base = callPackage ../development/python-modules/jsonrpc-base { }; |