forked from Fediversity/Fediversity
intended to swap out nixos-anywhere for terraform-nixos, over: - don't need nixos-anywhere to install nixos; we preload nixos to VMs - [awkward non-flake usage](https://nix-community.github.io/nixos-anywhere/howtos/use-without-flakes.html#3-set-nixos-version-to-use) - seemed not to pick up on config changes, as observed by test VMs losing their panel keys after TF sync however, it seems that terraform-nixos has its own flaws: - its output using a random id, i.e. forcing to push even on no changes - so far did not get ssh authentication to work
29 lines
686 B
Nix
29 lines
686 B
Nix
{
|
|
pkgs,
|
|
terraform,
|
|
sources,
|
|
...
|
|
}:
|
|
let
|
|
inherit (terraform) hostname;
|
|
in
|
|
{
|
|
imports = [
|
|
"${sources.disko}/module.nix"
|
|
"${sources.agenix}/modules/age.nix"
|
|
../services/fediversity
|
|
./resource.nix
|
|
# FIXME: get VM details from TF
|
|
../infra/test-machines/${hostname}
|
|
];
|
|
fediversityVm.name = hostname;
|
|
fediversity = {
|
|
inherit (terraform) domain;
|
|
temp.initialUser = {
|
|
inherit (terraform.initialUser) username email displayName;
|
|
# FIXME: disgusting, but nvm, this is going to be replaced by
|
|
# proper central authentication at some point
|
|
passwordFile = pkgs.writeText "password" terraform.initialUser.password;
|
|
};
|
|
};
|
|
}
|