quassel-webserver: init at 2.1.1

This commit is contained in:
uwap 2016-10-21 23:31:50 +02:00 committed by Jörg Thalheim
parent 213ebc94e0
commit 42e93b5f2a
5 changed files with 2581 additions and 0 deletions

View file

@ -494,6 +494,7 @@
./services/web-apps/pump.io.nix
./services/web-apps/tt-rss.nix
./services/web-apps/selfoss.nix
./services/web-apps/quassel-webserver.nix
./services/web-servers/apache-httpd/default.nix
./services/web-servers/caddy.nix
./services/web-servers/fcgiwrap.nix

View file

@ -0,0 +1,99 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.quassel-webserver;
quassel-webserver = cfg.pkg;
settings = ''
module.exports = {
default: {
host: '${cfg.quasselCoreHost}', // quasselcore host
port: ${toString cfg.quasselCorePort}, // quasselcore port
initialBacklogLimit: ${toString cfg.initialBacklogLimit}, // Amount of backlogs to fetch per buffer on connection
backlogLimit: ${toString cfg.backlogLimit}, // Amount of backlogs to fetch per buffer after first retrieval
securecore: ${if cfg.secureCore then "true" else "false"}, // Connect to the core using SSL
theme: '${cfg.theme}' // Default UI theme
},
themes: ['default', 'darksolarized'], // Available themes
forcedefault: ${if cfg.forceHostAndPort then "true" else "false"}, // Will force default host and port to be used, and will hide the corresponding fields in the UI
prefixpath: '${cfg.prefixPath}' // Configure this if you use a reverse proxy
};
'';
settingsFile = pkgs.writeText "settings-user.js" settings;
in {
options = {
services.quassel-webserver = {
enable = mkOption {
default = false;
type = types.bool;
description = "Whether to enable the quassel webclient service";
};
pkg = mkOption {
default = pkgs.quassel-webserver;
description = "The quassel-webserver package";
};
quasselCoreHost = mkOption {
default = "";
type = types.str;
description = "The default host of the quassel core";
};
quasselCorePort = mkOption {
default = 4242;
type = types.int;
description = "The default quassel core port";
};
initialBacklogLimit = mkOption {
default = 20;
type = types.int;
description = "Amount of backlogs to fetch per buffer on connection";
};
backlogLimit = mkOption {
default = 100;
type = types.int;
description = "Amount of backlogs to fetch per buffer after first retrieval";
};
secureCore = mkOption {
default = true;
type = types.bool;
description = "Connect to the core using SSL";
};
theme = mkOption {
default = "default";
type = types.str;
description = "default or darksolarized";
};
prefixPath = mkOption {
default = "";
type = types.str;
description = "Configure this if you use a reverse proxy. Must start with a '/'";
example = "/quassel";
};
port = mkOption {
default = 60443;
type = types.int;
description = "The port the quassel webserver should listen on";
};
useHttps = mkOption {
default = true;
type = types.bool;
description = "Whether the quassel webserver connection should be a https connection";
};
forceHostAndPort = mkOption {
default = false;
type = types.bool;
description = "Force the users to use the quasselCoreHost and quasselCorePort defaults";
};
};
};
config = mkIf cfg.enable {
systemd.services.quassel-webserver = {
description = "A web server/client for Quassel";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${quassel-webserver}/lib/node_modules/quassel-webserver/bin/www -p ${toString cfg.port} -m ${if cfg.useHttps == true then "https" else "http"} -c ${settingsFile}";
};
};
};
}

View file

@ -0,0 +1,43 @@
{ stdenv, lib, fetchFromGitHub, callPackage, python, utillinux}:
with lib;
let
nodePackages = callPackage <nixpkgs/pkgs/top-level/node-packages.nix> {
neededNatives = [ python ];
self = nodePackages;
generated = ./quassel-webserver.nix;
};
in nodePackages.buildNodePackage rec {
name = "quassel-webserver-${version}";
version = "2.1.1";
src = fetchFromGitHub {
owner = "magne4000";
repo = "quassel-webserver";
rev = "dda457f38795d15565557a8629085063fa6a7378";
sha256 = "0syglfdmjnssxdiak1dw8cns5f736v58zmlsh81dvxww90gx3k7h";
};
buildInputs = nodePackages.nativeDeps."quassel-webserver" or [];
deps = [ nodePackages.by-spec."body-parser"."^1.15.2"
nodePackages.by-spec."commander"."^2.9.0"
nodePackages.by-spec."cookie-parser"."~1.4.3"
nodePackages.by-spec."express"."^4.14.0"
nodePackages.by-spec."jade"."~1.11.0"
nodePackages.by-spec."less"."^2.7.1"
nodePackages.by-spec."less-middleware"."^2.2.0"
nodePackages.by-spec."libquassel"."~2.0.5"
nodePackages.by-spec."morgan"."^1.7.0"
nodePackages.by-spec."net-browserify-alt"."^1.0.0"
nodePackages.by-spec."serve-favicon"."~2.3.0"
];
peerDependencies = [];
meta = {
description = "A web server/client for Quassel";
license = licenses.mit;
homepage = "https://github.com/magne4000/quassel-webserver";
maintainers = with maintainers; [ uwap ];
platforms = platforms.unix;
};
}

File diff suppressed because it is too large Load diff

View file

@ -14203,6 +14203,8 @@ in
withKDE = false;
};
quassel-webserver = callPackage ../applications/networking/irc/quassel-webserver { };
quirc = callPackage ../tools/graphics/quirc {};
quodlibet = callPackage ../applications/audio/quodlibet { };