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

Example in README.md: Lightline.vim could not load colorscheme gruvbox. (While running without sudo) #1934

Closed
1 task done
jirafey opened this issue Jul 26, 2024 · 10 comments · Fixed by #2078 or #2079
Closed
1 task done
Labels
bug Something isn't working

Comments

@jirafey
Copy link

jirafey commented Jul 26, 2024

Field Description
Plugin Lightline
Nixpkgs 24.05
Home Manager 24.05
  • I have read the FAQ and my bug is not listed there.

Description

Minimal, Reproducible Example (MRE)

  programs.nixvim = {
    enable = true;
    defaultEditor = true;
    colorschemes.gruvbox.enable = true;
    plugins.lightline.enable = true;
  };
}
# home.nix
{ inputs, ... }:

{

  imports = [
    inputs.nixvim.homeManagerModules.nixvim
  ];


  home.username = "user";
  home.homeDirectory = "/home/user";
  # You do not need to change this if you're reading this in the future.
  # Don't ever change this after the first build.  Don't ask questions.
  home.stateVersion = "24.05";

  programs.nixvim = {
    enable = true;
    defaultEditor = true;
    colorschemes.gruvbox.enable = true;
    plugins.lightline.enable = true;
  };
}
# flake.nix
{
  
  inputs = {
    nixpkgs = {
      url = "github:NixOS/nixpkgs?ref=nixos-24.05";
    };
    home-manager = {
      url = "github:nix-community/home-manager?ref=release-24.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixvim = {
      url = "github:nix-community/nixvim?ref=nixos-24.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs @ { self, nixpkgs, home-manager, ... }: {
    nixosConfigurations = {
      hostname = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./configuration.nix

	  home-manager.nixosModules.home-manager {
	    home-manager.extraSpecialArgs = { inherit inputs; };
            home-manager.useGlobalPkgs = true;
	    home-manager.useUserPackages = true;
	    home-manager.users.user = {
	      imports = [
	        # DO NOT IMPORT HOME-MANAGER MODULES HERE
	        ./home.nix
	        ./modules/firefox/firefox.nix
	        ./modules/nvim/nvim.nix
	        ./modules/bash/bash.nix
	      ];
	    };
	  }
        ];
      };
    };
  };
}

image

When commenting the line with lightline I see gruvbox when using nvim without sudo but I don't when using it with sudo

Also in repositories I have access to, the gruvbox colorscheme is applying with both sudo and non-sudo nvim command. However the error with lightline still appears on non-sudo nvim command

is there an explanation?

@jirafey jirafey added the bug Something isn't working label Jul 26, 2024
@jirafey
Copy link
Author

jirafey commented Jul 26, 2024

#1575

@MattSturgeon
Copy link
Member

I see gruvbox when using nvim without sudo but I don't when using it with sudo

Also in repositories I have access to, the gruvbox colorscheme is applying with both sudo and non-sudo nvim command. However the error with lightline still appears on non-sudo nvim command

This is probably related to how home-manager sets up your environment, I'm not 100% sure ottomh. Usually, sodo will inherit your environment though (unless using things like sudo -i)

As for lightline, that's strange. We'll have to investigate as it looks like something is broken either upstream in the plugin or in our modules.

@jirafey
Copy link
Author

jirafey commented Jul 26, 2024

I see gruvbox when using nvim without sudo but I don't when using it with sudo
Also in repositories I have access to, the gruvbox colorscheme is applying with both sudo and non-sudo nvim command. However the error with lightline still appears on non-sudo nvim command

This is probably related to how home-manager sets up your environment, I'm not 100% sure ottomh. Usually, sodo will inherit your environment though (unless using things like sudo -i)

As for lightline, that's strange. We'll have to investigate as it looks like something is broken either upstream in the plugin or in our modules.

it is rather in my config, i will post the whole thing here soon, i need to fix some issues now.

@jirafey
Copy link
Author

jirafey commented Jul 26, 2024

@MattSturgeon
https://github.com/jirafey/nixconfig/tree/b3b5cbfc0dd755355c87dfd092c24c6584a700c0

I would look for some issues with the permissions of the user/sudo

This is a very new config and that is probably why it does not work yet. I probably will abandon nixvim but I am willing to help debug this issue.

@MattSturgeon
Copy link
Member

I don't see any obvious issues in your config. I suspect this is an issue on our end.

I've not used lightline myself, but my config with lualine seems to be working ok with catppuccin.

@ech0r
Copy link

ech0r commented Aug 5, 2024

manually adding gruvbox under extraPlugins worked for me:

    programs.nixvim = {
	enable = true;
        defaultEditor = true;
        extraPlugins = with pkgs.vimPlugins; [
        	gruvbox
        ];
	colorschemes.gruvbox.enable = true;
        plugins.lightline.enable = true;
    };

@MattSturgeon
Copy link
Member

This seems to be the same issue as this discussion, see my response there: #1575 (reply in thread)

tl;dr, since 871e331 our gruvbox module installs gruvbox-nvim which is different to gruvbox. I wonder if lightline only supports the latter and not the one we normally install?

@jirafey
Copy link
Author

jirafey commented Aug 6, 2024

This seems to be the same issue as this discussion, see my response there: #1575 (reply in thread)

tl;dr, since 871e331 our gruvbox module installs gruvbox-nvim which is different to gruvbox. I wonder if lightline only supports the latter and not the one we normally install?

hey if there is any help needed from me, let me know, maybe this issue is ready for close?

@MattSturgeon
Copy link
Member

@GaetanLepage is our gruvbox maintainer while our lightline module has been largely untouched since it was added 4 years ago.

The plugins.lightline.colorscheme option currently defaults to colorscheme:

colorscheme = mkOption {
type = with types; nullOr str;
default = config.colorscheme;
description = "The colorscheme to use for lightline. Defaults to .colorscheme.";
example = "gruvbox";
};

However I'm not 100% sure if the gruvbox module sets the colorscheme option 🤔

maybe this issue is ready for close?

Regardless of how well lightline and gruvbox integrate, if the example in the README is broken this is still a valid issue.

@MattSturgeon
Copy link
Member

if the example in the README is broken this is still a valid issue.

#2078 didn't address the README example, so I'll re-open this.

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
3 participants