mirror of
https://github.com/9001/copyparty.git
synced 2025-09-28 12:42:26 -06:00
nix-module: Add globalExtraConfig option (#751)
Added an option, 'services.copyparty.globalExtraConfig', with default value and description to the NixOS Module. The option type is 'str' and the default value is the empty string. This string is appened verbatim to the [global] section of the config. This allows the use of settings which rely on repeated values to be correctly used. For example, the: 'ipu: 255.255.255.1/32=user' key which allows automatic sign in for users of a CIDR subnet. Because attribute sets in Nix must have unique keys, it is not possible to set more than one CIDR subnet/user pair. Signed-off-by: xvrqt <git@xvrqt.com>
This commit is contained in:
parent
87539800e8
commit
09e3018bf9
|
@ -50,6 +50,7 @@ let
|
||||||
|
|
||||||
configStr = ''
|
configStr = ''
|
||||||
${mkSection "global" cfg.settings}
|
${mkSection "global" cfg.settings}
|
||||||
|
${cfg.globalExtraConfig}
|
||||||
${mkSection "accounts" (accountsWithPlaceholders cfg.accounts)}
|
${mkSection "accounts" (accountsWithPlaceholders cfg.accounts)}
|
||||||
${concatStringsSep "\n" (mapAttrsToList mkVolume cfg.volumes)}
|
${concatStringsSep "\n" (mapAttrsToList mkVolume cfg.volumes)}
|
||||||
'';
|
'';
|
||||||
|
@ -131,6 +132,12 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
globalExtraConfig = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Appended to the end of the [global] section verbatim. This is useful for flags which are used in a repeating manner (e.g. ipu: 255.255.255.1=user) which can't be repeated in the settings = {} attribute set.";
|
||||||
|
};
|
||||||
|
|
||||||
accounts = mkOption {
|
accounts = mkOption {
|
||||||
type = types.attrsOf (
|
type = types.attrsOf (
|
||||||
types.submodule (
|
types.submodule (
|
||||||
|
@ -373,3 +380,4 @@ in
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue