mynixos / support

MyNixOS issues + user feedback
3 stars 0 forks source link

Can't add my own flake as input #1

Closed imincik closed 1 year ago

imincik commented 1 year ago

In my test project https://mynixos.com/imincik/test2 I added my own flake as Input, and created devShells.default in Outputs. Then I tried to add package from my Input flake in to the Outputs > devShells.default and I can't. It is not showing any packages from my input flake in search - I can see only packages from Nixpkgs.

I created new release and downloaded the MyNixOS created flake and I see that my added flake is not in Inputs of MyNixOS created flake.nix file.

pveierland commented 1 year ago

Thank you for the issue!

Currently MyNixOS only indexes a specific set of flakes; such as nixpkgs, home-manager, etc.; which is why the packages from geonix are not shown in the search after adding it as an input.

The geonix input is added to the generated flake however, as can be seen in the downloaded flake.nix file:

{
  description = "";
  inputs = {
    geonix.url = "github:imincik/geonix";
  };
  outputs = { self, geonix, ... }@inputs:
    let
      flakeContext = {
        inherit inputs;
      };
    in
    {
      devShells = {
        x86_64-linux = {
          default = import ./devShells/default.nix flakeContext { system = "x86_64-linux"; };
        };
      };
    };
}

Note that the devShell will not work without a nixpkgs input as well.

As the flake is added as an input I'm closing this issue, with a note that improved indexing of external flakes is underway and planned to be added in a later release.

imincik commented 1 year ago

The geonix input is added to the generated flake however, as can be seen in the downloaded flake.nix file:

Yes, I checked once again and you are right my flake is really in inputs. I must have some other version opened. Sorry for that.

pveierland commented 1 year ago

When re-checking, I noticed that a bug in the latest release prevents the channel from being correctly set when creating new flakes, which is likely why you did not have nixpkgs as an input in your flake. This will be fixed.

imincik commented 1 year ago

When re-checking, I noticed that a bug in the latest release prevents the channel from being correctly set when creating new flakes, which is likely why you did not have nixpkgs as an input in your flake. This will be fixed.

Thank you !