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

Add the ability for withPackages and withExtensions to be written in devbox.json #2408

Open
kpervin opened this issue Nov 12, 2024 · 2 comments
Labels
feature New feature or request triage Issue needs triage

Comments

@kpervin
Copy link

kpervin commented Nov 12, 2024

What problem are you trying to solve?

There are certain nixpkgs that require configuration using withExtensions and withPackages. Currently, the only way to utilize those packages in that way using DevBox is to create a flake, which feels antithetical to DevBox's proposition of abstracting Nix.

Example, for using the azure-cli with azure-cli-extensions:

{
  description = "A flake to install azure-cli";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils, }:
    flake-utils.lib.eachDefaultSystem (system:
      let pkgs = nixpkgs.legacyPackages.${system};
      in {
        formatter = pkgs.nixfmt;
        packages = {
          default = pkgs.azure-cli.withExtensions
            [ pkgs.azure-cli-extensions.terraform ];
        };
      });
}
{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.6/.schema/devbox.schema.json",
  "packages": {
    "path:./.flakes/azure-cli": "",
  }
}

What solution would you like?

Allow for withExtensions and withPackages, possibly also override, to be definable in devbox.json:

{
  "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.6/.schema/devbox.schema.json",
  "packages": {
    "azure-cli": {
      "version": "latest",
      "withExtensions": {
        "azure-cli-extensions.terraform": "latest"
      }
    }
  }
}

Additionally, also including cli functionality to be able to add these to devbox.json, ex: devbox add azure-cli --with-extensions azure-cli-extensions.terraform .

Alternatives you've considered

No response

@kpervin kpervin added feature New feature or request triage Issue needs triage labels Nov 12, 2024
@idabmat
Copy link

idabmat commented Nov 24, 2024

Possible duplicate of #1829 ?

@kpervin
Copy link
Author

kpervin commented Nov 26, 2024

Possible duplicate of #1829 ?

I think this exposes a similar issue, but this is a feature request regarding implementation so I believe they are distinct enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request triage Issue needs triage
Development

No branches or pull requests

2 participants