2024-01-23 19:13:42 -06:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-01-23 15:36:52 -06:00
|
|
|
inherit (lib) mkEnableOption mkIf;
|
2024-01-25 13:59:33 -06:00
|
|
|
cfg = config.languages;
|
2024-01-23 19:13:42 -06:00
|
|
|
in {
|
2024-01-25 12:23:32 -06:00
|
|
|
options.languages.python = mkEnableOption "python";
|
|
|
|
config = mkIf cfg.python {
|
2024-02-19 10:54:37 -06:00
|
|
|
environment.systemPackages = let
|
|
|
|
python = pkgs.python3.withPackages (ps: with ps; [pip]);
|
2024-02-19 10:42:07 -06:00
|
|
|
in
|
2024-02-19 10:54:37 -06:00
|
|
|
with pkgs; [
|
|
|
|
# https://github.com/Mic92/nix-ld?tab=readme-ov-file#my-pythonnodejsrubyinterpreter-libraries-do-not-find-the-libraries-configured-by-nix-ld
|
|
|
|
(pkgs.writeShellScriptBin "python" ''
|
|
|
|
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
|
|
|
|
exec ${python}/bin/python "$@"
|
|
|
|
'')
|
2024-01-23 15:36:52 -06:00
|
|
|
|
2024-02-19 10:54:37 -06:00
|
|
|
(pkgs.writeShellScriptBin "python3" ''
|
|
|
|
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
|
|
|
|
exec ${python}/bin/python "$@"
|
|
|
|
'')
|
2024-01-23 15:36:52 -06:00
|
|
|
|
2024-02-19 10:54:37 -06:00
|
|
|
# (python3.withPackages (ps: with ps; [pip]))
|
|
|
|
micromamba
|
|
|
|
];
|
2024-01-23 19:13:42 -06:00
|
|
|
};
|
2024-01-23 11:51:13 -06:00
|
|
|
}
|