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

Enabling tokyonight triggers a startup error #98

Closed
dongcarl opened this issue Dec 30, 2022 · 2 comments
Closed

Enabling tokyonight triggers a startup error #98

dongcarl opened this issue Dec 30, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dongcarl
Copy link
Contributor

dongcarl commented Dec 30, 2022

Plugin affected: tokyonight

Description

Trying to build nixvim as a flake just to try it out, the default config with just the colorscheme set to tokyonight prints an error:

Error detected while processing /nix/store/mg2k27nxv61p40ld55hw9zd2kz23gqm2-init.lua:
E5113: Error while calling lua chunk: /nix/store/mg2k27nxv61p40ld55hw9zd2kz23gqm2-init.lua:17: Vim(colorscheme):E5113
: Error while calling lua chunk: ...imPackages/start/tokyonight.nvim/lua/tokyonight/util.lua:50: attempt to call meth
od 'lower' (a nil value)
stack traceback:
        ...imPackages/start/tokyonight.nvim/lua/tokyonight/util.lua:50: in function 'highlight'
        ...imPackages/start/tokyonight.nvim/lua/tokyonight/util.lua:95: in function 'syntax'
        ...imPackages/start/tokyonight.nvim/lua/tokyonight/util.lua:165: in function 'load'
        ...imPackages/start/tokyonight.nvim/lua/tokyonight/init.lua:12: in function 'load'
        ...mplugin-tokyonight.nvim-2022-09-07/colors/tokyonight.lua:1: in main chunk
        [C]: in function 'cmd'
        /nix/store/mg2k27nxv61p40ld55hw9zd2kz23gqm2-init.lua:17: in main chunk
stack traceback:
        [C]: in function 'cmd'
        /nix/store/mg2k27nxv61p40ld55hw9zd2kz23gqm2-init.lua:17: in main chunk

This is reproducible on both my macOS and Linux systems

Config

{
  description = "A very basic flake";

  inputs.nixvim.url = "github:pta2002/nixvim";
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = {
    self,
    nixpkgs,
    nixvim,
    flake-utils,
  }: let
    config = {
      colorschemes.tokyonight.enable = true;
    };
  in
    flake-utils.lib.eachDefaultSystem (system: let
	  nixvim' = nixvim.legacyPackages."${system}";
      nvim = nixvim'.makeNixvim config;
    in {
      packages = {
        inherit nvim;
        default = nvim;
      };
    });
}
@dongcarl dongcarl added the bug Something isn't working label Dec 30, 2022
@traxys
Copy link
Member

traxys commented Dec 30, 2022

Arf it seems I was not thorough enough when overhauling the tokyonight configuration.

You need to have a more recent tokyonight than what is available with the locked nixpkgs of nixvim.

You can do this by changing your inputs with the following:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  inputs.nixvim = {
    url = "github:pta2002/nixvim";
    inputs.nixpkgs.follows = "nixpkgs";
  };
}

PS: I believe it works with changing 'nixpkgs-unstable' to '22.11' for stable packages.

@pta2002
Copy link
Collaborator

pta2002 commented Dec 30, 2022

Ah, this looks like an upstream issue with tokyonight, will see what I can do about it.

@traxys traxys closed this as completed Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants