pkgsets/python3: pkgs should be mergable function

This commit is contained in:
Kevin Baensch 2025-07-18 15:56:02 +02:00
parent eaf3bf45c5
commit 460d3f1d30
Signed by: derped
SSH key fingerprint: SHA256:8/FSu/lmp3c1Z17Gml06JRIEHtDjhwdd7g6pBaHQWBc
3 changed files with 32 additions and 21 deletions

View file

@ -12,7 +12,7 @@ let
serviceList = fn.makeOptionTypeList (toString ../services);
pkgOption = pname: {
name = pname;
value = rec {
value = {
pkgwrap = mkOption {
type =
with types;
@ -26,7 +26,10 @@ let
'';
};
pkgs = mkOption {
type = types.unspecified;
type = types.oneOf [
(types.listOf types.package)
(types.functionTo (types.listOf types.package))
];
default = [ ];
description = ''
${pname} package list.

View file

@ -1,25 +1,33 @@
{
config,
lib,
pkgs,
...
}:
with lib;
{
machine.pkgsets.python3.pkgwrap = pkgs.python3.withPackages (
ps: (fn.pkgFilter config.machine.pkgsets.python3.pkgs)
);
machine.pkgsets.python3.pkgs = with pkgs.python3Packages; [
machine.pkgsets.python3 = {
pkgwrap = pkgs.python3.withPackages (config.machine.pkgsets.python3.pkgs);
pkgs = ps: with ps; [
bpython
click
flake8
genanki
holidays
matplotlib
mypy
mysqlclient
numpy
pandas
pillow
pyaml
scipy
jupyter
jupyterlab
requests
pip
notebook
seaborn
virtualenv
];
};
}

View file

@ -20,7 +20,7 @@ mkIf (elem "desktop::i3" config.machine.services) {
];
};
};
machine.pkgsets.python3.pkgs = with pkgs.python3Packages; [
machine.pkgsets.python3.pkgs = ps: with ps; [
py3status
pytz
tzlocal