-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
2,581 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
43
pkgs/applications/networking/irc/quassel-webserver/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ]; | ||
platforms = platforms.unix; | ||
}; | ||
} |
Oops, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
veprblOct 22, 2016
MemberThis comment has been minimized.
Sorry, something went wrong.
vcunatOct 22, 2016
MemberAh, yes. 210b3b3