Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim module: allow to set global vimrc #28925

Closed
wants to merge 2 commits into from

Conversation

offlinehacker
Copy link
Contributor

Motivation for this change

I would like to have global vimrc config. This is optional and should not break anything.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@bjornfor
Copy link
Contributor

bjornfor commented Sep 3, 2017

I don't see the need for this option because it's such a thin wrapper around environment.etc."vimrc" = ...". But if others like it, then OK.

@offlinehacker
Copy link
Contributor Author

Yes, i know, but not everyone knows that you can put global config in /etc/vimrc, so from this perspective it kinda makes sense i guess.

type = types.lines;
default = "";
description = ''
Global vimrc configuration
'';
};
};

config = mkIf cfg.defaultEditor {
Copy link
Member

@Mic92 Mic92 Sep 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means to set /etc/vimrc, vim has to be the default editor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will fix that.

@offlinehacker
Copy link
Contributor Author

I improved this module a bit, so i added enable option that installs vim regardless if it's set as defaultEditor. Also vimrc can be set regardless if enable or defaultEditor options are set.

@Mic92
Copy link
Member

Mic92 commented Sep 24, 2017

After adding programs.vim.enable = true; to my configuration.nix.
I get the following error:

sudo nixos-rebuild switch
error: attempt to call something which is not a function but a set, at /home/joerg/git/nixpkgs/nixos/modules/programs/vim.nix:31:12
(use ‘--show-trace’ to show detailed location information)
building Nix...
error: attempt to call something which is not a function but a set, at /home/joerg/git/nixpkgs/nixos/modules/programs/vim.nix:31:12
(use ‘--show-trace’ to show detailed location information)
building the system configuration...
error: attempt to call something which is not a function but a set, at /home/joerg/git/nixpkgs/nixos/modules/programs/vim.nix:31:12
(use ‘--show-trace’ to show detailed location information)

Adds `enable` option that installs vim regardless if `defaultEditor`
option is set.
@teto
Copy link
Member

teto commented Jan 30, 2019

I see little advantage if it doesn't replace the (obsolete) vim_configure system. Would you feel like converting it into a module ? You can see in nixos/modules/system/boot/kernel_config.nix how to write a module that can be used independtly of the global config namespace.

@mmahut
Copy link
Member

mmahut commented Aug 18, 2019

Are there any updates on this pull request, please?

@offlinehacker
Copy link
Contributor Author

I'm closing this, as I do not need it anymore, since I'm using: https://github.com/rycee/home-manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants