summaryrefslogtreecommitdiff
path: root/hostnix/elmo/garage.nix
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2025-04-12 01:00:36 -0400
committerJoe Mou <dev@mou.fo>2025-04-16 00:13:55 -0400
commit61779313cfdf8556daf3a460a7781da432c0bbc3 (patch)
tree506583a096ac75dcbac1dc87e16dad38b380a961 /hostnix/elmo/garage.nix
parenta453a7a062bcc6677a7a527032c3309dff2195a5 (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/garage.nix')
-rw-r--r--hostnix/elmo/garage.nix29
1 files changed, 29 insertions, 0 deletions
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";
+ };
+}