2021-12-08 08:13:31 +01:00
|
|
|
{ pkgs ? import ../nixpkgs.nix }:
|
|
|
|
|
2021-11-22 10:52:35 +01:00
|
|
|
let
|
2021-12-08 08:13:31 +01:00
|
|
|
tools = pkgs.callPackage ../tools.nix {
|
2021-12-05 10:14:12 +01:00
|
|
|
targets = [];
|
|
|
|
prebuiltTarget = "deployer";
|
2022-06-10 20:29:25 +02:00
|
|
|
extraDeployerConfig = {
|
|
|
|
users.users.colmena = {
|
|
|
|
isNormalUser = true;
|
|
|
|
extraGroups = [ "wheel" ];
|
|
|
|
};
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
};
|
2021-12-05 10:14:12 +01:00
|
|
|
};
|
2021-11-22 10:52:35 +01:00
|
|
|
in tools.makeTest {
|
2021-11-22 22:18:28 +01:00
|
|
|
name = "colmena-apply-local";
|
2021-11-22 10:52:35 +01:00
|
|
|
|
|
|
|
bundle = ./.;
|
|
|
|
|
|
|
|
testScript = ''
|
2022-06-10 20:29:25 +02:00
|
|
|
deployer.succeed("cd /tmp/bundle && sudo -u colmena ${tools.colmenaExec} apply-local --sudo")
|
2021-11-22 10:52:35 +01:00
|
|
|
deployer.succeed("grep SUCCESS /etc/deployment")
|
2022-06-10 20:29:25 +02:00
|
|
|
deployer.succeed("grep SECRET /run/keys/key-text")
|
2021-11-22 10:52:35 +01:00
|
|
|
'';
|
|
|
|
}
|