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:
parent
64796151f7
commit
a35f6b6043
1 changed files with 16 additions and 0 deletions
|
|
@ -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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue