From 29f535761a4fa2dee2be51cee5bc0bd7e8475b5d Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 17 Sep 2015 11:25:37 +0200 Subject: [PATCH] tests/virtualbox: Use antiquotes for log sockets. We're simply using antiquotation, since it's been a while since these got introduced (in Nix 1.7). So we can use them because it makes the code much more readable. As usual, I made sure that I didn't accidentally change something in functionality: $ nix-instantiate nixos/tests/virtualbox.nix ... /nix/store/cldxyrxqvwpqm02cd3lvknnmj4qmblyn-vm-test-run-virtualbox.drv $ git stash pop ... $ nix-instantiate nixos/tests/virtualbox.nix ... /nix/store/cldxyrxqvwpqm02cd3lvknnmj4qmblyn-vm-test-run-virtualbox.drv $ Signed-off-by: aszlig --- nixos/tests/virtualbox.nix | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix index cad1574314ed..87c2e25e70b2 100644 --- a/nixos/tests/virtualbox.nix +++ b/nixos/tests/virtualbox.nix @@ -171,27 +171,21 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let ]; in { machine = { - systemd.sockets = listToAttrs (singleton { - name = "vboxtestlog-${name}"; - value = { - description = "VirtualBox Test Machine Log Socket"; - wantedBy = [ "sockets.target" ]; - before = [ "multi-user.target" ]; - socketConfig.ListenStream = "/run/virtualbox-log-${name}.sock"; - socketConfig.Accept = true; - }; - }); + systemd.sockets."vboxtestlog-${name}" = { + description = "VirtualBox Test Machine Log Socket"; + wantedBy = [ "sockets.target" ]; + before = [ "multi-user.target" ]; + socketConfig.ListenStream = "/run/virtualbox-log-${name}.sock"; + socketConfig.Accept = true; + }; - systemd.services = listToAttrs (singleton { - name = "vboxtestlog-${name}@"; - value = { - description = "VirtualBox Test Machine Log"; - serviceConfig.StandardInput = "socket"; - serviceConfig.StandardOutput = "syslog"; - serviceConfig.SyslogIdentifier = "GUEST-${name}"; - serviceConfig.ExecStart = "${pkgs.coreutils}/bin/cat"; - }; - }); + systemd.services."vboxtestlog-${name}@" = { + description = "VirtualBox Test Machine Log"; + serviceConfig.StandardInput = "socket"; + serviceConfig.StandardOutput = "syslog"; + serviceConfig.SyslogIdentifier = "GUEST-${name}"; + serviceConfig.ExecStart = "${pkgs.coreutils}/bin/cat"; + }; }; testSubs = ''