Closed imincik closed 5 months ago
.devenv/devenv.json
file is created correctly
{
"inputs": {
"nixpkgs": {
"follows": "geonix/nixpkgs"
},
"geonix": {
"url": "github:imincik/geospatial-nix"
}
}
}
but .devenv/flake.json
is not (it is missing follows
and contains not existing url
)
{
"nixpkgs": {
"url": null,
"inputs": {},
"flake": true
},
"geonix": {
"url": "github:imincik/geospatial-nix",
"inputs": {},
"flake": true
}
}
Looks like we could just add follows
to FlakeInput
https://github.com/cachix/devenv/blob/ad5a82f493f016bf4e82fae481b374d943be9560/devenv/src/config.rs#L38 .
Something like this:
diff --git a/devenv/src/config.rs b/devenv/src/config.rs
index 61383b8..45883ab 100644
--- a/devenv/src/config.rs
+++ b/devenv/src/config.rs
@@ -37,6 +37,7 @@ impl Input {
#[derive(Serialize, Deserialize, Debug)]
pub struct FlakeInput {
pub url: Option<String>,
+ pub follows: Option<String>,
pub inputs: HashMap<String, Input>,
pub flake: bool,
}
@@ -45,6 +46,7 @@ impl From<&Input> for FlakeInput {
fn from(input: &Input) -> Self {
FlakeInput {
url: input.url.clone(),
+ follows: input.follows.clone(),
inputs: input.inputs.clone(),
flake: input.flake,
but with make sure that only one of url
or follows
can exist. I remember I did the same patch for Python CLI. Doing it in Rust is currently too much for me.
Describe the bug Devenv is crashing when I try to follow nixpkgs version provided by custom flake.
To reproduce I want to use nixpkgs in the version as my
geospatial-nix
flake is using:devenv init
update
devenv.yaml
with following configurationexecute
devenv shell
✖ Command produced the following output:
✔ Building shell in 0.2s. Error: × Command
/nix/store/16z8qb8j04nzahvxgms9wn9qba1fjh4z-nix-devenv-2.21.0pre20240315_c5bbf14/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --option eval- │ cache false --keep-going --max-jobs 8 print-dev-env --profile /home/imincik/tmp/devenv-1-follow/.devenv/gc/shell
failed with with exit code 1devenv 1.0.1 (x86_64-linux)