mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 05:05:29 +03:00
nixos/eternal-terminal: init new module.
This commit is contained in:
parent
daa0cd73f3
commit
af1a285017
2 changed files with 97 additions and 0 deletions
|
@ -504,6 +504,7 @@
|
||||||
./services/networking/dnsmasq.nix
|
./services/networking/dnsmasq.nix
|
||||||
./services/networking/ejabberd.nix
|
./services/networking/ejabberd.nix
|
||||||
./services/networking/epmd.nix
|
./services/networking/epmd.nix
|
||||||
|
./services/networking/eternal-terminal.nix
|
||||||
./services/networking/fakeroute.nix
|
./services/networking/fakeroute.nix
|
||||||
./services/networking/ferm.nix
|
./services/networking/ferm.nix
|
||||||
./services/networking/firefox/sync-server.nix
|
./services/networking/firefox/sync-server.nix
|
||||||
|
|
96
nixos/modules/services/networking/eternal-terminal.nix
Normal file
96
nixos/modules/services/networking/eternal-terminal.nix
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.services.eternal-terminal;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.eternal-terminal = {
|
||||||
|
|
||||||
|
enable = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
description = ''
|
||||||
|
Enable the Eternal Terminal server.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
default = null;
|
||||||
|
type = types.nullOr types.int;
|
||||||
|
description = ''
|
||||||
|
The port the server should listen on. Will use the server's default (2022) if not specified.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
verbosity = mkOption {
|
||||||
|
default = 0;
|
||||||
|
type = types.int;
|
||||||
|
description = ''
|
||||||
|
The verbosity level (0-9).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
silence = mkOption {
|
||||||
|
default = 0;
|
||||||
|
type = types.int;
|
||||||
|
description = ''
|
||||||
|
Silence.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
logSize = mkOption {
|
||||||
|
default = 20971520;
|
||||||
|
type = types.int;
|
||||||
|
description = ''
|
||||||
|
The maximum log size.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
# We need to ensure the et package is fully installed because
|
||||||
|
# the (remote) et client runs the `etterminal` binary when it
|
||||||
|
# connects.
|
||||||
|
environment.systemPackages = [ pkgs.eternal-terminal ];
|
||||||
|
|
||||||
|
systemd.services = {
|
||||||
|
eternal-terminal = {
|
||||||
|
description = "Eternal Terminal server.";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "syslog.target" "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "forking";
|
||||||
|
ExecStart = "${pkgs.eternal-terminal}/bin/etserver --daemon --cfgfile=${pkgs.writeText "et.cfg" ''
|
||||||
|
; et.cfg : Config file for Eternal Terminal
|
||||||
|
;
|
||||||
|
|
||||||
|
${optionalString (cfg.port != null) ''
|
||||||
|
[Networking]
|
||||||
|
port = ${toString cfg.port}
|
||||||
|
''}
|
||||||
|
[Debug]
|
||||||
|
verbose = ${toString cfg.verbosity}
|
||||||
|
silent = ${toString cfg.silence}
|
||||||
|
logsize = ${toString cfg.logSize}
|
||||||
|
''}";
|
||||||
|
Restart = "on-failure";
|
||||||
|
KillMode = "process";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue