-
Notifications
You must be signed in to change notification settings - Fork 501
Improve nix flake #1557
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: dev
Are you sure you want to change the base?
Improve nix flake #1557
Conversation
flake.nix
Outdated
| }; | ||
| # Override this input to change which plugins are built. | ||
| panda-config = { | ||
| url = "path:./panda/plugins/config.panda"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work when running nix build in the cloned repo, but it won't work when used as a dependency. I get this error with nix build github:lluchs/panda/flake:
error: cannot fetch input 'path:./panda/plugins/config.panda' because it uses a relative path
Maybe plugin customization can be done at a different level from the flake inputs, such as with .override?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, annoying. Thanks for catching that. .override unfortunately doesn't easily work without making the whole thing a nixpkgs overlay.
I've seen people suggest an input "path:/dev/null" for optional external configuration. I will try that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.overrideunfortunately doesn't easily work without making the whole thing a nixpkgs overlay.
I think you might be able to just change the panda package definition from
panda = pkgs.stdenv.mkDerivation {
...
}to something like
panda = pkgs.callPackage
({ plugins ? builtins.readFile ./panda/plugins/config.panda }:
pkgs.stdenv.mkDerivation {
...
}) {}|
I implemented |
- Builds with current nixpkgs - Separate pypanda package built with nixpkgs Python functions - Configurable plugin and target list via pkgsWithConfig
|
I updated the PR with a better approach now. The flake now exposes a function pandaPkgs = panda.packages.${system}.pkgsWithConfig {
configFile = ./config.panda;
targetList = [ "x86_64-softmmu" ];
};I also updated the lockfile (again) for current nixpkgs and libosi. |
This fixes the nix flake (it didn't work with current nixpkgs since the old libdwarf was removed and some Python trouble) and implements some improvements:
cc @be32826 who built the flake originally