neovim: apply nixfmt

This commit is contained in:
Robert Helgesson 2020-10-12 22:50:49 +02:00
parent 18a05a9604
commit aecd4acfb4
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 24 additions and 31 deletions

1
format
View file

@ -36,7 +36,6 @@ find . -name '*.nix' \
! -path ./modules/programs/firefox.nix \
! -path ./modules/programs/gpg.nix \
! -path ./modules/programs/lesspipe.nix \
! -path ./modules/programs/neovim.nix \
! -path ./modules/programs/ssh.nix \
! -path ./modules/programs/tmux.nix \
! -path ./modules/programs/vscode.nix \

View file

@ -9,18 +9,16 @@ let
extraPythonPackageType = mkOptionType {
name = "extra-python-packages";
description = "python packages in python.withPackages format";
check = with types; (x: if isFunction x
then isList (x pkgs.pythonPackages)
else false);
check = with types;
(x: if isFunction x then isList (x pkgs.pythonPackages) else false);
merge = mergeOneOption;
};
extraPython3PackageType = mkOptionType {
name = "extra-python3-packages";
description = "python3 packages in python.withPackages format";
check = with types; (x: if isFunction x
then isList (x pkgs.python3Packages)
else false);
check = with types;
(x: if isFunction x then isList (x pkgs.python3Packages) else false);
merge = mergeOneOption;
};
@ -44,21 +42,20 @@ let
" ${p.plugin.pname} {{{
${p.config}
" }}}
'' else "";
'' else
"";
moduleConfigure =
optionalAttrs (cfg.extraConfig != "" || (lib.filter (hasAttr "config") cfg.plugins) != []) {
customRC = cfg.extraConfig +
pkgs.lib.concatMapStrings pluginConfig cfg.plugins;
}
// optionalAttrs (cfg.plugins != [] ) {
moduleConfigure = optionalAttrs (cfg.extraConfig != ""
|| (lib.filter (hasAttr "config") cfg.plugins) != [ ]) {
customRC = cfg.extraConfig
+ pkgs.lib.concatMapStrings pluginConfig cfg.plugins;
} // optionalAttrs (cfg.plugins != [ ]) {
packages.home-manager.start = map (x: x.plugin or x) cfg.plugins;
};
extraMakeWrapperArgs = lib.optionalString (cfg.extraPackages != [ ])
''--prefix PATH : "${lib.makeBinPath cfg.extraPackages}"'';
in
{
in {
options = {
programs.neovim = {
enable = mkEnableOption "Neovim";
@ -233,20 +230,17 @@ in
};
config = mkIf cfg.enable {
assertions = [
{
assertions = [{
assertion = cfg.configure == { } || moduleConfigure == { };
message = "The programs.neovim option configure is mutually exclusive"
+ " with extraConfig and plugins.";
}
];
}];
home.packages = [ cfg.finalPackage ];
programs.neovim.finalPackage = pkgs.wrapNeovim cfg.package {
inherit (cfg)
extraPython3Packages withPython3
extraPythonPackages withPython
extraPython3Packages withPython3 extraPythonPackages withPython
withNodeJs withRuby viAlias vimAlias;
extraMakeWrapperArgs = extraMakeWrapperArgs;