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

recent nix package definitions lack a meta.mainProgram attribute #12161

Open
2 tasks done
mcsimw opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

recent nix package definitions lack a meta.mainProgram attribute #12161

mcsimw opened this issue Jan 8, 2025 · 0 comments
Labels

Comments

@mcsimw
Copy link

mcsimw commented Jan 8, 2025

Describe the bug

When using the latest versions of Nix from git master branch through the nixpkgs overlay, a warning is displayed during nixos-rebuild evaluations and nix flake check.

This is what my last rebuild looked like

building the system configuration...
evaluation warning: getExe: Package "nix-2.26.0pre20250108_5230d3e" does not have the meta.mainProgram attribute. We'll assume that the main program has the same name for now, but this behavior is deprecated, because it leads to surprising errors when the assumption does not hold. If the package has a main program, please set `meta.mainProgram` in its definition to make this warning go away. Otherwise, if the package does not have a main program, or if you don't control its definition, use getExe' to specify the name to the program, such as lib.getExe' foo "bar".
stopping the following units: systemd-modules-load.service
activating the configuration...
setting up /etc...
reloading user units for mcsimw...
restarting sysinit-reactivation.target
reloading the following units: dbus-broker.service
restarting the following units: systemd-networkd.service, systemd-resolved.service, systemd-udevd.service
starting the following units: systemd-modules-load.service

Steps To Reproduce

I add nix to my flake inputs

inputs = {
  nix.url = "github:nixos/nix";
  nixpkgs.url = "github:nixos/nixpkgs";
  flake-parts = {
     url = "github:hercules-ci/flake-parts";
     inputs.nixpkgs-lib.follows = "nixpkgs";
  };
};

I ensured inputs was passed into my system configuration and added the overlay

outputs =
  inputs:
  inputs.flake-parts.lib.mkFlake { inherit inputs; } {
    flake.nixosConfigurations.compoooter = inputs.nixpkgs.lib.nixosSystem {
      specialArgs = { inherit inputs; };
      modules = [
        ./configuration.nix
        {
          nixpkgs.overlays = [ inputs.nix.overlays.default ];
        }
      ];
    };
    systems = [
      "x86_64-linux"
    ];
  };

Expected behavior

It's unclear to me why the meta.mainProgram attribute was removed recently, as this evaluation warning has existed for some time. There may be a valid reason for its removal, but I wanted to report it to ensure it is addressed if unintended.

Metadata

nix-env (Nix) 2.26.0pre

Checklist


Add 👍 to issues you find important.

@mcsimw mcsimw added the bug label Jan 8, 2025
@mcsimw mcsimw changed the title recent nix package definitions lack a meta.mainProgram attribute recent nix package definitions lack a meta.mainProgram attribute Jan 8, 2025
@mcsimw mcsimw changed the title recent nix package definitions lack a meta.mainProgram attribute recent nix package definitions lack a ``meta.mainProgram attribute Jan 8, 2025
@mcsimw mcsimw changed the title recent nix package definitions lack a ``meta.mainProgram attribute recent nix package definitions lack a meta.mainProgram attribute Jan 8, 2025
@mcsimw mcsimw changed the title recent nix package definitions lack a meta.mainProgram attribute recent nix package definitions lack a meta.mainProgram attribute Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant