forked from Fediversity/Fediversity
52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
inputs,
|
|
...
|
|
}:
|
|
{
|
|
_class = "nixosTest";
|
|
imports = [
|
|
../common/data-model-options.nix
|
|
];
|
|
|
|
name = "deployment-model";
|
|
sourceFileset = lib.fileset.unions [
|
|
../../data-model.nix
|
|
../../function.nix
|
|
../common/data-model.nix
|
|
../common/data-model-options.nix
|
|
./constants.nix
|
|
(config.pathToCwd + "/flake-under-test.nix")
|
|
];
|
|
|
|
nodes.deployer =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = with pkgs; [
|
|
inputs.nixops4.packages.${system}.default
|
|
jq
|
|
];
|
|
|
|
# FIXME: sad times
|
|
system.extraDependencies = with pkgs; [
|
|
jq
|
|
jq.inputDerivation
|
|
];
|
|
|
|
system.extraDependenciesFromModule =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = with pkgs; [
|
|
hello
|
|
];
|
|
};
|
|
};
|
|
|
|
extraTestScript = ''
|
|
with subtest("nixops4"):
|
|
nixops4.fail("hello 1>&2")
|
|
deployer.succeed("nixops4 apply check-deployment-model --show-trace --verbose --no-interactive 1>&2")
|
|
nixops4.succeed("su - operator -c hello 1>&2")
|
|
'';
|
|
}
|