diff options
| -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"; + }; +} |
