nixos/tests/initrd-network-ssh/default.nix: remove overuses of with

This commit is contained in:
Anderson Torres 2023-07-28 22:27:17 -03:00
parent c532a4f227
commit 62f6f01085

View File

@ -1,12 +1,10 @@
import ../make-test-python.nix ({ lib, ... }: import ../make-test-python.nix ({ lib, pkgs, ... }:
{ {
name = "initrd-network-ssh"; name = "initrd-network-ssh";
meta = with lib.maintainers; { meta.maintainers = with lib.maintainers; [ willibutz emily ];
maintainers = [ willibutz emily ];
};
nodes = with lib; { nodes = {
server = server =
{ config, ... }: { config, ... }:
{ {
@ -17,7 +15,7 @@ import ../make-test-python.nix ({ lib, ... }:
enable = true; enable = true;
ssh = { ssh = {
enable = true; enable = true;
authorizedKeys = [ (readFile ./id_ed25519.pub) ]; authorizedKeys = [ (lib.readFile ./id_ed25519.pub) ];
port = 22; port = 22;
hostKeys = [ ./ssh_host_ed25519_key ]; hostKeys = [ ./ssh_host_ed25519_key ];
}; };
@ -37,12 +35,12 @@ import ../make-test-python.nix ({ lib, ... }:
{ {
environment.etc = { environment.etc = {
knownHosts = { knownHosts = {
text = concatStrings [ text = lib.concatStrings [
"server," "server,"
"${toString (head (splitString " " ( "${toString (lib.head (lib.splitString " " (
toString (elemAt (splitString "\n" config.networking.extraHosts) 2) toString (lib.elemAt (lib.splitString "\n" config.networking.extraHosts) 2)
)))} " )))} "
"${readFile ./ssh_host_ed25519_key.pub}" "${lib.readFile ./ssh_host_ed25519_key.pub}"
]; ];
}; };
sshKey = { sshKey = {