Merge master into staging-next

This commit is contained in:
github-actions[bot] 2021-06-26 12:06:25 +00:00 committed by GitHub
commit 45003ba5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 149 additions and 3423 deletions

View File

@ -5,7 +5,8 @@ with lib;
let let
cfg = config.services.go-neb; cfg = config.services.go-neb;
configFile = pkgs.writeText "config.yml" (builtins.toJSON cfg.config); settingsFormat = pkgs.formats.yaml {};
configFile = settingsFormat.generate "config.yaml" cfg.config;
in { in {
options.services.go-neb = { options.services.go-neb = {
enable = mkEnableOption "Extensible matrix bot written in Go"; enable = mkEnableOption "Extensible matrix bot written in Go";
@ -16,13 +17,26 @@ in {
default = ":4050"; default = ":4050";
}; };
secretFile = mkOption {
type = types.nullOr types.path;
default = null;
example = "/run/keys/go-neb.env";
description = ''
Environment variables from this file will be interpolated into the
final config file using envsubst with this syntax: <literal>$ENVIRONMENT</literal>
or <literal>''${VARIABLE}</literal>.
The file should contain lines formatted as <literal>SECRET_VAR=SECRET_VALUE</literal>.
This is useful to avoid putting secrets into the nix store.
'';
};
baseUrl = mkOption { baseUrl = mkOption {
type = types.str; type = types.str;
description = "Public-facing endpoint that can receive webhooks."; description = "Public-facing endpoint that can receive webhooks.";
}; };
config = mkOption { config = mkOption {
type = types.uniq types.attrs; inherit (settingsFormat) type;
description = '' description = ''
Your <filename>config.yaml</filename> as a Nix attribute set. Your <filename>config.yaml</filename> as a Nix attribute set.
See <link xlink:href="https://github.com/matrix-org/go-neb/blob/master/config.sample.yaml">config.sample.yaml</link> See <link xlink:href="https://github.com/matrix-org/go-neb/blob/master/config.sample.yaml">config.sample.yaml</link>
@ -32,18 +46,30 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.go-neb = { systemd.services.go-neb = let
finalConfigFile = if cfg.secretFile == null then configFile else "/var/run/go-neb/config.yaml";
in {
description = "Extensible matrix bot written in Go"; description = "Extensible matrix bot written in Go";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
environment = { environment = {
BASE_URL = cfg.baseUrl; BASE_URL = cfg.baseUrl;
BIND_ADDRESS = cfg.bindAddress; BIND_ADDRESS = cfg.bindAddress;
CONFIG_FILE = configFile; CONFIG_FILE = finalConfigFile;
}; };
serviceConfig = { serviceConfig = {
ExecStartPre = lib.optional (cfg.secretFile != null)
(pkgs.writeShellScript "pre-start" ''
umask 077
export $(xargs < ${cfg.secretFile})
${pkgs.envsubst}/bin/envsubst -i "${configFile}" > ${finalConfigFile}
chown go-neb ${finalConfigFile}
'');
PermissionsStartOnly = true;
RuntimeDirectory = "go-neb";
ExecStart = "${pkgs.go-neb}/bin/go-neb"; ExecStart = "${pkgs.go-neb}/bin/go-neb";
User = "go-neb";
DynamicUser = true; DynamicUser = true;
}; };
}; };

View File

@ -10,10 +10,11 @@ import ./make-test-python.nix ({ pkgs, ... }:
services.go-neb = { services.go-neb = {
enable = true; enable = true;
baseUrl = "http://localhost"; baseUrl = "http://localhost";
secretFile = pkgs.writeText "secrets" "ACCESS_TOKEN=changeme";
config = { config = {
clients = [ { clients = [ {
UserId = "@test:localhost"; UserId = "@test:localhost";
AccessToken = "changeme"; AccessToken = "$ACCESS_TOKEN";
HomeServerUrl = "http://localhost"; HomeServerUrl = "http://localhost";
Sync = false; Sync = false;
AutoJoinRooms = false; AutoJoinRooms = false;
@ -33,11 +34,10 @@ import ./make-test-python.nix ({ pkgs, ... }:
testScript = '' testScript = ''
start_all() start_all()
server.wait_for_unit("go-neb.service") server.wait_for_unit("go-neb.service")
server.wait_until_succeeds( server.wait_until_succeeds("curl -fL http://localhost:4050/services/hooks/d2lraXBlZGlhX3NlcnZpY2U")
"curl -fL http://localhost:4050/services/hooks/d2lraXBlZGlhX3NlcnZpY2U" server.succeed(
) "journalctl -eu go-neb -o cat | grep -q service_id=wikipedia_service",
server.wait_until_succeeds( "grep -q changeme /var/run/go-neb/config.yaml",
"journalctl -eu go-neb -o cat | grep -q service_id=wikipedia_service"
) )
''; '';

File diff suppressed because it is too large Load Diff

View File

@ -9,65 +9,58 @@
, expat , expat
, openssl , openssl
, SDL2 , SDL2
, vulkan-loader
, fontconfig , fontconfig
, ninja , ninja
, gn , gn
, llvmPackages , llvmPackages
, makeFontsConf , makeFontsConf
, libglvnd
, libxkbcommon
, xorg
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "neovide"; pname = "neovide";
version = "20210515"; version = "unstable-2021-06-21";
src = src = fetchFromGitHub {
let owner = "Kethku";
repo = fetchFromGitHub { repo = "neovide";
owner = "Kethku"; rev = "4159c47ff4f30073b92b9d63fc6ab70e07b74b6d";
repo = "neovide"; sha256 = "sha256-XwirJGXMGxc/NkpSeHBUc16ppvJ+H4ECnrOVu030Qfg=";
rev = "0b976c3d28bbd24e6c83a2efc077aa96dde1e9eb"; };
sha256 = "sha256-asaOxcAenKdy/yJvch3HFfgnrBnQagL02UpWYnz7sa8=";
};
in
runCommand "source" { } ''
cp -R ${repo} $out
chmod -R +w $out
# Reasons for patching Cargo.toml:
# - I got neovide built with latest compatible skia-save version 0.35.1
# and I did not try to get it with 0.32.1 working. Changing the skia
# version is time consuming, because of manual dependecy tracking and
# long compilation runs.
sed -i $out/Cargo.toml \
-e '/skia-safe/s;0.32.1;0.35.1;'
cp ${./Cargo.lock} $out/Cargo.lock
'';
cargoSha256 = "sha256-XMPRM3BAfCleS0LXQv03A3lQhlUhAP8/9PdVbAUnfG0="; cargoSha256 = "sha256-WCk9kt81DtBwpEEdKH9gKQSVxAvH+vkyP2y24tU+vzY=";
SKIA_OFFLINE_SOURCE_DIR = SKIA_SOURCE_DIR =
let let
repo = fetchFromGitHub { repo = fetchFromGitHub {
owner = "rust-skia"; owner = "rust-skia";
repo = "skia"; repo = "skia";
# see rust-skia/Cargo.toml#package.metadata skia # see rust-skia:skia-bindings/Cargo.toml#package.metadata skia
rev = "m86-0.35.0"; rev = "m90-0.38.3";
sha256 = "sha256-uTSgtiEkbE9e08zYOkRZyiHkwOLr/FbBYkr2d+NZ8J0="; sha256 = "sha256-l8c4vfO1PELAT8bDyr/yQGZetZsaufAlJ6bBOXz7E1w=";
}; };
# The externals for skia are taken from skia/DEPS # The externals for skia are taken from skia/DEPS
externals = lib.mapAttrs (n: v: fetchgit v) (lib.importJSON ./skia-externals.json); externals = lib.mapAttrs (n: v: fetchgit v) (lib.importJSON ./skia-externals.json);
in in
runCommand "source" { } ('' runCommand "source" {} (
cp -R ${repo} $out ''
chmod -R +w $out cp -R ${repo} $out
chmod -R +w $out
mkdir -p $out/third_party/externals mkdir -p $out/third_party/externals
cd $out/third_party/externals cd $out/third_party/externals
'' + (builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "cp -ra ${value} ${name}") externals))); '' + (builtins.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "cp -ra ${value} ${name}") externals))
);
SKIA_OFFLINE_NINJA_COMMAND = "${ninja}/bin/ninja"; SKIA_NINJA_COMMAND = "${ninja}/bin/ninja";
SKIA_OFFLINE_GN_COMMAND = "${gn}/bin/gn"; SKIA_GN_COMMAND = "${gn}/bin/gn";
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
preConfigure = ''
unset CC CXX
'';
# test needs a valid fontconfig file # test needs a valid fontconfig file
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; }; FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
@ -92,9 +85,9 @@ rustPlatform.buildRustPackage rec {
]; ];
postFixup = '' postFixup = ''
wrapProgram $out/bin/neovide \ wrapProgram $out/bin/neovide \
--prefix LD_LIBRARY_PATH : ${vulkan-loader}/lib --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libglvnd libxkbcommon xorg.libXcursor xorg.libXext xorg.libXrandr xorg.libXi ]}
''; '';
postInstall = '' postInstall = ''
for n in 16x16 32x32 48x48 256x256; do for n in 16x16 32x32 48x48 256x256; do

View File

@ -16,8 +16,8 @@
}, },
"zlib": { "zlib": {
"url": "https://chromium.googlesource.com/chromium/src/third_party/zlib", "url": "https://chromium.googlesource.com/chromium/src/third_party/zlib",
"rev": "eaf99a4e2009b0e5759e6070ad1760ac1dd75461", "rev": "c876c8f87101c5a75f6014b0f832499afeb65b73",
"sha256": "sha256-B4PgeSVBU/MSkPkXTu9jPIa37dNJPm2HpmiVf6XuOGE=" "sha256": "sha256-mwozVo8ymyrYN4tw+/ZnSI+xogSTZQ6PUBba/jQqRkE="
}, },
"harfbuzz": { "harfbuzz": {
"url": "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git", "url": "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git",
@ -31,7 +31,7 @@
}, },
"libgifcodec": { "libgifcodec": {
"url": "https://skia.googlesource.com/libgifcodec", "url": "https://skia.googlesource.com/libgifcodec",
"rev": "d06d2a6d42baf6c0c91cacc28df2542a911d05fe", "rev": "fd59fa92a0c86788dcdd84d091e1ce81eda06a77",
"sha256": "sha256-ke1X5iyj2ah2NqGVdFv8GuoRAzXg1aCeTdZwUM8wvCI=" "sha256": "sha256-spyZU4QhV2xrHcBRoYqYgCR0wEM5lgfhGh8pqJE5yXM="
} }
} }

View File

@ -1,20 +1,20 @@
{ lib, buildGoModule, fetchFromGitHub, nixosTests }: { lib, buildGoModule, fetchFromGitHub, nixosTests, olm }:
buildGoModule { buildGoModule {
pname = "go-neb"; pname = "go-neb";
version = "unstable-2020-04-09"; version = "unstable-2021-03-24";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "matrix-org"; owner = "matrix-org";
repo = "go-neb"; repo = "go-neb";
rev = "1e297c50ad2938e511a3c86f4b190fd3fc3559d6"; rev = "b6edd50d6e33de3bcdb35055fa6c5f0157f45321";
sha256 = "1azwy4s4kmypps1fjbz76flpi1b7sjzjj4qwx94cry0hn3qfnrc6"; sha256 = "sha256-wFqkN4C0rWzWxa6+/LiHMMS8i/g3Q57f5z4cG2XZQzs=";
}; };
subPackages = [ "." ]; subPackages = [ "." ];
patches = [ ./go-mod.patch ]; buildInputs = [ olm ];
vendorSha256 = "1k3980yf6zl00dkd1djwhm2f9nnffzrsbs3kq3alpw2gm0aln739"; vendorSha256 = "sha256-sWrLWjODf25Z8QqCDg4KyVWmTc3PRiYpRL88yxK0j/M";
doCheck = false; doCheck = false;

View File

@ -1,50 +0,0 @@
diff --git a/go.mod b/go.mod
index 8ed4e68..83526e7 100644
--- a/go.mod
+++ b/go.mod
@@ -4,24 +4,15 @@ go 1.14
require (
github.com/PuerkitoBio/goquery v1.5.1 // indirect
- github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
- github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 // indirect
github.com/andygrunwald/go-jira v1.11.0
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/dghubble/oauth1 v0.6.0
github.com/die-net/lrucache v0.0.0-20190707192454-883874fe3947
- github.com/go-kit/kit v0.9.0 // indirect
- github.com/go-logfmt/logfmt v0.4.0 // indirect
- github.com/go-stack/stack v1.8.0 // indirect
- github.com/gogo/protobuf v1.1.1 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/go-cmp v0.4.0 // indirect
github.com/google/go-github v2.0.1-0.20160719063544-b5e5babef39c+incompatible
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/jaytaylor/html2text v0.0.0-20200220170450-61d9dc4d7195
- github.com/json-iterator/go v1.1.9 // indirect
- github.com/julienschmidt/httprouter v1.2.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/lib/pq v1.3.0
github.com/matrix-org/dugong v0.0.0-20180820122854-51a565b5666b
@@ -32,9 +23,6 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mmcdole/gofeed v1.0.0-beta2
github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf // indirect
- github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
- github.com/modern-go/reflect2 v1.0.1 // indirect
- github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223 // indirect
github.com/olekukonko/tablewriter v0.0.4 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/prometheus/client_golang v0.8.1-0.20160916180340-5636dc67ae77
@@ -47,10 +35,7 @@ require (
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
- golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 // indirect
- golang.org/x/tools v0.0.0-20200311090712-aafaee8bce8c // indirect
- gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.8
)

View File

@ -8,20 +8,15 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "cage"; pname = "cage";
version = "0.1.3"; version = "0.1.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Hjdskes"; owner = "Hjdskes";
repo = "cage"; repo = "cage";
rev = "v${version}"; rev = "v${version}";
sha256 = "0ixl45g0m8b75gvbjm3gf5qg0yplspgs0xpm2619wn5sygc47sb1"; sha256 = "0vm96gxinhy48m3x9p1sfldyd03w3gk6iflb7n9kn06j1vqyswr6";
}; };
patches = [
# To fix the build with wlroots 0.14.0:
./wlroots-0_14.patch
];
nativeBuildInputs = [ meson ninja pkg-config wayland scdoc makeWrapper ]; nativeBuildInputs = [ meson ninja pkg-config wayland scdoc makeWrapper ];
buildInputs = [ buildInputs = [

View File

@ -17,14 +17,14 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "fastapi"; pname = "fastapi";
version = "0.65.0"; version = "0.65.2";
format = "flit"; format = "flit";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "tiangolo"; owner = "tiangolo";
repo = "fastapi"; repo = "fastapi";
rev = version; rev = version;
sha256 = "sha256-DPfijCGORF3ThZblqaYTKN0H8+wlhtdIS8lfKfJl/bY="; sha256 = "032srvbfdy02m1b664x67lkdcx6b2bd4c9a9cb176lscjk213240";
}; };
postPatch = '' postPatch = ''

View File

@ -0,0 +1,51 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, setuptools-scm
, getmac
, requests
, pytestCheckHook
, responses
}:
buildPythonPackage rec {
pname = "vilfo-api-client";
version = "0.3.3";
src = fetchFromGitHub {
owner = "ManneW";
repo = "vilfo-api-client-python";
rev = "v${version}";
sha256 = "1gy5gpsg99rcm1cc3m30232za00r9i46sp74zpd12p3vzz1wyyqf";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "get-mac" "getmac"
'';
nativeBuildInputs = [
setuptools-scm
];
SETUPTOOLS_SCM_PRETEND_VERSION = version;
propagatedBuildInputs = [
getmac
requests
];
checkInputs = [
pytestCheckHook
responses
];
pythonImportsCheck = [ "vilfo" ];
meta = with lib; {
description = "Simple wrapper client for the Vilfo router API";
homepage = "https://github.com/ManneW/vilfo-api-client-python";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View File

@ -115,13 +115,13 @@ rec {
headers = "1qis2k8yc7g1klvhiysjrgl5gclx4idxdz60kh8ldrji5a0lgha1"; headers = "1qis2k8yc7g1klvhiysjrgl5gclx4idxdz60kh8ldrji5a0lgha1";
}; };
electron_13 = mkElectron "13.1.3" { electron_13 = mkElectron "13.1.4" {
x86_64-linux = "33646b1bace221edd636f172b5d3ae391fe519dd6a49aaeef4e50916d636fcfb"; x86_64-linux = "096909396be9fac888ca35093d16bdb50a965e3200823f2384574c359f15cd4f";
x86_64-darwin = "246356862f4e97bdba31d9b0f2dadc45b1d7c689d0762bc27b89251cafcdd14c"; x86_64-darwin = "3d9980f8062766be3cfcfd54b9fd9f469993df06d538a2324c4879eae1284c84";
i686-linux = "1237ab5043b22f00236d52e12b771778f740fd0d5c06d0f5aee4219afb9b5b38"; i686-linux = "73c8b1fc01a89a5f9b12de38ed70bd01686e50a55d817f0cdf5914e953bdc868";
armv7l-linux = "7106ef6720162d9f38927583968dd9b45f4c678d4bdbe549604aa3b6a40f7f50"; armv7l-linux = "db2fe2f499865ea697cacef992fc0042ac0f75da4c016d64e5c41deae7f5eb72";
aarch64-linux = "3213bb087e6f3a9091c2fe2de13a597a9d122735a996872ba51e17c138148cae"; aarch64-linux = "4acdd4eae499e1ed42871ed8b744fdef9f608f5613742090cc20e4f6b5314ae8";
aarch64-darwin = "35bb2b36e73df228c295c5e820ac7f4206b3ea9e546b61e32a4b080fd1f08234"; aarch64-darwin = "e961b7d361c378e4adab7903211ac7200684cb91044c3b300acde04ca24d0468";
headers = "020xka91w4i5p24i56zlk2i6xsynwwvryh3fim336mmkjryqhqxp"; headers = "1h1sr5nk37asbj1fadgjzksgr876wxdmq3b017bb9k5kcgajcmqr";
}; };
} }

View File

@ -927,7 +927,7 @@
"vesync" = ps: with ps; [ pyvesync ]; "vesync" = ps: with ps; [ pyvesync ];
"viaggiatreno" = ps: with ps; [ ]; "viaggiatreno" = ps: with ps; [ ];
"vicare" = ps: with ps; [ pyvicare ]; "vicare" = ps: with ps; [ pyvicare ];
"vilfo" = ps: with ps; [ ]; # missing inputs: vilfo-api-client "vilfo" = ps: with ps; [ vilfo-api-client ];
"vivotek" = ps: with ps; [ ]; # missing inputs: libpyvivotek "vivotek" = ps: with ps; [ ]; # missing inputs: libpyvivotek
"vizio" = ps: with ps; [ pyvizio ]; "vizio" = ps: with ps; [ pyvizio ];
"vlc" = ps: with ps; [ python-vlc ]; "vlc" = ps: with ps; [ python-vlc ];

View File

@ -728,6 +728,7 @@ in with py.pkgs; buildPythonApplication rec {
"verisure" "verisure"
"version" "version"
"vesync" "vesync"
"vilfo"
"vizio" "vizio"
"voicerss" "voicerss"
"volumio" "volumio"

View File

@ -24,12 +24,12 @@ let
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "ghidra"; pname = "ghidra";
version = "9.2.3"; version = "10.0";
versiondate = "20210325"; versiondate = "20210621";
src = fetchzip { src = fetchzip {
url = "https://www.ghidra-sre.org/ghidra_${version}_PUBLIC_${versiondate}.zip"; url = "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_${version}_build/ghidra_${version}_PUBLIC_${versiondate}.zip";
sha256 = "sha256-/rQ3JeOR/D+HxzkJ+nV+pd/7V81+tCyTOndwpXI05hg="; sha256 = "0m1ksng2fkmcg7m22lqil10qn95s06gxnxdz7ih9qpbx67pmmq9x";
}; };
nativeBuildInputs = [ nativeBuildInputs = [

View File

@ -8939,6 +8939,8 @@ in {
viewstate = callPackage ../development/python-modules/viewstate { }; viewstate = callPackage ../development/python-modules/viewstate { };
vilfo-api-client = callPackage ../development/python-modules/vilfo-api-client { };
vincenty = callPackage ../development/python-modules/vincenty { }; vincenty = callPackage ../development/python-modules/vincenty { };
vine = callPackage ../development/python-modules/vine { }; vine = callPackage ../development/python-modules/vine { };