diff --git a/go/twitterchiver/default.nix b/go/twitterchiver/default.nix index cbc25f85e7..9d62474da8 100644 --- a/go/twitterchiver/default.nix +++ b/go/twitterchiver/default.nix @@ -12,7 +12,7 @@ ]; }; - viewer = depot.third_party.buildGo.program { + viewer = (depot.third_party.buildGo.program { name = "viewer"; srcs = [ ./viewer/viewer.go ]; deps = [ @@ -32,7 +32,13 @@ cp -R ${builtins.filterSource (path: type: (type == "directory" && depot.lib.hasSuffix "/templates" path) || (depot.lib.hasInfix "/templates/" path)) ./viewer} $out '' ) ]; - }; + }).overrideAttrs (oldAttrs: { + buildCommand = '' + ${oldAttrs.buildCommand} + mkdir $out/share + cp -R ${builtins.filterSource (path: type: (type == "directory" && depot.lib.hasSuffix "/templates" path) || (depot.lib.hasInfix "/templates/" path)) ./viewer}/* $out/share + ''; + }); relatedfetcher = depot.third_party.buildGo.program { name = "relatedfetcher"; diff --git a/ops/nixos/bvm-twitterchiver/default.nix b/ops/nixos/bvm-twitterchiver/default.nix index d21c3d9b0b..d926399298 100644 --- a/ops/nixos/bvm-twitterchiver/default.nix +++ b/ops/nixos/bvm-twitterchiver/default.nix @@ -39,5 +39,17 @@ group = "twitterchiver"; }; + systemd.services.twitterchiver-viewer = { + description = "Twitterchiver Viewer"; + wants = ["network-online.target"]; + wantedBy = ["multi-user.target"]; + serviceConfig = { + ExecStart = "${depot.go.viewer}/bin/minotarproxy --user_to_twitter=lukegb@lukegb.com:lukegb,bgekul"; + WorkingDirectory = "${depot.go.viewer}/share"; + User = "twitterchiver"; + Restart = "always"; + }; + }; + system.stateVersion = "21.05"; }