From a92835264100583903dc408abe43d461ff7d4dca Mon Sep 17 00:00:00 2001 From: Sergey Gulin Date: Wed, 27 Mar 2024 12:22:02 +0300 Subject: [OPS-1384] Introduce NixOS VM tests Problem: Currently, the only way to test deploy-rs deployments is to actually do a deployment to an existing NixOS instance (either in VM, or a real machine) manually. This is a bit inconvenient and one can forget to test changes when developing/reviewing deploy-rs changes. Solution: Add NixOS VM tests. --- nix/tests/server.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nix/tests/server.nix (limited to 'nix/tests/server.nix') diff --git a/nix/tests/server.nix b/nix/tests/server.nix new file mode 100644 index 0000000..a8bbda6 --- /dev/null +++ b/nix/tests/server.nix @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2024 Serokell +# +# SPDX-License-Identifier: MPL-2.0 +{ pkgs, ... }: +{ + nix.settings.trusted-users = [ "deploy" ]; + users = let + inherit (import "${pkgs.path}/nixos/tests/ssh-keys.nix" pkgs) snakeOilPublicKey; + in { + mutableUsers = false; + users = { + deploy = { + password = ""; + isNormalUser = true; + createHome = true; + openssh.authorizedKeys.keys = [ snakeOilPublicKey ]; + }; + root.openssh.authorizedKeys.keys = [ snakeOilPublicKey ]; + }; + }; + services.openssh.enable = true; + virtualisation.writableStore = true; +} -- cgit v1.2.3