3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #43308 from Chiiruno/dev/hydron

hydron: init at 2018-07-11
This commit is contained in:
Silvan Mosberger 2018-07-18 22:10:11 +02:00 committed by GitHub
commit 810f91f46d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 236 additions and 0 deletions

View file

@ -322,6 +322,7 @@
hdfs = 295; hdfs = 295;
mapred = 296; mapred = 296;
hadoop = 297; hadoop = 297;
hydron = 298;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -604,6 +605,7 @@
hdfs = 295; hdfs = 295;
mapred = 296; mapred = 296;
hadoop = 297; hadoop = 297;
hydron = 298;
# When adding a gid, make sure it doesn't match an existing # When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal # uid. Users and groups with the same name should have equal

View file

@ -676,6 +676,7 @@
./services/web-servers/caddy.nix ./services/web-servers/caddy.nix
./services/web-servers/fcgiwrap.nix ./services/web-servers/fcgiwrap.nix
./services/web-servers/hitch/default.nix ./services/web-servers/hitch/default.nix
./services/web-servers/hydron.nix
./services/web-servers/jboss/default.nix ./services/web-servers/jboss/default.nix
./services/web-servers/lighttpd/cgit.nix ./services/web-servers/lighttpd/cgit.nix
./services/web-servers/lighttpd/collectd.nix ./services/web-servers/lighttpd/collectd.nix

View file

@ -0,0 +1,105 @@
{ config, lib, pkgs, ... }:
let cfg = config.services.hydron;
in with lib; {
options.services.hydron = {
enable = mkEnableOption "hydron";
dataDir = mkOption {
type = types.path;
default = "/var/lib/hydron";
example = "/home/okina/hydron";
description = "Location where hydron runs and stores data.";
};
interval = mkOption {
type = types.str;
default = "hourly";
example = "06:00";
description = ''
How often we run hydron import and possibly fetch tags. Runs by default every hour.
The format is described in
<citerefentry><refentrytitle>systemd.time</refentrytitle>
<manvolnum>7</manvolnum></citerefentry>.
'';
};
listenAddress = mkOption {
type = types.nullOr types.str;
default = null;
example = "127.0.0.1:8010";
description = "Listen on a specific IP address and port.";
};
importPaths = mkOption {
type = types.listOf types.path;
default = [];
example = [ "/home/okina/Pictures" ];
description = "Paths that hydron will recursively import.";
};
fetchTags = mkOption {
type = types.bool;
default = true;
description = "Fetch tags for imported images and webm from gelbooru.";
};
};
config = mkIf cfg.enable {
systemd.services.hydron = {
description = "hydron";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
# Ensure folder exists and permissions are correct
mkdir -p ${escapeShellArg cfg.dataDir}/images
chmod 750 ${escapeShellArg cfg.dataDir}
chown -R hydron:hydron ${escapeShellArg cfg.dataDir}
'';
serviceConfig = {
PermissionsStartOnly = true;
User = "hydron";
Group = "hydron";
ExecStart = "${pkgs.hydron}/bin/hydron serve"
+ optionalString (cfg.listenAddress != null) " -a ${cfg.listenAddress}";
};
};
systemd.services.hydron-fetch = {
description = "Import paths into hydron and possibly fetch tags";
serviceConfig = {
Type = "oneshot";
User = "hydron";
Group = "hydron";
ExecStart = "${pkgs.hydron}/bin/hydron import "
+ optionalString cfg.fetchTags "-f "
+ (escapeShellArg cfg.dataDir) + "/images " + (escapeShellArgs cfg.importPaths);
};
};
systemd.timers.hydron-fetch = {
description = "Automatically import paths into hydron and possibly fetch tags";
after = [ "network.target" ];
wantedBy = [ "timers.target" ];
timerConfig.OnCalendar = cfg.interval;
};
users = {
groups.hydron.gid = config.ids.gids.hydron;
users.hydron = {
description = "hydron server service user";
home = cfg.dataDir;
createHome = true;
group = "hydron";
uid = config.ids.uids.hydron;
};
};
};
meta.maintainers = with maintainers; [ chiiruno ];
}

View file

@ -0,0 +1,33 @@
{ stdenv, buildGoPackage, fetchFromGitHub, pkgconfig, ffmpeg-full, graphicsmagick
, quicktemplate, go-bindata, easyjson }:
buildGoPackage rec {
name = "hydron-unstable-${version}";
version = "2018-07-15";
goPackagePath = "github.com/bakape/hydron";
goDeps = ./deps.nix;
src = fetchFromGitHub {
rev = "3906ace0b4cf48ba9acccf372377c7feb0665be4";
owner = "bakape";
repo = "hydron";
sha256 = "079a88740wxgq73sq8w96zppfng7af76k7h484x3w695qk83j33r";
};
enableParallelBuilding = true;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ ffmpeg-full graphicsmagick quicktemplate go-bindata easyjson ];
# Temporary workaround for https://github.com/NixOS/nixpkgs/issues/43593
preBuild = ''
rm go/src/github.com/bakape/hydron/ico.syso
'';
meta = with stdenv.lib; {
homepage = "https://github.com/bakape/hydron";
description = "High performance media tagger and organizer";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ chiiruno ];
platforms = platforms.all;
};
}

93
pkgs/servers/hydron/deps.nix generated Normal file
View file

@ -0,0 +1,93 @@
# This file was generated by https://github.com/kamilchm/go2nix v1.2.1
[
{
goPackagePath = "github.com/Masterminds/squirrel";
fetch = {
type = "git";
url = "https://github.com/Masterminds/squirrel";
rev = "b127ed9be03443fe3c0877e391130e3dd3f3107a";
sha256 = "04vgwm5g5486188656hiw1x56mrkv27s5g2s8mc1lz7z1ig5g5bg";
};
}
{
goPackagePath = "github.com/bakape/thumbnailer";
fetch = {
type = "git";
url = "https://github.com/bakape/thumbnailer";
rev = "fa88f595f3882773bc425b382eee71e3e2fa1291";
sha256 = "19xfn8aj1nhh5dj93hskzrhaa07sayd8agmz1vkkh6varqrldanf";
};
}
{
goPackagePath = "github.com/dimfeld/httptreemux";
fetch = {
type = "git";
url = "https://github.com/dimfeld/httptreemux";
rev = "7f532489e7739b3d49df5c602bf63549881fe753";
sha256 = "0hkw04rsvljvx8ynqjgz9cb743x09fd2xiiycrgz5vbsa8q9iyyk";
};
}
{
goPackagePath = "github.com/gorilla/handlers";
fetch = {
type = "git";
url = "https://github.com/gorilla/handlers";
rev = "13a38d26174b16d5b4bf6f1094c1389ec9879572";
sha256 = "0zg43blpyyy667y0kpiifk5a2w35jh8qkk4zwlabb365c0lzrv6v";
};
}
{
goPackagePath = "github.com/lann/builder";
fetch = {
type = "git";
url = "https://github.com/lann/builder";
rev = "1b87b36280d04fe7882d1512bf038ea2967ad534";
sha256 = "015q46awbyp47vld07yi7d27i0lkd82r7qn5230bb9qxl4mcfiqc";
};
}
{
goPackagePath = "github.com/lann/ps";
fetch = {
type = "git";
url = "https://github.com/lann/ps";
rev = "62de8c46ede02a7675c4c79c84883eb164cb71e3";
sha256 = "10yhcyymypvdiiipchsp80jbglk8c4r7lq7h54v9f4mxmvz6xgf7";
};
}
{
goPackagePath = "github.com/mailru/easyjson";
fetch = {
type = "git";
url = "https://github.com/mailru/easyjson";
rev = "3fdea8d05856a0c8df22ed4bc71b3219245e4485";
sha256 = "0g3crph77yhv4ipdnwqc32z4cp87ahi4ikad5kyy6q4znnxliz74";
};
}
{
goPackagePath = "github.com/mattn/go-sqlite3";
fetch = {
type = "git";
url = "https://github.com/mattn/go-sqlite3";
rev = "3aefd9f0a162514f66d0e4ceda3edc44e66b502e";
sha256 = "0as2kqmlvd21r481vxl457n5lxxp4i1jdjkmyqsjf5vg6xr9gd2d";
};
}
{
goPackagePath = "github.com/valyala/bytebufferpool";
fetch = {
type = "git";
url = "https://github.com/valyala/bytebufferpool";
rev = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7";
sha256 = "01lqzjddq6kz9v41nkky7wbgk7f1cw036sa7ldz10d82g5klzl93";
};
}
{
goPackagePath = "github.com/valyala/quicktemplate";
fetch = {
type = "git";
url = "https://github.com/valyala/quicktemplate";
rev = "a91e0946457b6583004fbfc159339b8171423aed";
sha256 = "1z89ang5pkq5qs5b2nwhzyrw0zjlsas539l9kix374fhka49n8yc";
};
}
]

View file

@ -12774,6 +12774,8 @@ with pkgs;
home-assistant = callPackage ../servers/home-assistant { }; home-assistant = callPackage ../servers/home-assistant { };
hydron = callPackage ../servers/hydron { };
ircdHybrid = callPackage ../servers/irc/ircd-hybrid { }; ircdHybrid = callPackage ../servers/irc/ircd-hybrid { };
jboss = callPackage ../servers/http/jboss { }; jboss = callPackage ../servers/http/jboss { };