Commit b1c8e79 1 parent 75071ec commit b1c8e79 Copy full SHA for b1c8e79
File tree 8 files changed +109
-17
lines changed
8 files changed +109
-17
lines changed Original file line number Diff line number Diff line change 1
- result
2
- .direnv
3
1
doc /index.html
4
2
5
3
# Result of bud commands
9
7
10
8
pkgs /_sources /.shake *
11
9
12
- # pre-commit-hooks.nix
13
- /.pre-commit-config.yaml
10
+ result
11
+ result *
12
+ .direnv
13
+ .pre-commit-config.yaml
14
+ ** /.terraform
15
+ content * .tar.gz
16
+ create_config_version.json
17
+ generated_config.tf.json
18
+
19
+ .env
Original file line number Diff line number Diff line change 8
8
flake . deploy = {
9
9
nodes = {
10
10
bunky = {
11
- hostname = "5.78.53.16 " ;
11
+ hostname = "5.78.50.232 " ;
12
12
profiles . system = {
13
13
sshUser = "admin" ;
14
14
path = inputs . deploy-rs . lib . x86_64-linux . activate . nixos self . nixosConfigurations . bunky ;
Original file line number Diff line number Diff line change 47
47
pushd $(git rev-parse --show-toplevel)
48
48
49
49
# determine the path to the configuration
50
- configurationPath=$(cat ${ self' . packages . terraformConfigurationMatrix } /terraform-configuration-matrix.json | ${ jq } -r '.configurations[] | select(.name == "'$configurationName'" ) | .path')
50
+ export configurationPath=$(cat ${ self' . packages . terraformConfigurationMatrix } /terraform-configuration-matrix.json | ${ jq } -r '.configurations[] | select(.name == "'$configurationName'" ) | .path')
51
51
52
52
# copy the generated terraform configuration to the configuration path
53
+ config_file_path="$configurationPath/config.tf.json"
54
+ echo $config_file_path
53
55
cp "$configurationPath/config.tf.json" ./terraform/configurations/$configurationName/config.tf.json
56
+ # make it writable since it is read-only in the nix store
57
+ chmod +w ./terraform/configurations/$configurationName/config.tf.json
54
58
55
59
# execute the terraform command
56
60
${ terraform-cli } -chdir=./terraform/configurations/$configurationName "$@"
Original file line number Diff line number Diff line change @@ -4,23 +4,21 @@ variable "hcloud-token" {
4
4
sensitive = true
5
5
}
6
6
7
- variable "name" {
8
- }
9
-
10
7
locals {
11
8
build-id = " ${ uuidv4 ()} "
12
9
build-labels = {
13
- " name" = var .name
10
+ " name" = local .name
14
11
" packer.io.build.time" = " {{ timestamp }}"
15
12
}
13
+ name = " hetzner-base-nixos-{{ timestamp }}"
16
14
}
17
15
18
16
source "hcloud" "base" {
19
17
server_type = " cx21"
20
18
image = " debian-11"
21
19
rescue = " linux64"
22
20
location = " nbg1"
23
- snapshot_name = var . name
21
+ snapshot_name = " hetzner-base-nixos-{{ timestamp }} "
24
22
snapshot_labels = local. build-labels
25
23
ssh_username = " root"
26
24
token = var. hcloud-token
@@ -40,5 +38,4 @@ build {
40
38
post-processor "manifest" {
41
39
custom_data = local. build-labels
42
40
}
43
-
44
41
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ cloud {
3
+ organization = " justinrubek"
4
+
5
+ workspaces {
6
+ name = " hetzner"
7
+ }
8
+ }
9
+
10
+ required_providers {
11
+ hcloud = {
12
+ source = " hetznercloud/hcloud"
13
+ version = " 1.36.1"
14
+ }
15
+ random = {
16
+ source = " hashicorp/random"
17
+ version = " 3.4.3"
18
+ }
19
+ }
20
+
21
+ required_version = " >= 1.0"
22
+ }
Original file line number Diff line number Diff line change
1
+ { ...} : {
2
+ # configure hcloud
3
+ variable . hcloud_token . sensitive = true ;
4
+ provider . hcloud . token = "\ ${var.hcloud_token}" ;
5
+
6
+ data . hcloud_image . nixos_base = {
7
+ id = "92487340" ;
8
+ } ;
9
+
10
+ resource . hcloud_server . bunky = {
11
+ name = "bunky" ;
12
+
13
+ image = "\ ${data.hcloud_image.nixos_base.id}" ;
14
+ server_type = "cpx11" ;
15
+ location = "hil" ;
16
+
17
+ public_net = {
18
+ ipv4_enabled = true ;
19
+ ipv6_enabled = true ;
20
+ } ;
21
+ } ;
22
+ }
You can’t perform that action at this time.
0 commit comments