Compare commits
4 commits
d26dd9f2a6
...
ddd0c365ae
Author | SHA1 | Date | |
---|---|---|---|
Ilya K | ddd0c365ae | ||
Ilya K | 31ee302ec9 | ||
Ilya K | c144d76613 | ||
Ilya K | 19133ad329 |
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,5 +1,4 @@
|
|||
result
|
||||
.gcroots
|
||||
config.tf.json
|
||||
.direnv
|
||||
.terraform
|
||||
.direnv
|
36
flake.nix
36
flake.nix
|
@ -31,12 +31,7 @@
|
|||
terraform = pkgs.opentofu;
|
||||
terraformCfg = terranix.lib.terranixConfiguration {
|
||||
inherit system;
|
||||
modules = [
|
||||
./terraform
|
||||
{
|
||||
bagel.hydra.enable = true;
|
||||
}
|
||||
];
|
||||
modules = [ ];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
@ -51,36 +46,23 @@
|
|||
${lib.getExe terraform} apply
|
||||
'');
|
||||
};
|
||||
plan = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeBash "plan" ''
|
||||
# nix run ".#destroy"
|
||||
destroy = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeBash "destroy" ''
|
||||
set -eo pipefail
|
||||
rm -f config.tf.json
|
||||
cp ${terraformCfg} config.tf.json
|
||||
ln -snf ${terraformCfg} config.tf.json
|
||||
${lib.getExe terraform} init
|
||||
${lib.getExe terraform} plan
|
||||
${lib.getExe terraform} destroy
|
||||
'');
|
||||
};
|
||||
# nix run ".#destroy"
|
||||
destroy = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeBash "destroy" ''
|
||||
set -eo pipefail
|
||||
ln -snf ${terraformCfg} config.tf.json
|
||||
${lib.getExe terraform} init
|
||||
${lib.getExe terraform} destroy
|
||||
'');
|
||||
};
|
||||
|
||||
default = self.apps.${system}.apply;
|
||||
};
|
||||
apps.${system}.default = self.apps.${system}.apply;
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
packages = [
|
||||
packages = [
|
||||
inputs.agenix.packages.${system}.agenix
|
||||
inputs.colmena.packages.${system}.colmena
|
||||
|
||||
pkgs.opentofu
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
imports = [
|
||||
./hydra.nix
|
||||
./state.nix
|
||||
];
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf types mkOption;
|
||||
cfg = config.bagel.hydra;
|
||||
in
|
||||
{
|
||||
options.bagel.hydra = {
|
||||
enable = mkEnableOption "the Hydra jobsets";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
terraform.required_providers.hydra = {
|
||||
version = "~> 0.1";
|
||||
source = "DeterminateSystems/hydra";
|
||||
};
|
||||
|
||||
provider.hydra = {
|
||||
host = "https://hydra.bagel.delroth.net";
|
||||
# username/password are provided via HYDRA_USERNAME/HYDRA_PASSWORD
|
||||
};
|
||||
|
||||
resource.hydra_project.forkos = {
|
||||
name = "forkos";
|
||||
display_name = "ForkOS";
|
||||
description = "ForkOS packages collection";
|
||||
homepage = "https://cl.forkos.org";
|
||||
owner = "raito";
|
||||
enabled = true;
|
||||
visible = true;
|
||||
};
|
||||
|
||||
resource.hydra_jobset.raito-nixos-rolling-small = {
|
||||
project = config.resource.hydra_project.forkos.name;
|
||||
state = "enabled";
|
||||
visible = true;
|
||||
name = "raito-nixos-rolling-small";
|
||||
type = "legacy";
|
||||
description = "master branch for raito-nixos";
|
||||
|
||||
nix_expression = {
|
||||
file = "pkgs/top-level/release.nix";
|
||||
input = "nixpkgs";
|
||||
};
|
||||
|
||||
check_interval = 0;
|
||||
scheduling_shares = 3000;
|
||||
keep_evaluations = 3;
|
||||
|
||||
email_notifications = false;
|
||||
|
||||
input = [
|
||||
{
|
||||
name = "nixpkgs";
|
||||
type = "git";
|
||||
value = "https://cl.forkos.org/nixpkgs";
|
||||
notify_committers = false;
|
||||
}
|
||||
{
|
||||
name = "officialRelease";
|
||||
type = "boolean";
|
||||
value = "false";
|
||||
notify_committers = false;
|
||||
}
|
||||
{
|
||||
name = "supportedSystems";
|
||||
type = "nix";
|
||||
value = ''[ "x86_64-linux" ]'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
# We use terraform.backend.s3 directly instead of the type-checked Terranix
|
||||
# backend.s3 options. The latter does not support setting arbitrary s3
|
||||
# endpoints.
|
||||
#
|
||||
# Note: currently requires the user to provide AWS_ACCESS_KEY_ID as well as
|
||||
# AWS_SECRET_ACCESS_KEY in their environment variables.
|
||||
|
||||
terraform.backend.s3 = {
|
||||
endpoints.s3 = "s3.delroth.net";
|
||||
region = "garage";
|
||||
bucket = "bagel-terraform-state";
|
||||
key = "state";
|
||||
|
||||
# It's just a dump Garage server, don't try to be smart.
|
||||
skip_credentials_validation = true;
|
||||
skip_region_validation = true;
|
||||
skip_requesting_account_id = true;
|
||||
skip_metadata_api_check = true;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue