bvm-twitterchiver: add twitterchiver-viewer

This commit is contained in:
Luke Granger-Brown 2021-03-31 23:33:44 +00:00
parent 12e595bf43
commit 69aba17ba4
2 changed files with 20 additions and 2 deletions

View file

@ -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";

View file

@ -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";
}