1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

trippy: add forceUserConfig option (#7536)

This commit is contained in:
Aguirre Matteo 2025-07-24 20:01:14 +00:00 committed by GitHub
parent 64796151f7
commit a35f6b6043
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@
}: }:
let let
inherit (lib) inherit (lib)
types
mkIf mkIf
mkEnableOption mkEnableOption
mkPackageOption mkPackageOption
@ -46,6 +47,18 @@ in
here: <https://trippy.rs/reference/configuration/> here: <https://trippy.rs/reference/configuration/>
''; '';
}; };
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.<shell>.enable' (bash, zsh, fish, ...), depending
on your shell.
'';
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -53,5 +66,8 @@ in
xdg.configFile."trippy/trippy.toml" = mkIf (cfg.settings != { }) { xdg.configFile."trippy/trippy.toml" = mkIf (cfg.settings != { }) {
source = tomlFormat.generate "trippy-config" cfg.settings; source = tomlFormat.generate "trippy-config" cfg.settings;
}; };
home.shellAliases = mkIf cfg.forceUserConfig {
trip = "trip -c ${config.xdg.configHome}/trippy/trippy.toml";
};
}; };
} }