dj95 / zjstatus

A configurable statusbar plugin for zellij
MIT License
489 stars 9 forks source link

Unable to build Nix flake #83

Closed cdorsey closed 2 months ago

cdorsey commented 2 months ago

Describe the bug Attempting to build zjstatus as a Nix flake input results in the following error:

error: getting status of '/nix/store/d8xkgfhrf8jj10qqc1i5c12dl9rsm2zc-glob-0.3.1': No such file or directory

To Reproduce Steps to reproduce the behavior: Here is a minimal flake.nix that reproduces the issue when built:

{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    zjstatus = {
      url = "github:dj95/zjstatus";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.rust-overlay.follows = "rust-overlay";
    };
  };

  outputs =
    {
      self,
      nixpkgs,
      home-manager,
      zjstatus,
      ...
    }@inputs:
    {
      homeConfigurations.test = home-manager.lib.homeManagerConfiguration {
        pkgs = import nixpkgs {
          system = "x86_64-linux";
          overlays = [ (final: prev: { zjstatus = zjstatus.packages.${prev.system}.default; }) ];
        };
        modules = [
          (
            { pkgs, ... }:
            {
              home = {
                packages = [ pkgs.zjstatus ];

                username = "test";
                homeDirectory = "/var/empty";

                stateVersion = "24.05";
              };

            }
          )
        ];
      };
    };
}

Expected behavior A successful build

Desktop (please complete the following information):

dj95 commented 2 months ago

Hi and thanks for your bug report.

Have you tried to build it without specifying the rust-overlay?

I use the nix flake daily in my nix setups and it's building successfully, when following the code from the README and wiki.

cdorsey commented 2 months ago

Hi, thanks for the response!

Yes, I get the same behavior without any of the follows. Here's the updated flake.nix

{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    zjstatus.url = "github:dj95/zjstatus";
  };

  outputs =
    {
      self,
      nixpkgs,
      home-manager,
      zjstatus,
      ...
    }@inputs:
    {
      homeConfigurations.test = home-manager.lib.homeManagerConfiguration {
        pkgs = import nixpkgs {
          system = "x86_64-linux";
          overlays = [ (final: prev: { zjstatus = zjstatus.packages.${prev.system}.default; }) ];
        };
        modules = [
          (
            { pkgs, ... }:
            {
              home = {
                packages = [ pkgs.zjstatus ];

                username = "test";
                homeDirectory = "/var/empty";

                stateVersion = "24.05";
              };

            }
          )
        ];
      };
    };
}

Here's the full log from building the flake: out.txt

Something I noticed is that one of the derivations being built is cargo-package-glob-0.3.1, but the build blows up trying to find glob-0.3.1. That seems like where the breakage is happening. I'm not really sure what could be different about my system to cause that name to be different though. This has persisted through multiple restarts and nix store garbage collections.

cdorsey commented 2 months ago

Okay, I figured out my issue here. That specific package was invalid in my nix store. Somehow neither nix store gc or nix store repair caught that, but nix-store --verify did and removed the path. After that, I was able to successfully build my flake.

dj95 commented 2 months ago

Thats great to hear! Thank you for the heads up!