tf: store hydra credentials in state via numtide/secret
This commit is contained in:
parent
7c6780a2a3
commit
dcd5f68545
7
terraform/common.nix
Normal file
7
terraform/common.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
# Until we get some kind of KMS operational, store secrets in the state file.
|
||||||
|
terraform.required_providers.secret = {
|
||||||
|
version = "~> 1.2.1";
|
||||||
|
source = "numtide/secret";
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./common.nix
|
||||||
./hydra.nix
|
./hydra.nix
|
||||||
./state.nix
|
./state.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf types mkOption;
|
inherit (lib) mkEnableOption mkIf types mkOption tf;
|
||||||
cfg = config.bagel.hydra;
|
cfg = config.bagel.hydra;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -14,9 +14,12 @@ in
|
||||||
source = "DeterminateSystems/hydra";
|
source = "DeterminateSystems/hydra";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
resource.secret_resource.hydra_password.lifecycle.prevent_destroy = true;
|
||||||
|
|
||||||
provider.hydra = {
|
provider.hydra = {
|
||||||
host = "https://hydra.bagel.delroth.net";
|
host = "https://hydra.bagel.delroth.net";
|
||||||
# username/password are provided via HYDRA_USERNAME/HYDRA_PASSWORD
|
username = "terraform";
|
||||||
|
password = tf.ref "resource.secret_resource.hydra_password.value";
|
||||||
};
|
};
|
||||||
|
|
||||||
resource.hydra_project.forkos = {
|
resource.hydra_project.forkos = {
|
||||||
|
|
Loading…
Reference in a new issue