mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 05:04:35 +00:00
rye: update & use globally
This commit is contained in:
parent
2da382b4dc
commit
8a6311b896
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./python.nix
|
||||
./ipython.nix
|
||||
./poetry.nix
|
||||
./rye.nix
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = osConfig.myOptions.home-manager.programs.coding.python;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ python312 ];
|
||||
};
|
||||
}
|
|
@ -1,14 +1,38 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
osConfig,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
|
||||
cfg = osConfig.myOptions.home-manager.programs.coding.python;
|
||||
|
||||
toTOML = name: (pkgs.formats.toml {}).generate "${name}";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ rye ];
|
||||
home = {
|
||||
packages = with pkgs; [ rye ];
|
||||
|
||||
sessionVariables = {
|
||||
RYE_HOME = "${config.xdg.configHome}/rye";
|
||||
};
|
||||
|
||||
# Add rye python shims to path.
|
||||
# Rye provides python executables that will automatically pick up on the python
|
||||
# from a virtual environment, if we're in a directory (project) with one. If not,
|
||||
# rye will fall back to system python. That is, if behavior.global-python=false,
|
||||
# otherwise, we can actually use a python version from rye as our global python.
|
||||
sessionPath = [
|
||||
"${config.xdg.configHome}/rye/shims"
|
||||
];
|
||||
};
|
||||
|
||||
# see: <https://rye.astral.sh/guide/config/#config-file>
|
||||
xdg.configFile."rye/config.toml".source = toTOML "config.toml" {
|
||||
default.license = "GPL-3.0-or-later";
|
||||
behavior.global-python=true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
# Language package managers
|
||||
".local/share/cargo"
|
||||
".local/share/go"
|
||||
".config/rye"
|
||||
];
|
||||
extraFiles = [
|
||||
".config/gtk-3.0/bookmarks"
|
||||
|
|
Loading…
Reference in a new issue