modules.packages.vim: restore

This commit is contained in:
2024-11-10 12:15:21 +08:00
parent 1fdc03ed68
commit f02ad7eae6
2 changed files with 31 additions and 9 deletions

View File

@@ -15,15 +15,7 @@ inputs:
settings.theme = "catppuccin_latte";
};
}];
packages.packages._packages =
[
inputs.pkgs.helix
(inputs.pkgs.runCommand "vim" {}
''
mkdir -p $out/bin
ln -s ${inputs.pkgs.helix}/hx $out/bin/vim
'')
];
packages.packages._packages = [ inputs.pkgs.helix ];
};
};
}

30
modules/packages/vim.nix Normal file
View File

@@ -0,0 +1,30 @@
inputs:
{
options.nixos.packages.vim = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) vim; in inputs.lib.mkIf (vim != null)
{
nixos.user.sharedModules =
[{
config.programs.vim =
{
enable = true;
defaultEditor = true;
packageConfigurable = inputs.config.programs.vim.package;
settings =
{
number = true;
expandtab = false;
shiftwidth = 2;
tabstop = 2;
};
extraConfig =
''
set clipboard=unnamedplus
colorscheme evening
'';
};
}];
programs.vim.package = inputs.pkgs.vim-full;
};
}