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

nix run needs --config #624

Open
Freyert opened this issue Dec 31, 2024 · 3 comments
Open

nix run needs --config #624

Freyert opened this issue Dec 31, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Freyert
Copy link

Freyert commented Dec 31, 2024

Describe the bug
I want to have a one step command to run a full local development environment. I believe one exists, but I'm a novice when it comes to nix.

When I perform nix run, I see the following output:

(devenv) [fbyrne@flax kitsune]$ nix run
error: the following required arguments were not provided:
  --config <CONFIG>

Usage: kitsune --config <CONFIG>

To Reproduce
Steps to reproduce the behavior:

  1. go to the root directory of the project.
  2. run nix run

Expected behavior
I'm expecting the project to use some default local configuration like config.example.toml to connect to a local instance of postgres and redis.

Version
The version of Kitsune you're running (version and Git commit)

276f865

Not sure how to get the version of kitsune.

@Freyert Freyert added the bug Something isn't working label Dec 31, 2024
@Freyert
Copy link
Author

Freyert commented Dec 31, 2024

oh. I had to do nix develop and then devenv up

hmm, but that just runs redis and postgres. I think I still need to run kitsune itself, and I don't know if that includes the front end either.

@Freyert
Copy link
Author

Freyert commented Dec 31, 2024

So at this point the issue is the database isn't setup, but I can connect.

cargo run --bin kitsune -- --config config.example.toml
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.26s
     Running `target/debug/kitsune --config config.example.toml`
Error:
   0: Failed to connect to and migrate the database
   1: database "kitsune" does not exist

Location:
   /home/fbyrne/kitsune/crates/kitsune-db/src/lib.rs:41

@LordMZTE
Copy link

nix run only builds the package and then passes all remaining arguments to the program. It's not Nix's job here to figure out defaults. On a different note, the NixOS module also seems to be missing --config here: https://github.com/kitsune-soc/kitsune/blob/main/nix/module.nix#L106 but I haven't gotten that working for unrelated reasons - this is mostly guesswork.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants