Fix default bundler not working with nix 2.8

This allows nix 2.8 and up to use the default bundler.

I don't actually know what the pre Nix2.6 bundler API was, I simply
tested this by trying bundle hello with the command
nix bundle nixpkgs#hello --bundler .#
while having nixpkgs#nixVersions.nix_2_{5,6,7,8} in path.
This seems to work with the listed nix versions,
but there might be some other cases where it doesn't. I'm not
knowledgeable enough to test.
This commit is contained in:
bad 2022-06-17 12:57:48 +02:00
parent e3f787e5d1
commit e858819e6e

View File

@ -27,16 +27,12 @@
else (parseDrvName (unsafeDiscardStringContext p.name)).name
}";
in {
# Backwards compatibility helper for pre Nix2.6 bundler API
defaultBundler = {__functor = s: {...}@arg:
(if arg?program && arg?system then
nix-bundle.bundlers.nix-bundle arg
else with builtins; listToAttrs (map (system: {
name = system;
value = drv: self.bundlers.${system}.toArx drv;
}) supportedSystems));
};
defaultBundler = builtins.listToAttrs (map (system: {
name = system;
value = drv: self.bundlers.${system}.toArx drv;
}) supportedSystems)
# Backwards compatibility helper for pre Nix2.6 bundler API
// {__functor = s: nix-bundle.bundlers.nix-bundle;};
bundlers = let n =
(forAllSystems (system: {