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 = {
|
2023-07-02 01:45:18 +02:00
|
|
|
enable = mkEnableOption "topgrade";
|
2021-04-29 01:56:58 +02:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.topgrade;
|
2021-10-09 11:14:08 +02:00
|
|
|
defaultText = literalExpression "pkgs.topgrade";
|
2023-07-02 01:45:18 +02:00
|
|
|
description = "The package to use for the topgrade binary.";
|
2021-04-29 01:56:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
settings = mkOption {
|
|
|
|
type = tomlFormat.type;
|
|
|
|
default = { };
|
2021-10-09 11:14:08 +02:00
|
|
|
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";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
'';
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2021-04-29 01:56:58 +02:00
|
|
|
Configuration written to
|
2023-07-01 01:30:13 +02:00
|
|
|
{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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|