Merge pull request #314767 from Guanran928/mihomo
nixos/mihomo: add assertion for configFile
This commit is contained in:
commit
230c213fae
@ -2,10 +2,11 @@
|
||||
# cfg.configFile contains secrets such as proxy servers' credential!
|
||||
# we dont want plaintext secrets in world-readable `/nix/store`.
|
||||
|
||||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.services.mihomo;
|
||||
@ -17,7 +18,6 @@ in
|
||||
package = lib.mkPackageOption pkgs "mihomo" { };
|
||||
|
||||
configFile = lib.mkOption {
|
||||
default = null;
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
description = "Configuration file to use.";
|
||||
};
|
||||
@ -67,7 +67,7 @@ in
|
||||
ExecStart = lib.concatStringsSep " " [
|
||||
(lib.getExe cfg.package)
|
||||
"-d /var/lib/private/mihomo"
|
||||
(lib.optionalString (cfg.configFile != null) "-f \${CREDENTIALS_DIRECTORY}/config.yaml")
|
||||
"-f \${CREDENTIALS_DIRECTORY}/config.yaml"
|
||||
(lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}")
|
||||
(lib.optionalString (cfg.extraOpts != null) cfg.extraOpts)
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user