From a35f6b60430ff0c7803bd2a727df84c87569c167 Mon Sep 17 00:00:00 2001 From: Aguirre Matteo <158215792+aguirre-matteo@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:01:14 +0000 Subject: [PATCH] trippy: add forceUserConfig option (#7536) --- modules/programs/trippy.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/programs/trippy.nix b/modules/programs/trippy.nix index 0cb67bd8..391f8d54 100644 --- a/modules/programs/trippy.nix +++ b/modules/programs/trippy.nix @@ -6,6 +6,7 @@ }: let inherit (lib) + types mkIf mkEnableOption mkPackageOption @@ -46,6 +47,18 @@ in here: ''; }; + forceUserConfig = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + Whatever to force trippy to use user's config through the -c flag. + This will prevent certain commands such as 'sudo' ignoring + the configured settings. This will only work if you have + 'programs..enable' (bash, zsh, fish, ...), depending + on your shell. + ''; + }; }; config = mkIf cfg.enable { @@ -53,5 +66,8 @@ in xdg.configFile."trippy/trippy.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "trippy-config" cfg.settings; }; + home.shellAliases = mkIf cfg.forceUserConfig { + trip = "trip -c ${config.xdg.configHome}/trippy/trippy.toml"; + }; }; }