-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Nix repl does not work with flakes #3803
Comments
Current workaround:
|
FWIW, if a snippet like this in your {
outputs = { flake-utils, ... }: {
apps.repl = flake-utils.lib.mkApp {
drv = pkgs.writeShellScriptBin "repl" ''
confnix=$(mktemp)
echo "builtins.getFlake (toString $(git rev-parse --show-toplevel))" >$confnix
trap "rm $confnix" EXIT
nix repl $confnix
'';
};
};
} |
Another issue I have in this regard is that |
How can
|
thanks @srid, I swear I tried that but it's working now. |
For anyone coming to this issue from google, I found that the most "elegant" solution is to set nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; in your system config, where After that you can refer to the system version of |
Could we also allow If it's implemented it should hopefully be without removing the ability for |
It is actually possible, but hidden behind the
|
This doesn't seem to work with local flakes ( |
Strange, it seems to work for me: $ nix repl --extra-experimental-features repl-flake .#
Welcome to Nix 2.12.0pre20221102_dd1970c. Type :? for help.
warning: Git tree '/home/thufschmitt/Repos/nixos/nix/work' is dirty
Loading installable 'git+file:///home/thufschmitt/Repos/nixos/nix/work#'...
Added 5 variables.
nix-repl> packages.x86_64-linux.nix
«derivation /nix/store/88cq60szkf0rg9a0ph6bgymqqi759rks-nix-2.12.0pre20221102_dirty.drv» |
Yeah, I used |
Absent that, one can use |
I'm not sure if that's the intended behavior of
|
@sg-qwt I don't think it is, indeed. Do you mind opening a specific issue for this? |
Describe the bug
Before it was possible to use to use
nix repl <nixpkgs/nixos>
to get nixos in a repl.This seems not possible anymore with flakes
nix repl ".#"
:How do I load flakes in a nix repl?
The text was updated successfully, but these errors were encountered: