Merge pull request #9072 from benley/shout

Shout: new package and nixos module
This commit is contained in:
Arseniy Seroka 2015-08-02 16:07:36 +03:00
commit 372e5a7dcf
6 changed files with 5183 additions and 0 deletions

View File

@ -227,6 +227,7 @@
riemanntools = 203;
subsonic = 204;
riak = 205;
shout = 206;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -432,6 +433,7 @@
riemanntools = 203;
subsonic = 204;
riak = 205;
#shout = 206; #unused
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal

View File

@ -328,6 +328,7 @@
./services/networking/searx.nix
./services/networking/seeks.nix
./services/networking/skydns.nix
./services/networking/shout.nix
./services/networking/spiped.nix
./services/networking/sslh.nix
./services/networking/ssh/lshd.nix

View File

@ -0,0 +1,80 @@
{ pkgs, lib, config, options, ... }:
with lib;
let
cfg = config.services.shout;
shoutHome = "/var/lib/shout";
in {
options.services.shout = {
enable = mkEnableOption "Shout web IRC client";
private = mkOption {
type = types.bool;
default = false;
description = ''
Make your shout instance private. You will need to configure user
accounts by adding entries in <filename>${shoutHome}/users</filename>.
'';
};
host = mkOption {
type = types.string;
default = "0.0.0.0";
description = "IP interface to listen on for http connections.";
};
port = mkOption {
type = types.int;
default = 9000;
description = "TCP port to listen on for http connections.";
};
configFile = mkOption {
type = types.nullOr types.lines;
default = null;
description = ''
Contents of Shout's <filename>config.js</filename> file. If left empty,
Shout will generate from its defaults at first startup.
Documentation: http://shout-irc.com/docs/server/configuration.html
'';
};
};
config = mkIf cfg.enable {
users.extraUsers = singleton {
name = "shout";
uid = config.ids.uids.shout;
description = "Shout daemon user";
home = shoutHome;
createHome = true;
};
systemd.services.shout = {
description = "Shout web IRC client";
wantedBy = [ "multi-user.target" ];
wants = [ "network-online.target" ];
after = [ "network-online.target" ];
preStart = if isNull cfg.configFile then null
else ''
ln -sf ${pkgs.writeText "config.js" cfg.configFile} \
${shoutHome}/config.js
'';
script = concatStringsSep " " [
"${pkgs.shout}/bin/shout"
(if cfg.private then "--private" else "--public")
"--port" (toString cfg.port)
"--host" (toString cfg.host)
"--home" shoutHome
];
serviceConfig = {
User = "shout";
ProtectHome = "true";
ProtectSystem = "full";
PrivateTmp = "true";
};
};
};
}

View File

@ -0,0 +1,49 @@
{ stdenv, fetchFromGitHub, callPackage, python, utillinux }:
with stdenv.lib;
let
nodePackages = callPackage (import ../../../../top-level/node-packages.nix) {
neededNatives = [ python ] ++ optional (stdenv.isLinux) utillinux;
self = nodePackages;
generated = ./package.nix;
};
in nodePackages.buildNodePackage rec {
name = "shout-${version}";
version = "0.51.1";
src = fetchFromGitHub {
owner = "erming";
repo = "shout";
rev = "2cee0ea6ef5ee51de0190332f976934b55bbc8e4";
sha256 = "1kci1qha1csb9sqb4ig487q612hgdn5lycbcpad7m9r6chn835qg";
};
buildInputs = nodePackages.nativeDeps."shout" or [];
deps = [
nodePackages.by-spec."bcrypt-nodejs"."0.0.3"
nodePackages.by-spec."cheerio"."^0.17.0"
nodePackages.by-spec."commander"."^2.3.0"
nodePackages.by-spec."event-stream"."^3.1.7"
nodePackages.by-spec."express"."^4.9.5"
nodePackages.by-spec."lodash"."~2.4.1"
nodePackages.by-spec."mkdirp"."^0.5.0"
nodePackages.by-spec."moment"."~2.7.0"
nodePackages.by-spec."read"."^1.0.5"
nodePackages.by-spec."request"."^2.51.0"
nodePackages.by-spec."slate-irc"."~0.7.3"
nodePackages.by-spec."socket.io"."~1.0.6"
];
peerDependencies = [];
meta = {
description = "Web IRC client that you host on your own server";
license = licenses.mit;
homepage = http://shout-irc.com/;
maintainers = with maintainers; [ benley ];
platforms = platforms.unix;
};
}

File diff suppressed because it is too large Load Diff

View File

@ -2949,6 +2949,8 @@ let
shotwell = callPackage ../applications/graphics/shotwell { };
shout = callPackage ../applications/networking/irc/shout { };
shellinabox = callPackage ../servers/shellinabox { };
sic = callPackage ../applications/networking/irc/sic { };