Introduce a home-manager module
This commit is contained in:
parent
7b45de8920
commit
3ec49e0230
2 changed files with 47 additions and 1 deletions
43
home-manager.nix
Normal file
43
home-manager.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
self: {
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.programs.git-series-manager;
|
||||
|
||||
tomlFormat = pkgs.formats.toml {};
|
||||
in {
|
||||
options.programs.git-series-manager = {
|
||||
enable = mkEnableOption "git-series-manager, a way to manage git patchsets";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
description = "Package to use by git-series-manager";
|
||||
default = self.defaultPackage."${pkgs.system}";
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
inherit (tomlFormat) type;
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
sendmail_args = ["--sendmail-cmd=customSendmail" "--to=mail@list.com"];
|
||||
repo_url_base = "https://my.git-forge.com/my/project/";
|
||||
ci_url = "https://my.jenkins.instance/''${component}/job/''${branch}/''${ci_job}";
|
||||
editor = "nvim";
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
git-series-manager global configuration, can also be configured through ''${repo}/.patches/config.toml
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
xdg.configFile."git-series-manager/config.toml".source =
|
||||
tomlFormat.generate "config.toml" cfg.settings;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue