-
Notifications
You must be signed in to change notification settings - Fork 42
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
Partitions with dev files stored outside of the repository? #244
Comments
It seems that this would solve the problem nice and simple.
I think we could use the same workaround that I added for path values, but for store paths. Another possible solution is to add your
{
inputs.nix-dev-flake.url = ...; # ie flake = true;
outputs = { ... }: { };
} This adds an indirection between
|
Haven't tested this yet, but it seems like it could work: I think the |
Yes, I agree. If submodules behaved like normal folders I would be able to get rid of a lot of hacks.
I didn't think of that! It might work. Let me try that. The "allow string" PR looks like a hack IMO, so maybe don't merge it yet. Unless you think it's a good addition. |
So I tested it and I don't think it will work the way I want it to work. My idea is to avoid not only inputs but also to provide some basic config for the tools. What you suggested solves the inputs problem, but the module import issue is still there. Here's what I have: {
inputs = {
nix-dev-flake = {
url = "github:pedorich-n/nix-dev-flake/flake-partitions";
flake = true;
};
};
outputs = _: { };
}
partitions.dev = {
extraInputsFlake = ./dev;
extraInputs = { inherit (config.partitions.dev.extraInputs.nix-dev-flake.inputs) treefmt-nix pre-commit-hooks; };
module = {
imports = [
"${config.partitions.dev.extraInputs.nix-dev-flake}/flake-module.nix"
];
}; The
( With the code from your PR I still get the same error, but If I move the Like this: partitions.dev = {
extraInputsFlake = builtins.unsafeDiscardStringContext inputs.nix-dev-flake.outPath;
module = {
imports = [
"${inputs.nix-dev-flake}/flake-module.nix"
];
};
}; Unless there's a way to turn |
It worked when I tested this solution on other flakes. Is the code that creates the partition in a public repo? Fwiw, you could probably refactor that first version of
|
I tried to create a small reproducible repo and it turned out working 😮 FWIW I still pushed the code: https://github.com/pedorich-n/flake-parts-issue-244 So a |
Hi!
I love the idea of partitions and dev-only inputs! I've been using dev subflakes for a while now.
Most of my projects use the same dev tools (treefmt, git-pre-commit, deadnix, etc.), so I've developed a single flake that I reuse across repositories as a git submodule.
I tried to migrate my setup to
partitions
, but it failed withbecause git submodules aren't copied to the nix store by
nix
commands by default, and there's no way to enable it within theflake.nix
.The next thing I tried is to specify my dev flake as an input to the parent flake (yes, it kinda defeats the purpose, but with
flake = false;
it's just one extra input instead of multiple). Now if I set theextraInputsFlake
tobuiltins.unsafeDiscardStringContext inputs.nix-dev-flake.outPath;
and try to use partitions it fails with:This seems to be a problem with Nix flakes' behavior. I am using Nix version 2.18.5, in case that’s relevant.
Is there a way around this? Is there a way to use
partitions
withdev
files not being physically present in the same repository and without adding?submodules=1
to every command in the case of git submodules or--impure
with flake input?I realize that this is an extremely specific corner case and I am probably the only one experiencing it, but maybe I'm missing something.
Thanks!
The text was updated successfully, but these errors were encountered: