mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
parent
1fd9bc9a38
commit
7c1bc83f56
2 changed files with 67 additions and 69 deletions
|
@ -1297,7 +1297,7 @@ in {
|
||||||
xscreensaver = handleTest ./xscreensaver.nix {};
|
xscreensaver = handleTest ./xscreensaver.nix {};
|
||||||
xss-lock = handleTest ./xss-lock.nix {};
|
xss-lock = handleTest ./xss-lock.nix {};
|
||||||
xterm = handleTest ./xterm.nix {};
|
xterm = handleTest ./xterm.nix {};
|
||||||
xxh = handleTest ./xxh.nix {};
|
xxh = runTest ./xxh.nix;
|
||||||
yabar = runTest ./yabar.nix;
|
yabar = runTest ./yabar.nix;
|
||||||
ydotool = handleTest ./ydotool.nix {};
|
ydotool = handleTest ./ydotool.nix {};
|
||||||
yggdrasil = runTest ./yggdrasil.nix;
|
yggdrasil = runTest ./yggdrasil.nix;
|
||||||
|
|
|
@ -1,76 +1,74 @@
|
||||||
import ./make-test-python.nix (
|
{ pkgs, lib, ... }:
|
||||||
{ pkgs, lib, ... }:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
|
inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
|
||||||
xxh-shell-zsh = pkgs.stdenv.mkDerivation {
|
xxh-shell-zsh = pkgs.stdenv.mkDerivation {
|
||||||
pname = "xxh-shell-zsh";
|
pname = "xxh-shell-zsh";
|
||||||
version = "";
|
version = "";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
owner = "xxh";
|
owner = "xxh";
|
||||||
repo = "xxh-shell-zsh";
|
repo = "xxh-shell-zsh";
|
||||||
# gets rarely updated, we can then just replace the hash
|
# gets rarely updated, we can then just replace the hash
|
||||||
rev = "91e1f84f8d6e0852c3235d4813f341230cac439f";
|
rev = "91e1f84f8d6e0852c3235d4813f341230cac439f";
|
||||||
sha256 = "sha256-Y1FrIRxTd0yooK+ZzKcCd6bLSy5E2fRXYAzrIsm7rIc=";
|
sha256 = "sha256-Y1FrIRxTd0yooK+ZzKcCd6bLSy5E2fRXYAzrIsm7rIc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace build.sh \
|
||||||
|
--replace "echo Install wget or curl" "cp ${zsh-portable-binary} zsh-5.8-linux-x86_64.tar.gz" \
|
||||||
|
--replace "command -v curl" "command -v this-should-not-trigger"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
mv * $out/
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
zsh-portable-binary = pkgs.fetchurl {
|
||||||
|
# kept in sync with https://github.com/xxh/xxh-shell-zsh/tree/master/build.sh#L27
|
||||||
|
url = "https://github.com/romkatv/zsh-bin/releases/download/v3.0.1/zsh-5.8-linux-x86_64.tar.gz";
|
||||||
|
sha256 = "sha256-i8flMd2Isc0uLoeYQNDnOGb/kK3oTFVqQgIx7aOAIIo=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
name = "xxh";
|
||||||
|
meta = with lib.maintainers; {
|
||||||
|
maintainers = [ lom ];
|
||||||
|
};
|
||||||
|
|
||||||
|
nodes = {
|
||||||
|
server =
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
services.openssh.enable = true;
|
||||||
|
users.users.root.openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
client =
|
||||||
substituteInPlace build.sh \
|
{ ... }:
|
||||||
--replace "echo Install wget or curl" "cp ${zsh-portable-binary} zsh-5.8-linux-x86_64.tar.gz" \
|
{
|
||||||
--replace "command -v curl" "command -v this-should-not-trigger"
|
programs.zsh.enable = true;
|
||||||
'';
|
users.users.root.shell = pkgs.zsh;
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
xxh
|
||||||
|
git
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
installPhase = ''
|
testScript = ''
|
||||||
mkdir -p $out
|
start_all()
|
||||||
mv * $out/
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
zsh-portable-binary = pkgs.fetchurl {
|
client.succeed("mkdir -m 700 /root/.ssh")
|
||||||
# kept in sync with https://github.com/xxh/xxh-shell-zsh/tree/master/build.sh#L27
|
|
||||||
url = "https://github.com/romkatv/zsh-bin/releases/download/v3.0.1/zsh-5.8-linux-x86_64.tar.gz";
|
|
||||||
sha256 = "sha256-i8flMd2Isc0uLoeYQNDnOGb/kK3oTFVqQgIx7aOAIIo=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
name = "xxh";
|
|
||||||
meta = with lib.maintainers; {
|
|
||||||
maintainers = [ lom ];
|
|
||||||
};
|
|
||||||
|
|
||||||
nodes = {
|
client.succeed(
|
||||||
server =
|
"cat ${snakeOilPrivateKey} > /root/.ssh/id_ecdsa"
|
||||||
{ ... }:
|
)
|
||||||
{
|
client.succeed("chmod 600 /root/.ssh/id_ecdsa")
|
||||||
services.openssh.enable = true;
|
|
||||||
users.users.root.openssh.authorizedKeys.keys = [ snakeOilPublicKey ];
|
|
||||||
};
|
|
||||||
|
|
||||||
client =
|
server.wait_for_unit("sshd")
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
programs.zsh.enable = true;
|
|
||||||
users.users.root.shell = pkgs.zsh;
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
xxh
|
|
||||||
git
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
testScript = ''
|
client.succeed("xxh server -i /root/.ssh/id_ecdsa +hc \'echo $0\' +i +s zsh +I xxh-shell-zsh+path+${xxh-shell-zsh} | grep -Fq '/root/.xxh/.xxh/shells/xxh-shell-zsh/build/zsh-bin/bin/zsh'")
|
||||||
start_all()
|
'';
|
||||||
|
}
|
||||||
client.succeed("mkdir -m 700 /root/.ssh")
|
|
||||||
|
|
||||||
client.succeed(
|
|
||||||
"cat ${snakeOilPrivateKey} > /root/.ssh/id_ecdsa"
|
|
||||||
)
|
|
||||||
client.succeed("chmod 600 /root/.ssh/id_ecdsa")
|
|
||||||
|
|
||||||
server.wait_for_unit("sshd")
|
|
||||||
|
|
||||||
client.succeed("xxh server -i /root/.ssh/id_ecdsa +hc \'echo $0\' +i +s zsh +I xxh-shell-zsh+path+${xxh-shell-zsh} | grep -Fq '/root/.xxh/.xxh/shells/xxh-shell-zsh/build/zsh-bin/bin/zsh'")
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue