diff --git a/flake.nix b/flake.nix index cd01998..c2a6687 100644 --- a/flake.nix +++ b/flake.nix @@ -242,7 +242,6 @@ in { }; shellHook = '' mize_project_root=$(${pkgs.lib.getExe pkgs.git} rev-parse --show-toplevel) - export MIZE_CONFIG_FILES=$mize_project_root/mize_config.toml ''; #_shell_type = "rust"; nativeBuildInputs = [ @@ -332,6 +331,11 @@ in { example = "/home/user/here/mize.toml"; description = "If set to NOT null, the mize daemon service will use the config file at this path instead of one written to the nix store"; }; + enableConfigFile = lib.mkOption { + type = lib.types.bool; + default = true; + description = "allows to disable setting MIZE_CONFIG_FILES env var for the mize daemon service"; + }; config = lib.mkOption { type = lib.types.attrsOf lib.types.anything; default = {}; @@ -347,7 +351,7 @@ in { systemd.user.services.mize = { description = "the mize daemon"; wantedBy = [ "default.target" ]; - environment = { + environment = lib.mkIf config.mize.enableConfigFile { MIZE_CONFIG_FILES = let fileInStore = (pkgs.formats.toml {}).generate "mize-daemon-config.toml" config.mize.config; in if config.mize.debugConfigFile == null then "${fileInStore}" else "${config.mize.debugConfigFile}"; }; serviceConfig = {