1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

helix: add ignores option

This commit is contained in:
Danil Suetin 2024-04-19 15:05:08 +05:00 committed by GitHub
parent 8ff7bb3f4d
commit b5b2b1ac63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View file

@ -96,6 +96,16 @@ in {
'';
};
ignores = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ ".build/" "!.gitignore" ];
description = ''
List of paths that should be globally ignored for file picker.
Supports the usual ignore and negative ignore (unignore) rules used in `.gitignore` files.
'';
};
themes = mkOption {
type = types.attrsOf tomlFormat.type;
default = { };
@ -195,6 +205,9 @@ in {
"helix/languages.toml" = mkIf (cfg.languages != { }) {
source = tomlFormat.generate "helix-languages-config" cfg.languages;
};
"helix/ignore" = mkIf (cfg.ignores != [ ]) {
text = concatStringsSep "\n" cfg.ignores + "\n";
};
};
themes = (mapAttrs' (n: v:

View file

@ -43,6 +43,8 @@ with lib;
}];
};
ignores = [ ".build/" "!.gitignore" ];
themes = {
base16 = let
transparent = "none";
@ -131,6 +133,9 @@ with lib;
assertFileContent \
home-files/.config/helix/languages.toml \
${./languages-expected.toml}
assertFileContent \
home-files/.config/helix/ignore \
${./ignore-expected}
assertFileContent \
home-files/.config/helix/themes/base16.toml \
${./theme-base16-expected.toml}

View file

@ -0,0 +1,2 @@
.build/
!.gitignore