1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 13:39:46 +01:00
home-manager/modules/programs/topgrade.nix

61 lines
1.3 KiB
Nix
Raw Normal View History

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