juspay / omnix

🚧 A Nix wrapper to improve developer experience
https://omnix.page
GNU Affero General Public License v3.0
70 stars 5 forks source link

`om init` is broken #208

Closed srid closed 1 month ago

srid commented 1 month ago
❯ om init /tmp/xx
Welcome to flakreate! Let's create your flake template at "/tmp/xx":
Loading registry path:/nix/store/k6a2zs2ri4nlgh26q2g01zsjm3xkdz5j-source/crates/flakreate/registry...
🐚 nix --extra-experimental-features 'nix-command flakes' show-config --json
🐚 nix eval 'path:/nix/store/k6a2zs2ri4nlgh26q2g01zsjm3xkdz5j-source/crates/flakreate/registry#templates' --json
Error: Failed to fetch templates: Command error: Process exited unsuccessfully. exit_code=Some(1) stderr=error: getting status of '/nix/store/929ail84i62h1f9s5dw8avpraw2z8pd0-source/flake.nix': No such file or directory

Caused by:
    0: Command error: Process exited unsuccessfully. exit_code=Some(1) stderr=error: getting status of '/nix/store/929ail84i62h1f9s5dw8avpraw2z8pd0-source/flake.nix': No such file or directory

    1: Process exited unsuccessfully. exit_code=Some(1) stderr=error: getting status of '/nix/store/929ail84i62h1f9s5dw8avpraw2z8pd0-source/flake.nix': No such file or directory

The CLI test runs, strangely:

https://github.com/juspay/omnix/blob/8e9a8107870819011eceaed16e467526c5ab3b9f/crates/omnix-cli/tests/cli.rs#L49-L51

So we should fix the tests as well.

srid commented 1 month ago

The CLI test runs, strangely:

This was because the devShell (in which the CLI tests are run) was not using the exact same environment as the Nix derivation. I fixed this in

15f4a8acde3d2269146193483b6bf05b7f0e2437

Notice that inputs.self + /crates/flakreate/registry is different to what's used in crate.nix (i.e., rust-project.src + /crates/flakreate/registry). The later is only a subset of the former, which is now fixed in 735a0d83cbc655461fd0960ac36a16f5788b664c.