Merge pull request #326162 from jopejoe1/vim-refactor
nixos/vim: add enable option and link `/share/vim-plugins` only when …
This commit is contained in:
@@ -182,6 +182,10 @@
|
|||||||
- `keycloak` was updated to version 25, which introduces new hostname related options.
|
- `keycloak` was updated to version 25, which introduces new hostname related options.
|
||||||
See [Upgrading Guide](https://www.keycloak.org/docs/25.0.1/upgrading/#migrating-to-25-0-0) for instructions.
|
See [Upgrading Guide](https://www.keycloak.org/docs/25.0.1/upgrading/#migrating-to-25-0-0) for instructions.
|
||||||
|
|
||||||
|
- `programs.vim.defaultEditor` now only works if `programs.vim.enable` is enabled.
|
||||||
|
|
||||||
|
- `/share/vim-plugins` now only gets linked if `programs.vim.enable` is enabled
|
||||||
|
|
||||||
- The `tracy` package no longer works on X11, since it's moved to Wayland
|
- The `tracy` package no longer works on X11, since it's moved to Wayland
|
||||||
support, which is the intended default behavior by Tracy maintainers.
|
support, which is the intended default behavior by Tracy maintainers.
|
||||||
X11 users have to switch to the new package `tracy-x11`.
|
X11 users have to switch to the new package `tracy-x11`.
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ in
|
|||||||
"/share/hunspell"
|
"/share/hunspell"
|
||||||
"/share/org"
|
"/share/org"
|
||||||
"/share/themes"
|
"/share/themes"
|
||||||
"/share/vim-plugins"
|
|
||||||
"/share/vulkan"
|
"/share/vulkan"
|
||||||
"/share/kservices5"
|
"/share/kservices5"
|
||||||
"/share/kservicetypes5"
|
"/share/kservicetypes5"
|
||||||
|
|||||||
@@ -1,25 +1,31 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.vim;
|
cfg = config.programs.vim;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.programs.vim = {
|
options.programs.vim = {
|
||||||
defaultEditor = lib.mkOption {
|
enable = lib.mkEnableOption "Vi IMproved, an advanced text";
|
||||||
type = lib.types.bool;
|
|
||||||
default = false;
|
|
||||||
description = ''
|
|
||||||
When enabled, installs vim and configures vim to be the default editor
|
|
||||||
using the EDITOR environment variable.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "vim" {
|
defaultEditor = lib.mkEnableOption "vim as the default editor";
|
||||||
example = "vim-full";
|
|
||||||
};
|
package = lib.mkPackageOption pkgs "vim" { example = "vim-full"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.defaultEditor {
|
# TODO: convert it into assert after 24.11 release
|
||||||
environment.systemPackages = [ cfg.package ];
|
config = lib.mkIf (cfg.enable || cfg.defaultEditor) {
|
||||||
environment.variables = { EDITOR = lib.mkOverride 900 "vim"; };
|
warnings = lib.mkIf (cfg.defaultEditor && !cfg.enable) [
|
||||||
|
"programs.vim.defaultEditor will only work if programs.vim.enable is enabled, will be encfored after the 24.11 release"
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
systemPackages = [ cfg.package ];
|
||||||
|
variables.EDITOR = lib.mkIf cfg.defaultEditor (lib.mkOverride 900 "vim");
|
||||||
|
pathsToLink = [ "/share/vim-plugins" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user