move helix as home module, provide option youthlic.programs.helix.
This commit is contained in:
parent
aa4a261a04
commit
445dfe6543
5 changed files with 63 additions and 20 deletions
56
home/modules/helix/default.nix
Normal file
56
home/modules/helix/default.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options = {
|
||||
youthlic.programs.helix = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
description = ''
|
||||
enable helix editor
|
||||
'';
|
||||
};
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.package;
|
||||
default = with pkgs; [
|
||||
taplo
|
||||
markdown-oxide
|
||||
nixd
|
||||
deno
|
||||
nixfmt-rfc-style
|
||||
];
|
||||
example = (
|
||||
with pkgs;
|
||||
[
|
||||
deno
|
||||
]
|
||||
);
|
||||
description = ''
|
||||
extra packages for helix lsp and formatter
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
cfg = config.youthlic.programs.helix;
|
||||
in
|
||||
{
|
||||
programs.helix = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
settings =
|
||||
let
|
||||
config-file = builtins.readFile ./config.toml;
|
||||
config = builtins.fromTOML config-file;
|
||||
in
|
||||
config;
|
||||
};
|
||||
home.packages = cfg.extraPackages;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue