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

No 'processes' option defined: https://devenv.sh/processes/ #1627

Open
i-am-logger opened this issue Dec 5, 2024 · 5 comments
Open

No 'processes' option defined: https://devenv.sh/processes/ #1627

i-am-logger opened this issue Dec 5, 2024 · 5 comments
Labels
bug Something isn't working flakes Related to running devenv using the flake integration

Comments

@i-am-logger
Copy link

Describe the bug
using flake with multiple devenv as follow

      devShells = forEachSystem (
        system:
        let
          pkgs = inputs.nixpkgs.legacyPackages.${system};
        in
        {
          default = import ./devnv.nix {
            inherit inputs pkgs system;
          };
          api = import ./api/devenv.nix {
            inherit inputs pkgs system;
          };
          ui = import ./ui/devenv.nix {
            inherit inputs pkgs system;
          };
        }
      );

then running the following:

nix develop --no-pure-eval .#api -> this works and i get the `api` env

when I then try to

devenv up #api

I get the following error:

No 'processes' option defined: https://devenv.sh/processes/

which is weird as the ./api/devenv.nix has postgress service and cargo watch process

@i-am-logger i-am-logger added the bug Something isn't working label Dec 5, 2024
@sandydoo
Copy link
Member

sandydoo commented Dec 6, 2024

No 'processes' option defined: https://devenv.sh/processes/

That's a strange message for a flake project. One gotcha with the flake integration is that you need to add devenv-up packages to the flake for each shell. Example here: https://devenv.sh/guides/using-with-flakes/#multiple-shells

@sandydoo sandydoo added the flakes Related to running devenv using the flake integration label Dec 6, 2024
@i-am-logger
Copy link
Author

yes, that is exactly what i have done.

      packages = forEachSystem (
        system:
        let
          pkgs = import nixpkgs { inherit system; };
          devenv-up = self.devShells.${system}.default.config.procfileScript;
          devenv-test = self.devShells.${system}.default.config.test;
          api = pkgs.callPackage ./api/package.nix { inherit pkgs naersk; };
          api-docker = pkgs.callPackage ./api/docker.nix { inherit pkgs api; };
        in
        {
          devenv-up = devenv-up;
          devenv-test = devenv-test;
          api = api;
          api-docker = api-docker;
        }
      );

@i-am-logger
Copy link
Author

btw, I haven't looked yet on how devenv actually build docker images, but i built mine with nix:

pkgs.dockerTools.buildLayeredImage {
  name = api.pname;
  tag = "latest";
  created = "now";
  contents = [ api ];
  config = {
    Cmd = [
      ("/bin/" + api.pname)
    ];
  };
}```

@i-am-logger
Copy link
Author

i-am-logger commented Dec 12, 2024

          api-devenv-up = self.devShells.${system}.api.config.procfileScript;
          api-devenv-test = self.devShells.${system}.api.config.test;

          ui-devenv-up = self.devShells.${system}.ui.config.procfileScript;
          ui-devenv-test = self.devShells.${system}.ui.config.test;

with devshells:

      devShells = forEachSystem (
        system:
        let
          pkgs = inputs.nixpkgs.legacyPackages.${system};
        in
        {
          default = import ./devenv.nix {
            inherit inputs pkgs system;
          };
          api = import ./api/devenv.nix {
            inherit inputs pkgs system;
          };
          ui = import ./ui/devenv.nix {
            inherit inputs pkgs system;
          };
        }
      );

running dev-env up #api

(masked dirs)

warning: Git tree '/..' is dirty
error: flake 'git+file:///....' does not provide attribute 'packages.x86_64-linux.devenv-up', 'legacyPackages.x86_64-linux.devenv-up' or 'devenv-up'

this shows that a default devenv-up is required ... though when i add default it never finds processes to run

@i-am-logger
Copy link
Author

same goes with devenv test .#api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flakes Related to running devenv using the flake integration
Projects
None yet
Development

No branches or pull requests

2 participants