diff --git a/modules/programs/trippy.nix b/modules/programs/trippy.nix
index 0cb67bd87..391f8d549 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";
+ };
};
}