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 Jun 14, 2023
2 parents be1f07f + f45bee3 commit 0f19fc4
Show file tree
Hide file tree
Showing 135 changed files with 1,649 additions and 995 deletions.
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,12 @@
githubId = 44871469;
name = "Etienne Wodey";
};
aither64 = {
email = "aither@havefun.cz";
github = "aither64";
githubId = 4717906;
name = "Jakub Skokan";
};
ajgrf = {
email = "a@ajgrf.com";
github = "ajgrf";
Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/test-driver/test_driver/machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def check_failure(_: Any) -> bool:
return status != 0

with self.nested(f"waiting for failure: {command}"):
retry(check_failure)
retry(check_failure, timeout)
return output

def wait_for_shutdown(self) -> None:
Expand Down
11 changes: 1 addition & 10 deletions nixos/modules/services/networking/ddclient.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ let
${lib.optionalString (cfg.zone != "") "zone=${cfg.zone}"}
ssl=${boolToStr cfg.ssl}
wildcard=YES
ipv6=${boolToStr cfg.ipv6}
quiet=${boolToStr cfg.quiet}
verbose=${boolToStr cfg.verbose}
${cfg.extraConfig}
Expand Down Expand Up @@ -52,6 +51,7 @@ with lib;
in if value != "" then [ value ] else []))
(mkRemovedOptionModule [ "services" "ddclient" "homeDir" ] "")
(mkRemovedOptionModule [ "services" "ddclient" "password" ] "Use services.ddclient.passwordFile instead.")
(mkRemovedOptionModule [ "services" "ddclient" "ipv6" ] "")
];

###### interface
Expand Down Expand Up @@ -146,15 +146,6 @@ with lib;
'';
};

ipv6 = mkOption {
default = false;
type = bool;
description = lib.mdDoc ''
Whether to use IPv6.
'';
};


quiet = mkOption {
default = false;
type = bool;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/activation/switch-to-configuration.pl
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ sub path_to_unit_name {
# "systemctl stop" here because systemd has lots of alias
# units that prevent a stop from actually calling
# "swapoff".
if ($action ne "dry-activate") {
if ($action eq "dry-activate") {
print STDERR "would stop swap device: $device\n";
} else {
print STDERR "stopping swap device: $device\n";
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 @@ -814,6 +814,7 @@ in {
victoriametrics = handleTest ./victoriametrics.nix {};
vikunja = handleTest ./vikunja.nix {};
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
vscode-remote-ssh = handleTestOn ["x86_64-linux"] ./vscode-remote-ssh.nix {};
vscodium = discoverTests (import ./vscodium.nix);
vsftpd = handleTest ./vsftpd.nix {};
warzone2100 = handleTest ./warzone2100.nix {};
Expand Down
1 change: 1 addition & 0 deletions nixos/tests/coturn.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
with subtest("works with static-auth-secret-file"):
secretsfile.wait_for_unit("coturn.service")
secretsfile.wait_for_open_port(3478)
secretsfile.succeed("grep 'some-very-secret-string' /run/coturn/turnserver.cfg")
# Forbidden IP, fails:
secretsfile.fail("${pkgs.coturn}/bin/turnutils_uclient -W some-very-secret-string 127.0.0.1 -DgX -e 127.0.0.1 -n 1 -c -y")
Expand Down
124 changes: 124 additions & 0 deletions nixos/tests/vscode-remote-ssh.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import ./make-test-python.nix ({ lib, ... }@args: let
pkgs = args.pkgs.extend (self: super: {
stdenv = super.stdenv.override {
config = super.config // {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"vscode" "vscode-with-extensions" "vscode-extension-ms-vscode-remote-remote-ssh"
];
};
};
});

inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;

inherit (pkgs.vscode.passthru) rev vscodeServer;
in {
name = "vscode-remote-ssh";
meta.maintainers = with lib.maintainers; [ Enzime ];

nodes = let
serverAddress = "192.168.0.2";
clientAddress = "192.168.0.1";
in {
server = { ... }: {
networking.interfaces.eth1.ipv4.addresses = [ { address = serverAddress; prefixLength = 24; } ];
services.openssh.enable = true;
users.users.root.openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
virtualisation.additionalPaths = with pkgs; [ patchelf bintools stdenv.cc.cc.lib ];
};
client = { ... }: {
imports = [ ./common/x11.nix ./common/user-account.nix ];
networking.interfaces.eth1.ipv4.addresses = [ { address = clientAddress; prefixLength = 24; } ];
networking.hosts.${serverAddress} = [ "server" ];
test-support.displayManager.auto.user = "alice";
environment.systemPackages = [
(pkgs.vscode-with-extensions.override {
vscodeExtensions = [
pkgs.vscode-extensions.ms-vscode-remote.remote-ssh
];
})
];
};
};

enableOCR = true;

testScript = let
jq = "${pkgs.jq}/bin/jq";

sshConfig = builtins.toFile "ssh.conf" ''
UserKnownHostsFile=/dev/null
StrictHostKeyChecking=no
'';

vscodeConfig = builtins.toFile "settings.json" ''
{
"window.zoomLevel": 1,
"security.workspace.trust.startupPrompt": "always"
}
'';
in ''
def connect_with_remote_ssh(screenshot, should_succeed):
print(f"connect_with_remote_ssh({screenshot=}, {should_succeed=})")
if server.execute("test -d ~/.vscode-server")[0] == 0:
server.succeed("rm -r ~/.vscode-server")
server.succeed("mkdir -p ~/.vscode-server/bin")
server.succeed("cp -r ${vscodeServer} ~/.vscode-server/bin/${rev}")
client.succeed("sudo -u alice code --remote=ssh-remote+root@server /root")
client.wait_for_window("Visual Studio Code")
client.wait_for_text("Do you trust the authors" if should_succeed else "Disconnected from SSH")
client.screenshot(screenshot)
if should_succeed:
# Press the Don't Trust button
client.send_key("tab")
client.send_key("tab")
client.send_key("tab")
client.send_key("\n")
else:
# Close the error dialog
client.send_key("esc")
# Don't send Ctrl-q too quickly otherwise it might not get sent to VS Code
client.sleep(1)
client.send_key("ctrl-q")
client.wait_until_fails("pidof code")
start_all()
server.wait_for_open_port(22)
VSCODE_COMMIT = server.execute("${jq} -r .commit ${pkgs.vscode}/lib/vscode/resources/app/product.json")[1].rstrip()
SERVER_COMMIT = server.execute("${jq} -r .commit ${vscodeServer}/product.json")[1].rstrip()
print(f"{VSCODE_COMMIT=} {SERVER_COMMIT=}")
assert VSCODE_COMMIT == SERVER_COMMIT, "VSCODE_COMMIT and SERVER_COMMIT do not match"
client.wait_until_succeeds("ping -c1 server")
client.succeed("sudo -u alice mkdir ~alice/.ssh")
client.succeed("sudo -u alice install -Dm 600 ${snakeOilPrivateKey} ~alice/.ssh/id_ecdsa")
client.succeed("sudo -u alice install ${sshConfig} ~alice/.ssh/config")
client.succeed("sudo -u alice install -Dm 644 ${vscodeConfig} ~alice/.config/Code/User/settings.json")
client.wait_for_x()
client.wait_for_file("~alice/.Xauthority")
client.succeed("xauth merge ~alice/.Xauthority")
# Move the mouse out of the way
client.succeed("${pkgs.xdotool}/bin/xdotool mousemove 0 0")
with subtest("fails to connect when nixpkgs isn't available"):
server.fail("nix-build '<nixpkgs>' -A hello")
connect_with_remote_ssh(screenshot="no_node_installed", should_succeed=False)
server.succeed("test -e ~/.vscode-server/bin/${rev}/node")
server.fail("~/.vscode-server/bin/${rev}/node -v")
with subtest("connects when server can patch Node"):
server.succeed("mkdir -p /nix/var/nix/profiles/per-user/root/channels")
server.succeed("ln -s ${pkgs.path} /nix/var/nix/profiles/per-user/root/channels/nixos")
connect_with_remote_ssh(screenshot="build_node_with_nix", should_succeed=True)
'';
})
32 changes: 29 additions & 3 deletions pkgs/applications/audio/faust/faust2alqt.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
{ faust
, alsa-lib
, qt4
, qtbase
, writeText
, makeWrapper
}:

let
# Wrap the binary coming out of the the compilation script, so it knows QT_PLUGIN_PATH
wrapBinary = writeText "wrapBinary" ''
source ${makeWrapper}/nix-support/setup-hook
for p in $FILES; do
workpath=$PWD
cd -- "$(dirname "$p")"
binary=$(basename --suffix=.dsp "$p")
rm -f .$binary-wrapped
wrapProgram $binary --set QT_PLUGIN_PATH "${qtbase}/${qtbase.qtPluginPrefix}"
sed -i $binary -e 's@exec@cd "$(dirname "$(readlink -f "''${BASH_SOURCE[0]}")")" \&\& exec@g'
cd $workpath
done
'';
in
faust.wrapWithBuildEnv {

baseName = "faust2alqt";

propagatedBuildInputs = [
alsa-lib
qt4
qtbase
];

dontWrapQtApps = true;

preFixup = ''
for script in "$out"/bin/*; do
# append the wrapping code to the compilation script
cat ${wrapBinary} >> $script
# prevent the qmake error when running the script
sed -i "/QMAKE=/c\ QMAKE="${qtbase.dev}/bin/qmake"" $script
done
'';
}
33 changes: 30 additions & 3 deletions pkgs/applications/audio/faust/faust2jaqt.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
{ faust
, jack2
, qt4
, qtbase
, libsndfile
, alsa-lib
, writeText
, makeWrapper
, which
}:

let
# Wrap the binary coming out of the the compilation script, so it knows QT_PLUGIN_PATH
wrapBinary = writeText "wrapBinary" ''
source ${makeWrapper}/nix-support/setup-hook
for p in $FILES; do
workpath=$PWD
cd -- "$(dirname "$p")"
binary=$(basename --suffix=.dsp "$p")
rm -f .$binary-wrapped
wrapProgram $binary --set QT_PLUGIN_PATH "${qtbase}/${qtbase.qtPluginPrefix}"
sed -i $binary -e 's@exec@cd "$(dirname "$(readlink -f "''${BASH_SOURCE[0]}")")" \&\& exec@g'
cd $workpath
done
'';
in
faust.wrapWithBuildEnv {

baseName = "faust2jaqt";
Expand All @@ -17,10 +33,21 @@ faust.wrapWithBuildEnv {

propagatedBuildInputs = [
jack2
qt4
qtbase
libsndfile
alsa-lib
which
];


dontWrapQtApps = true;

preFixup = ''
for script in "$out"/bin/*; do
# append the wrapping code to the compilation script
cat ${wrapBinary} >> $script
# prevent the qmake error when running the script
sed -i "/QMAKE=/c\ QMAKE="${qtbase.dev}/bin/qmake"" $script
done
'';
}
10 changes: 7 additions & 3 deletions pkgs/applications/audio/faust/faust2lv2.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{ boost
, faust
, lv2
, qt4
, qtbase
, which

}:

faust.wrapWithBuildEnv {

baseName = "faust2lv2";

propagatedBuildInputs = [ boost lv2 qt4 which ];
propagatedBuildInputs = [ boost lv2 qtbase ];

dontWrapQtApps = true;

preFixup = ''
sed -i "/QMAKE=/c\ QMAKE="${qtbase.dev}/bin/qmake"" "$out"/bin/faust2lv2;
'';
}
2 changes: 2 additions & 0 deletions pkgs/applications/audio/faustPhysicalModeling/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ stdenv.mkDerivation rec {

buildInputs = [ faust2jaqt faust2lv2 ];

dontWrapQtApps = true;

buildPhase = ''
cd examples/physicalModeling
Expand Down
40 changes: 0 additions & 40 deletions pkgs/applications/audio/faustStk/default.nix

This file was deleted.

Loading

0 comments on commit 0f19fc4

Please sign in to comment.