1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/modules/programs/topgrade.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

58 lines
1.3 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.topgrade;
tomlFormat = pkgs.formats.toml { };
in
{
meta.maintainers = [ lib.hm.maintainers.msfjarvis ];
options.programs.topgrade = {
enable = lib.mkEnableOption "topgrade";
package = lib.mkPackageOption pkgs "topgrade" { };
settings = lib.mkOption {
type = tomlFormat.type;
default = { };
defaultText = lib.literalExpression "{ }";
example = lib.literalExpression ''
{
misc = {
assume_yes = true;
disable = [
"flutter"
"node"
];
set_title = false;
cleanup = true;
};
commands = {
"Run garbage collection on Nix store" = "nix-collect-garbage";
};
}
'';
description = ''
Configuration written to
{file}`$XDG_CONFIG_HOME/topgrade.toml`.
See <https://github.com/r-darwish/topgrade/wiki/Step-list> for the full list
of options.
'';
};
};
config = lib.mkIf cfg.enable {
home.packages = [ cfg.package ];
xdg.configFile."topgrade.toml" = lib.mkIf (cfg.settings != { }) {
source = tomlFormat.generate "topgrade-config" cfg.settings;
};
};
}