Unverified Commit 230c213f authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #314767 from Guanran928/mihomo

nixos/mihomo: add assertion for configFile
parents bd4241bc 818fe57b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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)
          ];