deploy-rs/nix/tests/server.nix
Sergey Gulin a928352641
[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.
2024-03-29 20:25:47 +03:00

24 lines
625 B
Nix

# SPDX-FileCopyrightText: 2024 Serokell <https://serokell.io/>
#
# 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;
}