Improve nix flake#1557
Conversation
| }; | ||
| # Override this input to change which plugins are built. | ||
| panda-config = { | ||
| url = "path:./panda/plugins/config.panda"; |
There was a problem hiding this comment.
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.
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.
.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