Skip to content

Set type of flake option to string, correctly evaluate it when provided - #149

Open
b-m-f wants to merge 1 commit into
microvm-nix:mainfrom
b-m-f:main
Open

Set type of flake option to string, correctly evaluate it when provided#149
b-m-f wants to merge 1 commit into
microvm-nix:mainfrom
b-m-f:main

Conversation

@b-m-f

@b-m-f b-m-f commented Oct 5, 2023

Copy link
Copy Markdown

Closes #148

@astro

astro commented Oct 5, 2023

Copy link
Copy Markdown
Member

The primary use-case for this option was to pass a flake that is self or a flake input, not a string. Can we support both?

@astro

astro commented Oct 5, 2023

Copy link
Copy Markdown
Member

When testing this with a flakeref string as flake, which is your use-case, I get error: cannot call 'getFlake' on unlocked flake reference 'git+https://gitea.dev/user/nix-config.git', at «none»:0 (use --impure to override)

With --impure I get error: infinite recursion encountered ☹️

@b-m-f

b-m-f commented Oct 6, 2023

Copy link
Copy Markdown
Author

Thanks for giving it a try.

For the "impurity" I found NixOS/nix#6124 (comment) .

Now for the recursion.

In my setup I currently have 2 gitrepos:

and I can successfully deploy that way - the impurity error happens as well.

Have you maybe tried to reference flake in the same way as self?

Since the usage does not seem clear, maybe a new option could be added? How about remoteRef/remoteFlake?

Edit: Some more context:

Using flake: self with deploy-rs I get

error: attribute 'self' missing

       at /nix/store/sg8d2aslxnyr4krwynnh2aszdrcnz3sq-source/lib/modules.nix:512:28:

          511|         builtins.addErrorContext (context name)
          512|           (args.${name} or config._module.args.${name})
             |                            ^
          513|       ) (lib.functionArgs f);
(use '--show-trace' to show detailed location information)
🚀 ❌ [deploy] [ERROR] Failed to check deployment: Nix checking command resulted in a bad exit code: Some(1)

@b-m-f

b-m-f commented Oct 23, 2023

Copy link
Copy Markdown
Author

@astro should I close this as 'feature not desired'?

@astro

astro commented Oct 24, 2023

Copy link
Copy Markdown
Member

I haven't yet taken more time to investigate this myself.

@b-m-f

b-m-f commented Oct 24, 2023

Copy link
Copy Markdown
Author

@astro Alright. There is absolutely no urgency on my side.
I won't have free time for a while, but maybe I can get back to this with a reducible project at some point.

@SuperSandro2000

Copy link
Copy Markdown
Member

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

Successfully merging this pull request may close these issues.

Flake option is a path but expects a set later on

3 participants