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

Example examples/simple is broken #308

Closed
arntlima opened this issue Dec 29, 2024 · 5 comments
Closed

Example examples/simple is broken #308

arntlima opened this issue Dec 29, 2024 · 5 comments

Comments

@arntlima
Copy link

I tried running the simple example, however I get error messages.

Most likely I'm missing something basic, though I figure you'd like the project to be accessible to newcomers.

Can anyone offer advice on this behaviour? I've added the terminal output below. The two key errors seem to be

  • error: opening file '/home/arnt/hello-deploy-rs/default.nix': No such file or directory
  • error: attribute 'deploy' missing
[arnt@nixos-2:~/hello-deploy-rs]$ curl https://raw.githubusercontent.com/serokell/deploy-rs/refs/heads/master/examples/simple/flake.nix -o ./flake.nix
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   599  100   599    0     0   2294      0 --:--:-- --:--:-- --:--:--  2286

[arnt@nixos-2:~/hello-deploy-rs]$
[arnt@nixos-2:~/hello-deploy-rs]$
[arnt@nixos-2:~/hello-deploy-rs]$ nix --extra-experimental-features 'nix-command flakes' run github:serokell/deploy-rs -- .
🚀 ⚠️ [deploy] [WARN] A Nix version without flakes support was detected, support for this is work in progress
🚀 ℹ️ [deploy] [INFO] Running checks for flake in .
error:
       … while evaluating a branch condition
         at «string»:1:75:
            1| let r = import ./.; x = (if builtins.isFunction r then (r {}) else r); in if x ? checks then x.checks.${builtins.currentSystem} else {}
             |                                                                           ^

       … while evaluating a branch condition
         at «string»:1:26:
            1| let r = import ./.; x = (if builtins.isFunction r then (r {}) else r); in if x ? checks then x.checks.${builtins.currentSystem} else {}
             |                          ^

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: opening file '/home/arnt/hello-deploy-rs/default.nix': No such file or directory
🚀 ❌ [deploy] [ERROR] Failed to check deployment: Nix checking command resulted in a bad exit code: Some(1)

[arnt@nixos-2:~/hello-deploy-rs]$
[arnt@nixos-2:~/hello-deploy-rs]$
[arnt@nixos-2:~/hello-deploy-rs]$
[arnt@nixos-2:~/hello-deploy-rs]$
[arnt@nixos-2:~/hello-deploy-rs]$ nix --extra-experimental-features 'nix-command flakes' run github:serokell/deploy-rs -- flake.nix 
🚀 ⚠️ [deploy] [WARN] A Nix version without flakes support was detected, support for this is work in progress
🚀 ℹ️ [deploy] [INFO] Running checks for flake in flake.nix
🚀 ℹ️ [deploy] [INFO] Evaluating flake in flake.nix
error: attribute 'deploy' missing
       at «string»:1:81:
            1| let r = import flake.nix/.; in if builtins.isFunction r then (r {}).deploy else r.deploy
             |                                                                                 ^
🚀 ❌ [deploy] [ERROR] Failed to evaluate deployment data: Evaluation resulted in a bad exit code: Some(1)

[arnt@nixos-2:~/hello-deploy-rs]$ 

@sedlund
Copy link

sedlund commented Dec 30, 2024

🚀 ⚠️ [deploy] [WARN] A Nix version without flakes support was detected, support for this is work in progress

it looks like you have an old nix version

@notgne2
Copy link
Contributor

notgne2 commented Dec 30, 2024

Output on there shows deploy-rs is actually being ran using flakes, so it is supported, but I don't think deploy-rs will add the --extra-experimenta-features flag by itself, so will need that to be in the Nix configuration already for it to work.

The error about default.nix is because when it falls back to non-flakes node, it looks for a default.nix since it can't use the flake.nix directly (or it could, if it integrated flake-compat somehow, but I don't think anybody wants this)

@sedlund
Copy link

sedlund commented Dec 30, 2024

ya 😪, a flake input was passed 😁

so:
export NIX_CONFIG="extra-experimental-features = nix-command flakes"

should work. or you have to configure in nix.conf

@arntlima
Copy link
Author

Thanks for the prompt replies. Setting those environment variables worked 🙌
The issue occurred on a fresh install of NixOS 24.10, so I must have assumed it was new enough.
My immediate issue is solved, and I'm happy to see the ticket closed.
If you think fully resolving it includes updating the docs or error messages, you might like to keep it open.
Anyways, thanks again.

@PhilTaken
Copy link
Collaborator

Glad to hear you got it working, closing this issue then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants