split home-manager into their own submodules

This commit is contained in:
Danilo Reyes
2026-03-16 15:49:43 -06:00
parent 14eed4f7f6
commit 28c8db6cb7
43 changed files with 1011 additions and 626 deletions

View File

@@ -0,0 +1,31 @@
{ pkgs }:
let
packages = builtins.attrValues {
inherit (pkgs)
pipenv
pyright
;
inherit (pkgs.python3Packages)
black
editorconfig
flake8
isort
pyflakes
pylint
pytest
speedtest-cli
;
};
in
{
inherit packages;
devShell = pkgs.mkShell {
inherit packages;
name = "python-dev-shell";
shellHook = ''
echo "🐍 Python dev environment"
which python
'';
description = "Python development shell";
};
}

View File

@@ -0,0 +1,36 @@
{
config,
inputs,
lib,
osConfig ? null,
pkgs,
...
}:
let
python = import ./common.nix { inherit pkgs; };
hm = inputs.self.lib.hmModule {
inherit
config
inputs
osConfig
;
optionPath = [
"dev"
"python"
];
};
cfg = config.my.dev.python;
in
{
options.my.dev.python.enable = lib.mkEnableOption "Install Python tools globally";
config = lib.mkMerge [
{
my.dev.python.enable = lib.mkDefault hm.enabledByDefault;
}
(lib.mkIf cfg.enable {
home.packages = python.packages;
xdg.configFile."python/pythonrc".source = ../../../dotfiles/pythonrc;
home.sessionVariables.PYTHONSTARTUP = "\${XDG_CONFIG_HOME}/python/pythonrc";
})
];
}

View File

@@ -0,0 +1,26 @@
{
config,
inputs,
lib,
pkgs,
...
}:
let
python = import ./common.nix { inherit pkgs; };
in
{
options = {
my.dev.python = {
enable = lib.mkEnableOption "Install Python tools globally";
users = lib.mkOption {
type = inputs.self.lib.usersOptionType lib;
default = config.my.toggleUsers.dev;
description = "Users to install Python packages for";
};
};
devShells.python = lib.mkOption {
type = lib.types.package;
default = python.devShell;
};
};
}