Skip to content

Commit

Permalink
Merge master into staging-next
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 22, 2024
2 parents cabf461 + 0fbb648 commit dceddd0
Show file tree
Hide file tree
Showing 113 changed files with 1,044 additions and 430 deletions.
3 changes: 2 additions & 1 deletion nixos/modules/config/shells-environment.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ in
''
# Create the required /bin/sh symlink; otherwise lots of things
# (notably the system() function) won't work.
mkdir -m 0755 -p /bin
mkdir -p /bin
chmod 0755 /bin
ln -sfn "${cfg.binsh}" /bin/.sh.tmp
mv /bin/.sh.tmp /bin/sh # atomically replace /bin/sh
'';
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/programs/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let
''
#! ${pkgs.runtimeShell} -e
export DISPLAY="$(systemctl --user show-environment | ${pkgs.gnused}/bin/sed 's/^DISPLAY=\(.*\)/\1/; t; d')"
export XAUTHORITY="$(systemctl --user show-environment | ${pkgs.gnused}/bin/sed 's/^XAUTHORITY=\(.*\)/\1/; t; d')"
export WAYLAND_DISPLAY="$(systemctl --user show-environment | ${pkgs.gnused}/bin/sed 's/^WAYLAND_DISPLAY=\(.*\)/\1/; t; d')"
exec ${cfg.askPassword} "$@"
'';
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/moonraker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ in {

config = mkIf cfg.enable {
warnings = []
++ optional (cfg.settings ? update_manager)
++ optional (cfg.settings.update_manager.enable_system_updates or false)
''Enabling update_manager is not supported on NixOS and will lead to non-removable warnings in some clients.''
++ optional (cfg.configDir != null)
''
Expand Down
2 changes: 2 additions & 0 deletions nixos/modules/services/security/clamav.nix
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ in
systemd.services.clamav-freshclam = mkIf cfg.updater.enable {
description = "ClamAV virus database updater (freshclam)";
restartTriggers = [ freshclamConfigFile ];
requires = [ "network-online.target" ];
after = [ "network-online.target" ];

serviceConfig = {
Expand Down Expand Up @@ -243,6 +244,7 @@ in
systemd.services.clamav-fangfrisch = mkIf cfg.fangfrisch.enable {
description = "ClamAV virus database updater (fangfrisch)";
restartTriggers = [ fangfrischConfigFile ];
requires = [ "network-online.target" ];
after = [ "network-online.target" "clamav-fangfrisch-init.service" ];

serviceConfig = {
Expand Down
3 changes: 2 additions & 1 deletion nixos/modules/services/web-servers/ttyd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,11 @@ in
# Runs login which needs to be run as root
# login: Cannot possibly work without effective root
User = "root";
LoadCredential = lib.optionalString (cfg.passwordFile != null) "TTYD_PASSWORD_FILE:${cfg.passwordFile}";
};

script = if cfg.passwordFile != null then ''
PASSWORD=$(cat ${escapeShellArg cfg.passwordFile})
PASSWORD=$(cat "$CREDENTIALS_DIRECTORY/TTYD_PASSWORD_FILE")
${pkgs.ttyd}/bin/ttyd ${lib.escapeShellArgs args} \
--credential ${escapeShellArg cfg.username}:"$PASSWORD" \
${pkgs.shadow}/bin/login
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ in {
trilium-server = handleTestOn ["x86_64-linux"] ./trilium-server.nix {};
tsja = handleTest ./tsja.nix {};
tsm-client-gui = handleTest ./tsm-client-gui.nix {};
ttyd = handleTest ./web-servers/ttyd.nix {};
txredisapi = handleTest ./txredisapi.nix {};
tuptime = handleTest ./tuptime.nix {};
turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix {};
Expand Down
6 changes: 3 additions & 3 deletions nixos/tests/elk.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# To run the test on the unfree ELK use the following command:
# cd path/to/nixpkgs
# NIXPKGS_ALLOW_UNFREE=1 nix-build -A nixosTests.elk.unfree.ELK-6
# NIXPKGS_ALLOW_UNFREE=1 nix-build -A nixosTests.elk.unfree.ELK-7

{ system ? builtins.currentSystem,
config ? {},
Expand Down Expand Up @@ -120,7 +120,7 @@ let
};

elasticsearch-curator = {
enable = true;
enable = elk ? elasticsearch-curator;
actionYAML = ''
---
actions:
Expand Down Expand Up @@ -246,7 +246,7 @@ let
one.wait_until_succeeds(
expect_hits("SuperdupercalifragilisticexpialidociousIndeed")
)
'' + ''
'' + lib.optionalString (elk ? elasticsearch-curator) ''
with subtest("Elasticsearch-curator works"):
one.systemctl("stop logstash")
one.systemctl("start elasticsearch-curator")
Expand Down
108 changes: 102 additions & 6 deletions nixos/tests/web-servers/stargazer.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,41 @@
{ pkgs, lib, ... }:
let
test_script = pkgs.stdenv.mkDerivation rec {
pname = "stargazer-test-script";
inherit (pkgs.stargazer) version src;
buildInputs = with pkgs; [ (python3.withPackages (ps: with ps; [ cryptography ])) ];
dontBuild = true;
doCheck = false;
installPhase = ''
mkdir -p $out/bin
cp scripts/gemini-diagnostics $out/bin/test
'';
};
test_env = pkgs.stdenv.mkDerivation rec {
pname = "stargazer-test-env";
inherit (pkgs.stargazer) version src;
buildPhase = ''
cc test_data/cgi-bin/loop.c -o test_data/cgi-bin/loop
'';
doCheck = false;
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
};
scgi_server = pkgs.stdenv.mkDerivation rec {
pname = "stargazer-test-scgi-server";
inherit (pkgs.stargazer) version src;
buildInputs = with pkgs; [ python3 ];
dontConfigure = true;
dontBuild = true;
doCheck = false;
installPhase = ''
mkdir -p $out/bin
cp scripts/scgi-server $out/bin/scgi-server
'';
};
in
{
name = "stargazer";
meta = with lib.maintainers; { maintainers = [ gaykitty ]; };
Expand All @@ -7,25 +44,84 @@
geminiserver = { pkgs, ... }: {
services.stargazer = {
enable = true;
connectionLogging = false;
requestTimeout = 1;
routes = [
{
route = "localhost";
root = toString (pkgs.writeTextDir "index.gmi" ''
# Hello NixOS!
'');
root = "${test_env}/test_data/test_site";
}
{
route = "localhost=/en.gmi";
root = "${test_env}/test_data/test_site";
lang = "en";
charset = "ascii";
}
{
route = "localhost~/(.*).gemini";
root = "${test_env}/test_data/test_site";
rewrite = "\\1.gmi";
lang = "en";
charset = "ascii";
}
{
route = "localhost=/plain.txt";
root = "${test_env}/test_data/test_site";
lang = "en";
charset = "ascii";
cert-path = "/var/lib/gemini/certs/localhost.crt";
key-path = "/var/lib/gemini/certs/localhost.key";
}
{
route = "localhost:/cgi-bin";
root = "${test_env}/test_data";
cgi = true;
cgi-timeout = 5;
}
{
route = "localhost:/scgi";
scgi = true;
scgi-address = "127.0.0.1:1099";
}
{
route = "localhost=/root";
redirect = "..";
permanent = true;
}
{
route = "localhost=/priv.gmi";
root = "${test_env}/test_data/test_site";
client-cert = "${test_env}/test_data/client_cert/good.crt";
}
{
route = "example.com~(.*)";
redirect = "gemini://localhost";
rewrite = "\\1";
}
{
route = "localhost:/no-exist";
root = "./does_not_exist";
}
];
};
systemd.services.scgi_server = {
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${scgi_server}/bin/scgi-server";
};
};
};
};

testScript = { nodes, ... }: ''
geminiserver.wait_for_unit("scgi_server")
geminiserver.wait_for_open_port(1099)
geminiserver.wait_for_unit("stargazer")
geminiserver.wait_for_open_port(1965)
with subtest("check is serving over gemini"):
response = geminiserver.succeed("${pkgs.gemget}/bin/gemget --header -o - gemini://localhost:1965")
with subtest("stargazer test suite"):
response = geminiserver.succeed("sh -c 'cd ${test_env}; ${test_script}/bin/test'")
print(response)
assert "Hello NixOS!" in response
'';
}
19 changes: 19 additions & 0 deletions nixos/tests/web-servers/ttyd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import ../make-test-python.nix ({ lib, pkgs, ... }: {
name = "ttyd";
meta.maintainers = with lib.maintainers; [ stunkymonkey ];

nodes.machine = { pkgs, ... }: {
services.ttyd = {
enable = true;
username = "foo";
passwordFile = pkgs.writeText "password" "bar";
};
};

testScript = ''
machine.wait_for_unit("ttyd.service")
machine.wait_for_open_port(7681)
response = machine.succeed("curl -vvv -u foo:bar -s -H 'Host: ttyd' http://127.0.0.1:7681/")
assert '<title>ttyd - Terminal</title>' in response, "Page didn't load successfully"
'';
})
4 changes: 4 additions & 0 deletions pkgs/applications/audio/mmlgui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ stdenv.mkDerivation rec {
# Don't force building tests
substituteInPlace Makefile \
--replace 'all: $(MMLGUI_BIN) test' 'all: $(MMLGUI_BIN)'
# Breaking change in libvgm
substituteInPlace src/emu_player.cpp \
--replace 'Resmpl_SetVals(&resmpl, 0xff' 'Resmpl_SetVals(&resmpl, RSMODE_LINEAR'
'';

strictDeps = true;
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/audio/vgmplay-libvgm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
, inih
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "vgmplay-libvgm";
version = "unstable-2023-04-12";
version = "unstable-2024-01-03";

src = fetchFromGitHub {
owner = "ValleyBell";
repo = "vgmplay-libvgm";
rev = "813abab549e99bb7e936acbfa1199cf435c237c6";
sha256 = "sdQO+xk3a7AFXo3jpbcuNBkd19PjKoBMRhr4IK06oHg=";
rev = "7db1c63c056d79a8f9f533aa7eb82b7fdf7d456c";
hash = "sha256-GjBwu8Y/lOI8SLO4SrAWcntQIwKe/hXuh9tKbOPHQiA=";
};

nativeBuildInputs = [ cmake pkg-config ];
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/misc/rsclock/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

rustPlatform.buildRustPackage rec {
pname = "rsClock";
version = "0.1.10";
version = "0.1.11";

src = fetchFromGitHub {
owner = "valebes";
repo = pname;
rev = "v${version}";
sha256 = "sha256-bxka9qTow5aL8ErYQudB+WRi2HecYn4/M3lBSxjd5/U=";
sha256 = "sha256-z+WGi1Jl+YkdAc4Nu818vi+OXg54GfAM6PbWYkgptpo=";
};

cargoHash = "sha256-ESBeXLBkDAmuQkazcXYdo5VnMCTaxfZmzKP+d5V4lEo=";
cargoHash = "sha256-/uAxIV7eroJNGsLl4T/6RskoTIWKu5Cgmv48eMkDZQw=";

meta = with lib; {
description = "A simple terminal clock written in Rust";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ let
in
stdenv.mkDerivation rec {
pname = "telegram-desktop";
version = "4.14.8";
version = "4.14.9";

src = fetchFromGitHub {
owner = "telegramdesktop";
repo = "tdesktop";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-ACpY8SsbuZRCF3arBtEIYjdQRy/2xkP1/g5caxmmSo4=";
hash = "sha256-VqLCkGav6qtam9qk2MsjCdyVSj3630FGQg50Mv0OBNE=";
};

patches = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,47 @@
, libnotify
}:

python3.pkgs.buildPythonApplication rec {
let
py = python3.override {
packageOverrides = self: super: {

# Requires "urwid~=2.1.2", otherwise some tests are failing
urwid = super.urwid.overridePythonAttrs (oldAttrs: rec {
version = "2.1.2";
src = fetchFromGitHub {
owner = "urwid";
repo = "urwid";
rev = "refs/tags/${version}";
hash = "sha256-oPb2h/+gaqkZTXIiESjExMfBNnOzDvoMkXvkZ/+KVwo=";
};
doCheck = false;
});
};
};
in
with py.pkgs;

buildPythonApplication rec {
pname = "zulip-term";
version = "0.7.0";
pyproject = true;

# no tests on PyPI
src = fetchFromGitHub {
owner = "zulip";
repo = "zulip-terminal";
rev = version;
sha256 = "sha256-ZouUU4p1FSGMxPuzDo5P971R+rDXpBdJn2MqvkJO+Fw=";
rev = "refs/tags/${version}";
hash = "sha256-ZouUU4p1FSGMxPuzDo5P971R+rDXpBdJn2MqvkJO+Fw=";
};

patches = [
./pytest-executable-name.patch
];

propagatedBuildInputs = with python3.pkgs; [
nativeBuildInputs = with py.pkgs; [
setuptools
];

propagatedBuildInputs = with py.pkgs; [
beautifulsoup4
lxml
pygments
Expand Down Expand Up @@ -50,6 +74,7 @@ python3.pkgs.buildPythonApplication rec {
meta = with lib; {
description = "Zulip's official terminal client";
homepage = "https://github.com/zulip/zulip-terminal";
changelog = "https://github.com/zulip/zulip-terminal/releases/tag/${version}";
license = licenses.asl20;
maintainers = with maintainers; [ dotlambda ];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ rec {

thunderbird-115 = (buildMozillaMach rec {
pname = "thunderbird";
version = "115.6.0";
version = "115.6.1";
application = "comm/mail";
applicationName = "Mozilla Thunderbird";
binaryName = pname;
src = fetchurl {
url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
sha512 = "2484a99a62fc960b7926b1daa6055e14b1f9e1006ea45522d16131071b33003d4f7ef95911fd2ceb3e941f9d251c66d917013d6a5ecd717d2b1c6d33944f2e01";
sha512 = "f2efaff8b209234b202671b5322fb14a367b955e28c4b24b139af091b838186126e3d387ca21e57ed089629af876e86b38588789b1ef3db14f4f8703095467b3";
};
extraPatches = [
# The file to be patched is different from firefox's `no-buildconfig-ffx90.patch`.
Expand Down
Loading

0 comments on commit dceddd0

Please sign in to comment.