this repo has no description
at master 1.4 kB view raw
1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: let 7 toArg = k: v: "--${k}=${v}"; 8 listToArgs = k: vs: map (toArg k) vs; 9 attrsetToArgs = attr: lib.strings.concatStringsSep "\n" (lib.lists.flatten (lib.attrsets.mapAttrsToList listToArgs attr)); 10 cfg = config.programs.ctags; 11in { 12 options.programs.ctags = { 13 enable = lib.mkEnableOption "ctags"; 14 15 package = lib.mkOption { 16 type = lib.types.package; 17 default = pkgs.universal-ctags; 18 defaultText = lib.literalExpression "pkgs.universal-ctags"; 19 description = "The <literal>ctags</literal> package to use."; 20 }; 21 22 flags = lib.mkOption { 23 type = lib.types.attrsOf lib.types.anything; 24 default = {}; 25 }; 26 }; 27 28 config = { 29 programs.ctags = { 30 enable = true; 31 32 flags = { 33 fields = [ 34 "+l" 35 "+n" 36 "+z" 37 "+Z" 38 ]; 39 40 exclude = [ 41 "_build" 42 "deps" 43 ".elixir_ls" 44 "mix.lock" 45 46 ".pijul" 47 "log" 48 "tmp" 49 ".direnv" 50 51 ".projections.json" 52 "coveralls.json" 53 54 "node_modules" 55 "project.json" 56 "package-lock.json" 57 "yarn.lock" 58 59 "target" 60 "Cargo.lock" 61 62 "flake.lock" 63 ]; 64 }; 65 }; 66 67 home.packages = [cfg.package]; 68 69 xdg.configFile.ctags = { 70 target = "ctags/config.ctags"; 71 72 text = attrsetToArgs cfg.flags; 73 }; 74 }; 75}