Skip to content

Commit

Permalink
quassel-webserver: init at 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
uwap authored and Mic92 committed Oct 21, 2016
1 parent 213ebc9 commit 42e93b5
Show file tree
Hide file tree
Showing 5 changed files with 2,581 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
99 changes: 99 additions & 0 deletions nixos/modules/services/web-apps/quassel-webserver.nix
Original file line number Diff line number Diff line change
@@ -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}";
};
};
};
}
43 changes: 43 additions & 0 deletions pkgs/applications/networking/irc/quassel-webserver/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];

This comment has been minimized.

Copy link
@veprbl

veprbl Oct 22, 2016

Member
error: undefined variable ‘uwap’ at /nix/store/yn51lis1brl03bs0l2wzpknrjhlimhbq-git-export/pkgs/applications/networking/irc/quassel-webserver/default.nix:40:39

This comment has been minimized.

Copy link
@vcunat

vcunat Oct 22, 2016

Member

Ah, yes. 210b3b3

platforms = platforms.unix;
};
}

0 comments on commit 42e93b5

Please sign in to comment.