mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 15:22:59 +01:00
nixos/zeronet: add fileserverPort option
Without it, zeronet tried to write one to the read-only config file and crashed
This commit is contained in:
parent
35a504415f
commit
58f682742e
1 changed files with 12 additions and 1 deletions
|
@ -5,13 +5,15 @@ let
|
|||
|
||||
zConfFile = pkgs.writeTextFile {
|
||||
name = "zeronet.conf";
|
||||
|
||||
|
||||
text = ''
|
||||
[global]
|
||||
data_dir = ${cfg.dataDir}
|
||||
log_dir = ${cfg.logDir}
|
||||
'' + lib.optionalString (cfg.port != null) ''
|
||||
ui_port = ${toString cfg.port}
|
||||
'' + lib.optionalString (cfg.fileserverPort != null) ''
|
||||
fileserver_port = ${toString cfg.fileserverPort}
|
||||
'' + lib.optionalString (cfg.torAlways) ''
|
||||
tor = always
|
||||
'' + cfg.extraConfig;
|
||||
|
@ -41,6 +43,15 @@ in with lib; {
|
|||
description = "Optional zeronet web UI port.";
|
||||
};
|
||||
|
||||
fileserverPort = mkOption {
|
||||
# Not optional: when absent zeronet tries to write one to the
|
||||
# read-only config file and crashes
|
||||
type = types.int;
|
||||
default = 12261;
|
||||
example = 12261;
|
||||
description = "Zeronet fileserver port.";
|
||||
};
|
||||
|
||||
tor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
|
Loading…
Reference in a new issue