🚀 add python module

This commit is contained in:
Moritz Böhme 2022-08-31 12:01:07 +02:00
parent 63e3bee66c
commit 7660c4f6d8
6 changed files with 27 additions and 6 deletions

View file

@ -78,6 +78,7 @@ with lib; {
hub.enable = true; hub.enable = true;
kitty.enable = true; kitty.enable = true;
ledger.enable = true; ledger.enable = true;
python.enable = true;
rofi.enable = true; rofi.enable = true;
spotify.enable = true; spotify.enable = true;
thunar.enable = true; thunar.enable = true;

View file

@ -21,6 +21,7 @@
./kakoune.nix ./kakoune.nix
./kitty.nix ./kitty.nix
./ledger ./ledger
./python.nix
./rofi ./rofi
./spotify.nix ./spotify.nix
./sway.nix ./sway.nix

View file

@ -80,7 +80,6 @@ in
# python # python
nodePackages.pyright nodePackages.pyright
python-dev
# sh # sh
nodePackages.bash-language-server nodePackages.bash-language-server

View file

@ -0,0 +1,25 @@
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.python;
in
{
options.my.programs.python = {
enable = mkEnableOption "python";
versions = mkOption {
default = [ "python310" ];
type = with types; listOf str;
example = [ "python39" ];
apply = versions: builtins.map (version: prev.${version}.withPackages (packages: with packages; [ black pyflakes isort nose pytest python-lsp-server ]));
};
};
config = mkIf cfg.enable {
home-manager.user.moritz.home.packages = cfg.versions;
};
}

View file

@ -1,7 +1,5 @@
{ inputs }: final: prev: { { inputs }: final: prev: {
inherit (inputs.comma.packages."${prev.system}") comma; inherit (inputs.comma.packages."${prev.system}") comma;
python-dev = import ./python.nix final prev;
nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}"; nixpkgs-review-checks = inputs.nixpkgs-review-checks.defaultPackage."${prev.system}";
agenix = inputs.agenix.defaultPackage."${prev.system}"; agenix = inputs.agenix.defaultPackage."${prev.system}";
master = import inputs.master { master = import inputs.master {

View file

@ -1,3 +0,0 @@
final: prev:
prev.python310.withPackages
(packages: with packages; [ black pyflakes isort nose pytest python-lsp-server ])