Skip to content

Instantly share code, notes, and snippets.

Avatar
🦙
nixified

Jonas Chevalier zimbatm

🦙
nixified
View GitHub Profile
View data.tf
data "aws_vpc" "default" {
default = true
}
data "aws_subnet_ids" "default" {
vpc_id = data.aws_vpc.default.id
}
data "terraform_remote_state" "main" {
backend = "s3"
View ci.yml
on:
push:
branches:
- master
pull_request:
name: CI
env:
SCCACHE_IDLE_TIMEOUT: '0'
View binary-cache-upload.nix
{ config, pkgs, ... }:
{
# Configure nix to upload build results to the cache
nix.extraOptions =
let
post-build-hook = pkgs.writeShellScript "post-build-hook" ''
#
# Invoked by post-build hooks to upload new builds to the cache
#
set -euo pipefail
View debug-container.yaml
apiVersion: v1
kind: Pod
metadata:
name: zimbatm-debug-container-flannel
namespace: default
spec:
containers:
- command:
- sleep
- infinity
View uptermd.nix
{ pkgs, ... }:
let
domain = "upterm.numtide.com";
upterm-client = import ./upterm-client/BUILD.nix {
inherit pkgs;
};
in
{
services.uptermd = {
View machine.tf
# Fetch the latest NixOS AMI from 20.03
module "nixos_image" {
source = "git@github.com:tweag/terraform-nixos.git//aws_image_nixos?ref=43cbf822c07e705c66fb6d719ab58ed9cb05f87d"
release = "20.09"
}
data "external" "local_info" {
program = ["${path.module}/get_local_info.sh"]
}
View main.tf
variable "honeycomb_dataset" {}
variable "honeycomb_api_key" { default = "1ae3cea44e0026bf01627c6bab6f5227" }
variable "region" {}
resource "helm_release" "opentelemetry_collector" {
atomic = true
chart = "opentelemetry-collector"
name = "opentelemetry-collector"
repository = "https://open-telemetry.github.io/opentelemetry-helm-charts"
verify = false
View opentelemetry-collector.tf
module "opentelemetry-collector" {
source = "../../terraform-modules/opentelemetry-collector"
honeycomb_dataset = local.honeycomb_dataset
region = local.aws_region
}
View sc-dump.sh
#!/usr/bin/env bash
# Dump all the schemas from the registry $scr to $dir
set -euo pipefail
scr=${1:-localhost:8081}
dir=${2:-$PWD}
curl -s "${scr}/subjects" | jq -r .[] | while read -r subject; do
curl -s "${scr}/subjects/${subject}/versions" | jq -r .[] | while read -r version; do
# get the schema for a subject and version to a file
View baseline.nix
{ system ? builtins.currentSystem
, baseModulesFile ? ../nixos/modules/module-list.nix
}:
let
evalNixOS = import ../nixos/lib/eval-config.nix {
system = system;
baseModules = import baseModulesFile;
modules = [