diff --git a/.gitignore b/.gitignore index 6dd29b7..6af3800 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,58 @@ -bin/ \ No newline at end of file +bin/ + +# Created by https://www.toptal.com/developers/gitignore/api/emacs +# Edit at https://www.toptal.com/developers/gitignore?templates=emacs + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive +ltximg/** + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +# End of https://www.toptal.com/developers/gitignore/api/emacs diff --git a/flake.nix b/flake.nix index 5ac0a2d..de06660 100644 --- a/flake.nix +++ b/flake.nix @@ -52,5 +52,9 @@ }).config.services.mysql.dataDir; in { inherit flakes dockerImages containerTest; + + nginx-test = import ./infrastructure/nginx-test { + inherit rlib inputs pkgs; + }; }; } diff --git a/infrastructure/nginx-test/default.nix b/infrastructure/nginx-test/default.nix new file mode 100644 index 0000000..2354007 --- /dev/null +++ b/infrastructure/nginx-test/default.nix @@ -0,0 +1,10 @@ +{ pkgs, rlib, inputs }: +let + lockedNixpkgs = + (builtins.fromJSON (builtins.readFile ../../flake.lock)) + .nodes.nixpkgs.locked; +in +rlib.substitute pkgs.runCommandNoCC "nginx-test.hcl" ./job.hcl { + "nixpkgs.rev" = lockedNixpkgs.rev; + "nixpkgs.sha" = lockedNixpkgs.narHash; +} diff --git a/infrastructure/nginx-test/job.hcl b/infrastructure/nginx-test/job.hcl new file mode 100644 index 0000000..96ea8fa --- /dev/null +++ b/infrastructure/nginx-test/job.hcl @@ -0,0 +1,166 @@ +job "nginx-test" { + datacenters = [ "homelab-1" ] + type = "service" + + group "nginx-test" { + count = 1 + + network { + port "http" { + static = "8087" + to = "80" + } + } + + task "nix-prestart" { + lifecycle { + hook = "prestart" + sidecar = false + } + + driver = "raw_exec" + + template { + data = <