-
Notifications
You must be signed in to change notification settings - Fork 442
fix: nixpkgs instead of inputs.nixpkgs should be used in mkConfig
#2091
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
base: main
Are you sure you want to change the base?
Conversation
|
addendum: Als there is the question why not defaulting the |
|
In other words, we always had an implicit The concern I have is what happens when a user deliberately passes in a nixpkgs input? Instead of ignoring the devenv flake's nixpkgs input, we're now ignoring the argument. I think the best approach here is to have a fallback. Use the flake's nixpkgs input by default. This makes |
|
@sandydoo : I will introduce the fallback for the backwards compatibility: Pro: No fallback:
Contra: Fallback:
With the Pro argument: the example in the docs is directly correct: {
inputs = {
devenv.url = "github:cachix/devenv";
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling"; # The packages against devenv was tested.
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
outputs = { self, nixpkgs, devenv, ... } @ inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.${system}.devenv-up = self.devShells.${system}.default.config.procfileScript;
packages.${system}.devenv-test = self.devShells.${system}.default.config.test;
devShells.${system}.default = devenv.lib.mkShell {
inherit inputs pkgs;
modules = [
({lib, pkgs, config, ... }: {
# Important: `lib` is the nixpkgs lib with what devenv was tested.
# You do not need `devenv.inputs.nixpkgs.follows = "nixpkgs"` anymore above.
# This is your devenv configuration
packages = [ pkgs.hello ];
enterShell = ''
hello
'';
processes.run.exec = "hello";
})
];
};
};
} |
892149e to
507e376
Compare
507e376 to
3c8c48c
Compare
|
@sandydoo : I tried to improve the |
I was stumbling accross the
inputs.nixpkgsuse inmkConfigand it seemed to me that it would make more sense to use thenixpkgsinput fromdevenv's flake instead of what the user inputs tomkConfig { inputs = {...} }.Maybe I am missing the point of using
inputs.nixpkgswhich the users provided insidemkConfig😄Shouldn't the devenv use its rolling version
evalModulesetc... with what it was tested to be more stable?Currently
mkConfigneedsinputs.self,inputs.devenvandinputs.nixpkgs. I think one can get rid ofinputs.nixpkgsand replace it withnixpkgs.