diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2020-02-26 20:16:30 -0500 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2020-02-26 20:27:09 -0500 |
commit | 457585940971ce34a8e46b330b3bb729cc1af3f8 (patch) | |
tree | e571ac51ddf1a7569e6b24af497500983a97976a /config | |
parent | 954d0edebd7a3e5cebf93f5053a4b8f18c77feae (diff) |
Run pjournal on dragon
Diffstat (limited to 'config')
-rw-r--r-- | config/pjournal.nix | 14 | ||||
-rw-r--r-- | config/web-server.nix | 12 |
2 files changed, 20 insertions, 6 deletions
diff --git a/config/pjournal.nix b/config/pjournal.nix index 840e72a..59c9af8 100644 --- a/config/pjournal.nix +++ b/config/pjournal.nix @@ -6,14 +6,24 @@ in { options = { services.pjournal = { + enable = mkOption { + type = types.bool; + default = false; + }; + package = mkOption { type = types.package; default = pkgs.callPackage ../pkgs/pjournal/default.nix {}; }; + + port = mkOption { + type = types.int; + default = 8080; + }; }; }; - config = { + config = mkIf cfg.enable { environment.systemPackages = [ cfg.package ]; @@ -43,7 +53,7 @@ in # the database. ${cfg.package}/bin/pjournal \ --database_url postgres://pjournal@/pjournal \ - --port 8080 + --port ${toString cfg.port} ''; serviceConfig = { User = "pjournal"; diff --git a/config/web-server.nix b/config/web-server.nix index 4ef070b..77a508a 100644 --- a/config/web-server.nix +++ b/config/web-server.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: let mpd_loc = (import ../data/aliases.nix).services.mpd; mpdweb_loc = (import ../data/aliases.nix).services.mpdweb; + pjournal_loc = (import ../data/aliases.nix).services.pjournal; in { imports = [ ./orbekk-pkgs.nix ]; @@ -34,7 +35,7 @@ locations."/" = { extraConfig = '' try_files $uri @storage; - # kill cache + # kill cache add_header Last-Modified $date_gmt; add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; if_modified_since off; @@ -56,9 +57,9 @@ alias = "/var/www/munin/"; extraConfig = "autoindex on;"; }; - locations."/mpd" = { - proxyPass = "http://${mpd_loc.address}:${toString mpd_loc.port}/"; - }; + locations."/mpd" = { + proxyPass = "http://${mpd_loc.address}:${toString mpd_loc.port}/"; + }; #locations."/systemd" = { # proxyPass = "http://10.0.20.15:11105/"; #}; @@ -92,6 +93,9 @@ "kufieta.net" = template // { locations."/".proxyPass = "http://10.0.20.13:8080"; }; + "journal.orbekk.com" = template // { + locations."/".proxyPass = "http://${pjournal_loc.address}:${toString pjournal_loc.port}"; + }; }; }; } |