diff options
| author | Joe Mou <dev@mou.fo> | 2025-04-12 01:00:36 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2025-04-16 00:13:55 -0400 |
| commit | 61779313cfdf8556daf3a460a7781da432c0bbc3 (patch) | |
| tree | 506583a096ac75dcbac1dc87e16dad38b380a961 /hostnix/elmo | |
| parent | a453a7a062bcc6677a7a527032c3309dff2195a5 (diff) | |
Initial garage service
We don't want to use Nix for deployment because it's slow. Code must be
manually deployed to /opt/garage.
Diffstat (limited to 'hostnix/elmo')
| -rw-r--r-- | hostnix/elmo/configuration.nix | 2 | ||||
| -rw-r--r-- | hostnix/elmo/garage.nix | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/hostnix/elmo/configuration.nix b/hostnix/elmo/configuration.nix index ac5873d..b68ed67 100644 --- a/hostnix/elmo/configuration.nix +++ b/hostnix/elmo/configuration.nix @@ -6,6 +6,7 @@ ./dns.nix ./dyndns.nix ./email.nix + ./garage.nix ./git.nix ./hardware-configuration.nix ./home-assistant.nix @@ -47,6 +48,7 @@ gitFull openssl psmisc + python3 restic tmux tree diff --git a/hostnix/elmo/garage.nix b/hostnix/elmo/garage.nix new file mode 100644 index 0000000..f7970ca --- /dev/null +++ b/hostnix/elmo/garage.nix @@ -0,0 +1,29 @@ +{ pkgs, ... }: + +{ + systemd.tmpfiles.rules = [ + "d /opt 775 root root" + "d /opt/garage 770 joe nginx" + ]; + + systemd.services.garage = { + wantedBy = [ "multi-user.target" ]; + unitConfig = { + AssertPathExists = "/opt/garage/serve.py"; + }; + serviceConfig = { + WorkingDirectory = "/opt/garage"; + UMask = "002"; + User = "joe"; + Group = "nginx"; + }; + path = [ (pkgs.python3.withPackages (ps: [ ps.aiohttp ])) ]; + script = "python3 serve.py ./sock"; + }; + + services.nginx.virtualHosts."ga.mou.fo" = { + enableACME = true; + forceSSL = true; + locations."/".proxyPass = "http://unix:/opt/garage/sock"; + }; +} |
