@cryptotaxi247 / infra / commits / 7e9ce0bd

survey: drop, has been migrated to non-critical-infra

Martin Weinelt committed Aug 2, 2024 at 02:52 UTC 7e9ce0bd6598bf80c1daa7838d49231903544e99
6 files changed -263
survey/README.md deleted
-9
@@ -1,9 +0,0 @@
1 -# survey.nixos.org
2 -
3 -A temporary machine for running the Nix community survey.
4 -
5 -## Deploy
6 -
7 -To deploy new changes, use `terraform apply` from a trusted machine.
8 -
9 -The NixOS configuration is deployed from the machine itself.
survey/flake.lock deleted
-27
@@ -1,27 +0,0 @@
1 -{
2 - "nodes": {
3 - "nixpkgs": {
4 - "locked": {
5 - "lastModified": 1643797576,
6 - "narHash": "sha256-o4aiI/W3V8qVkEyr/j9lrGhQ+NDcdIgZLyeIBJePy3A=",
7 - "owner": "garbas",
8 - "repo": "nixpkgs",
9 - "rev": "53be4bd13cb8f25ab93a92d1373ad66178e9aec6",
10 - "type": "github"
11 - },
12 - "original": {
13 - "owner": "garbas",
14 - "ref": "update-limesurvey",
15 - "repo": "nixpkgs",
16 - "type": "github"
17 - }
18 - },
19 - "root": {
20 - "inputs": {
21 - "nixpkgs": "nixpkgs"
22 - }
23 - }
24 - },
25 - "root": "root",
26 - "version": 7
27 -}
survey/flake.nix deleted
-78
@@ -1,78 +0,0 @@
1 -# To bootstrap:
2 -# $ nix-shell -p nixUnstable git --run "nix build --experimental-features 'nix-command flakes' ~/nixos-org-configurations/survey#nixosConfigurations.survey.config.system.build.toplevel"
3 -# $ ./result/bin/switch-to-configuration test
4 -#
5 -# To update:
6 -# $ nixos-rebuild switch --flake ~/nixos-org-configurations/survey
7 -
8 -{
9 - # TODO: temporary bump until the following PR is merged
10 - # https://github.com/NixOS/nixpkgs/pull/157832
11 - inputs.nixpkgs.url = "github:garbas/nixpkgs/update-limesurvey";
12 -
13 - outputs = flakes @ { self, nixpkgs }:
14 - let
15 - customOverlay = final: prev: {
16 - limesurvey = prev.limesurvey.overrideAttrs (old: {
17 - installPhase = old.installPhase + ''
18 - mkdir -p $out/share/limesurvey/upload/themes/survey/generalfiles/
19 - ln -s ${./nixos-lores.png} $out/share/limesurvey/upload/themes/survey/generalfiles/
20 - '';
21 - });
22 - };
23 - in {
24 - nixosConfigurations.survey = nixpkgs.lib.nixosSystem {
25 - system = "x86_64-linux";
26 - modules =
27 - [
28 - "${nixpkgs}/nixos/modules/virtualisation/amazon-image.nix"
29 - ../modules/common.nix
30 - ({ config, pkgs, lib, ... }:
31 - {
32 - ec2.hvm = true;
33 -
34 - networking.hostName = "survey";
35 - networking.firewall.allowedTCPPorts = [ 80 443 ];
36 -
37 - system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev;
38 -
39 - nix.package = pkgs.nixUnstable;
40 - nix.registry.nixpkgs.flake = nixpkgs;
41 -
42 - nixpkgs.overlays = [ customOverlay ];
43 -
44 - # needed since we use latest nixpkgs and we should probably
45 - # backport the limesurvey update to 21.11 channel
46 - nix.extraOptions = lib.mkForce ''
47 - experimental-features = nix-command flakes
48 - '';
49 -
50 - users.users.root.openssh.authorizedKeys.keys = with import ../ssh-keys.nix; [ eelco garbas ];
51 -
52 - services.limesurvey.enable = true;
53 - services.limesurvey.virtualHost.hostName = "survey.nixos.org";
54 - services.limesurvey.virtualHost.adminAddr = "webmaster@nixos.org";
55 - services.limesurvey.virtualHost.enableACME = true;
56 - services.limesurvey.virtualHost.forceSSL = true;
57 -
58 - security.acme.defaults.email = "webmaster@nixos.org";
59 - security.acme.acceptTerms = true;
60 -
61 - })
62 - ];
63 - };
64 -
65 - devShell.x86_64-linux =
66 - with nixpkgs.legacyPackages.x86_64-linux;
67 - mkShell {
68 - nativeBuildInputs = [
69 - awscli
70 - (terraform_0_15.withPlugins (p: with p; [ aws p.null external tls local ]))
71 - ];
72 -
73 - shellHook = ''
74 - alias tf=terraform
75 - '';
76 - };
77 - };
78 -}
survey/nixos-lores.png
Binary files a/survey/nixos-lores.png and /dev/null differ
survey/survey.tf deleted
-131
@@ -1,131 +0,0 @@
1 -locals {
2 - region = "eu-west-1"
3 -}
4 -
5 -output "public_ip" {
6 - #value = aws_instance.survey.public_ip
7 - value = aws_eip.survey.public_ip
8 -}
9 -
10 -resource "aws_vpc" "survey" {
11 - cidr_block = "10.0.0.0/16"
12 - enable_dns_hostnames = true
13 - enable_dns_support = true
14 - enable_classiclink = "false"
15 - instance_tenancy = "default"
16 -
17 - tags = {
18 - "Name" = "survey.nixos.org"
19 - }
20 -}
21 -
22 -resource "aws_subnet" "survey" {
23 - vpc_id = aws_vpc.survey.id
24 - cidr_block = "10.0.0.0/19"
25 - map_public_ip_on_launch = true
26 - availability_zone = "eu-west-1a"
27 -
28 - tags = {
29 - "Name" = "survey.nixos.org"
30 - }
31 -}
32 -
33 -resource "aws_route_table" "survey" {
34 - vpc_id = aws_vpc.survey.id
35 - route {
36 - cidr_block = "0.0.0.0/0"
37 - gateway_id = aws_internet_gateway.survey.id
38 - }
39 -}
40 -
41 -resource "aws_internet_gateway" "survey" {
42 - vpc_id = aws_vpc.survey.id
43 -
44 - tags = {
45 - "Name" = "survey.nixos.org"
46 - }
47 -}
48 -
49 -resource "aws_route_table_association" "survey" {
50 - subnet_id = aws_subnet.survey.id
51 - route_table_id = aws_route_table.survey.id
52 -}
53 -
54 -resource "aws_security_group" "survey" {
55 - name = "survey-sg"
56 - description = "survey.nixos.org"
57 - vpc_id = aws_vpc.survey.id
58 -
59 - ingress {
60 - from_port = 22
61 - to_port = 22
62 - protocol = "tcp"
63 - cidr_blocks = [ "0.0.0.0/0" ]
64 - }
65 -
66 - ingress {
67 - from_port = 80
68 - to_port = 80
69 - protocol = "tcp"
70 - cidr_blocks = [ "0.0.0.0/0" ]
71 - }
72 -
73 - ingress {
74 - from_port = 443
75 - to_port = 443
76 - protocol = "tcp"
77 - cidr_blocks = [ "0.0.0.0/0" ]
78 - }
79 -
80 - egress {
81 - from_port = 0
82 - to_port = 0
83 - protocol = "-1"
84 - cidr_blocks = ["0.0.0.0/0"]
85 - }
86 -}
87 -
88 -resource "aws_eip" "survey" {
89 - instance = aws_instance.survey.id
90 - vpc = true
91 -}
92 -
93 -resource "aws_instance" "survey" {
94 - ami = "ami-01d0304a712f2f3f0"
95 - instance_type = "t3a.xlarge"
96 - subnet_id = aws_subnet.survey.id
97 -
98 - vpc_security_group_ids = [ aws_security_group.survey.id ]
99 - key_name = aws_key_pair.generated_key.key_name
100 -
101 - root_block_device {
102 - tags = {
103 - "Name" = "survey.nixos.org"
104 - "Owners" = "edolstra@gmail.com, rok@garbas.si"
105 - }
106 - volume_size = 50
107 - }
108 -
109 - tags = {
110 - "Name" = "survey.nixos.org"
111 - }
112 -
113 - lifecycle {
114 - ignore_changes = [ami]
115 - }
116 -}
117 -
118 -resource "tls_private_key" "state_ssh_key" {
119 - algorithm = "RSA"
120 -}
121 -
122 -resource "local_file" "machine_ssh_key" {
123 - sensitive_content = tls_private_key.state_ssh_key.private_key_pem
124 - filename = "${path.module}/id_rsa.pem"
125 - file_permission = "0600"
126 -}
127 -
128 -resource "aws_key_pair" "generated_key" {
129 - key_name = "generated-key-${sha256(tls_private_key.state_ssh_key.public_key_openssh)}"
130 - public_key = tls_private_key.state_ssh_key.public_key_openssh
131 -}
survey/terraform.tf deleted
-18
@@ -1,18 +0,0 @@
1 -terraform {
2 - backend "s3" {
3 - bucket = "nixos-terraform-state"
4 - encrypt = true
5 - key = "targets/survey"
6 - region = "eu-west-1"
7 - }
8 -
9 - required_providers {
10 - aws = {
11 - source = "hashicorp/aws"
12 - }
13 - }
14 -}
15 -
16 -provider "aws" {
17 - region = "eu-west-1"
18 -}