mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
This commit adds support for byte compiling lua configuration files. It's enabled by default (if byte compiling is enabled at all) and can be disabled with `performance.byteCompileLua.configs` toggle. To implement this feature `extraFiles.<name>.finalSource` internal read-only option is introduced. `source` option cannot be used because it's user configurable. In order to access the values of the `performance.byteCompileLua` options, parent config is added to specialArgs of extraFiles submodule. Then the usages of `source` option changed to `finalSource` in all relevant places (filesPlugin and wrappers). Added more helpers for various cases of byte compiling: * `byteCompileLuaFile` byte compiles lua file * `byteCompileLuaHook` is a setup hook that byte compiles all lua files * `byteCompileLuaDrv` overrides derivation by adding byteCompileLuaHook to it Added tests to validate that extraFiles specified by various methods are handled correctly. Added a separate home-manager test, that is intended to validate that extraFiles propagated to wrapper modules are correctly byte compiled.
58 lines
1.6 KiB
Nix
58 lines
1.6 KiB
Nix
{ inputs, self, ... }:
|
|
{
|
|
perSystem =
|
|
{ system, pkgs, ... }:
|
|
{
|
|
_module.args = {
|
|
makeNixvimWithModule = import ../wrappers/standalone.nix pkgs self;
|
|
};
|
|
|
|
checks =
|
|
{
|
|
home-manager-module =
|
|
(import ../tests/modules/hm.nix {
|
|
inherit pkgs;
|
|
inherit (inputs) home-manager;
|
|
nixvim = self;
|
|
}).activationPackage;
|
|
home-manager-extra-files-byte-compiling =
|
|
import ../tests/modules/hm-extra-files-byte-compiling.nix
|
|
{
|
|
inherit pkgs;
|
|
inherit (inputs) home-manager;
|
|
nixvim = self;
|
|
};
|
|
}
|
|
// pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {
|
|
nixos-module =
|
|
(import ../tests/modules/nixos.nix {
|
|
inherit system;
|
|
inherit (inputs) nixpkgs;
|
|
nixvim = self;
|
|
}).config.system.build.toplevel;
|
|
}
|
|
// pkgs.lib.optionalAttrs pkgs.stdenv.isDarwin {
|
|
darwin-module =
|
|
(import ../tests/modules/darwin.nix {
|
|
inherit system;
|
|
inherit (inputs) nix-darwin;
|
|
nixvim = self;
|
|
}).system;
|
|
};
|
|
};
|
|
|
|
flake = {
|
|
nixosModules = {
|
|
nixvim = import ../wrappers/nixos.nix self;
|
|
default = self.nixosModules.nixvim;
|
|
};
|
|
homeManagerModules = {
|
|
nixvim = import ../wrappers/hm.nix self;
|
|
default = self.homeManagerModules.nixvim;
|
|
};
|
|
nixDarwinModules = {
|
|
nixvim = import ../wrappers/darwin.nix self;
|
|
default = self.nixDarwinModules.nixvim;
|
|
};
|
|
};
|
|
}
|