nixos/xonsh: support extra packages

This commit is contained in:
Infinidoge 2024-11-12 09:22:26 -05:00
parent 62b9a01e61
commit f05513f3af
No known key found for this signature in database
2 changed files with 20 additions and 3 deletions

View File

@ -348,6 +348,8 @@
- `borgmatic` has been updated from 1.8.14 to 1.9.5, please check the [upstream changelog](https://projects.torsion.org/borgmatic-collective/borgmatic/releases) for more details, especially for a few possibly breaking changes noted in the [1.9.0 changelog](https://projects.torsion.org/borgmatic-collective/borgmatic/releases/tag/1.9.0).
- `programs.xonsh.package` now gets overrided internally with `extraPackages` to support `programs.xonsh.extraPackages`. See `programs.xonsh.extraPackages` for more details.
- `nodePackages.ganache` has been removed, as the package has been deprecated by upstream.
- `virtualisation.azure.agent` option provided by `azure-agent.nix` is replaced by `services.waagent`, and will be removed in a future release.

View File

@ -5,7 +5,7 @@
let
cfg = config.programs.xonsh;
package = cfg.package.override { inherit (cfg) extraPackages; };
in
{
@ -32,6 +32,21 @@ in
type = lib.types.lines;
};
extraPackages = lib.mkOption {
default = (ps: [ ]);
type = with lib.types; coercedTo (listOf lib.types.package) (v: (_: v)) (functionTo (listOf lib.types.package));
description = ''
Add the specified extra packages to the xonsh package.
Preferred over using `programs.xonsh.package` as it composes with `programs.xonsh.xontribs`.
Take care in using this option along with manually defining the package
option above, as the two can result in conflicting sets of build dependencies.
This option assumes that the package option has an overridable argument
called `extraPackages`, so if you override the package option but also
intend to use this option, be sure that your resulting package still honors
the necessary option.
'';
};
};
};
@ -64,11 +79,11 @@ in
${cfg.config}
'';
environment.systemPackages = [ cfg.package ];
environment.systemPackages = [ package ];
environment.shells = [
"/run/current-system/sw/bin/xonsh"
"${lib.getExe cfg.package}"
"${lib.getExe package}"
];
};
}