mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-06 17:11:03 +01:00
kickoff: add module (#6918)
This commit is contained in:
parent
be7cf1709b
commit
69c60b035e
6 changed files with 100 additions and 0 deletions
58
modules/programs/kickoff.nix
Normal file
58
modules/programs/kickoff.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkIf
|
||||
mkEnableOption
|
||||
mkPackageOption
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.programs.kickoff;
|
||||
|
||||
formatter = pkgs.formats.toml { };
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
|
||||
|
||||
options.programs.kickoff = {
|
||||
enable = mkEnableOption "kickoff";
|
||||
package = mkPackageOption pkgs "kickoff" { nullable = true; };
|
||||
settings = mkOption {
|
||||
type = formatter.type;
|
||||
default = { };
|
||||
example = ''
|
||||
padding = 100;
|
||||
font_size = 32;
|
||||
search.show_hidden_files = false;
|
||||
history.decrease_interval = 48;
|
||||
|
||||
keybinding = {
|
||||
paste = [ "ctrl+v" ];
|
||||
execute = [ "KP_Enter" "Return" ];
|
||||
complete = [ "Tab" ];
|
||||
};
|
||||
'';
|
||||
description = ''
|
||||
Configuration settings for kickoff. All the available options can be found
|
||||
here: <https://github.com/j0ru/kickoff/blob/main/assets/default_config.toml>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "programs.kickoff" pkgs lib.platforms.linux)
|
||||
];
|
||||
|
||||
home.packages = mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
xdg.configFile = mkIf (cfg.settings != { }) {
|
||||
"kickoff/config.toml".source = formatter.generate "kickoff-config-toml" cfg.settings;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue