-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a96575
commit 735d190
Showing
7 changed files
with
61 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
SHELL:=/usr/bin/env bash | ||
|
||
MAKEFLAGS += --no-builtin-rules --no-builtin-variables | ||
# Consider adding a valid email in an environment variable | ||
# Consider adding a valid email in an environment variable TF_VAR_cert_manager_email | ||
# of your shell profile | ||
CERT_MANAGER_EMAIL?[email protected] | ||
TF_VAR_cert_manager_email?[email protected] | ||
|
||
UNAME_S := $(shell uname -s) | ||
|
||
BUILDER_EXEC:= | ||
ADD_CERT_CMD:=cp /tmp/pebble-ca.pem /etc/ssl/certs/pebble-ca.pem | ||
ifeq ($(UNAME_S),Darwin) | ||
# set variable for Darwin | ||
BUILDER_EXEC:=nix develop .\#builder --extra-experimental-features flakes --extra-experimental-features nix-command --command | ||
ADD_CERT_CMD:=sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain /tmp/pebble-ca.pem | ||
endif | ||
|
||
start: | ||
@$(BUILDER_EXEC) echo 'Started required daemons' | ||
|
||
init: | ||
@echo "Initializing" | ||
@terraform -chdir=libvirt init -upgrade | ||
@terraform init -upgrade | ||
|
||
vm: | ||
build: | ||
@echo "Building VM" | ||
@$(BUILDER_EXEC) nix build .#nixosConfigurations.aarch64-darwin.default --system aarch64-linux | ||
|
||
vm: start | ||
@echo "Creating VM" | ||
@terraform -chdir=libvirt apply -auto-approve | ||
@ssh zizou@localhost -p 2222 'sudo cat /etc/rancher/k3s/k3s.yaml' > ~/.kube/config | ||
|
@@ -31,4 +48,4 @@ infra-destroy: | |
|
||
trust-ca: | ||
@curl -k https://localhost:15000/intermediates/0 > /tmp/pebble-ca.pem | ||
@sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain /tmp/pebble-ca.pem | ||
@$(ADD_CERT_CMD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters