mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-26 04:04:35 +00:00
rye: update & use globally
This commit is contained in:
parent
2da382b4dc
commit
8a6311b896
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./python.nix
|
|
||||||
./ipython.nix
|
./ipython.nix
|
||||||
./poetry.nix
|
./poetry.nix
|
||||||
./rye.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,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
config,
|
||||||
osConfig,
|
osConfig,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
|
|
||||||
cfg = osConfig.myOptions.home-manager.programs.coding.python;
|
cfg = osConfig.myOptions.home-manager.programs.coding.python;
|
||||||
|
|
||||||
|
toTOML = name: (pkgs.formats.toml {}).generate "${name}";
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
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
|
# Language package managers
|
||||||
".local/share/cargo"
|
".local/share/cargo"
|
||||||
".local/share/go"
|
".local/share/go"
|
||||||
|
".config/rye"
|
||||||
];
|
];
|
||||||
extraFiles = [
|
extraFiles = [
|
||||||
".config/gtk-3.0/bookmarks"
|
".config/gtk-3.0/bookmarks"
|
||||||
|
|
Loading…
Reference in a new issue