Something went wrong. Try again.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106{types, ...}: { inputs.nixpkgs.from = {parent}: parent.nixpkgs;
options = { enable = { type = types.bool; default = false; };
version = { type = types.string; default = "3.12"; description = '' Python version to install, resolved to an nixpkgs package. ''; };
package = { type = types.derivation; defaultFunc = { options, inputs, }: let versionMap = { "3.11" = "python311"; "3.12" = "python312"; "3.13" = "python313"; "3.14" = "python314"; "3.15" = "python315"; }; in inputs.nixpkgs.pkgs.${ versionMap.${ options.version } or (throw '' ezshell(python): unsupported version '${options.version}'. Supported: ${ builtins.concatStringsSep ", " (builtins.attrNames versionMap) } '') }; };
lsp = { options = { enable = { type = types.bool; default = true; }; package = { type = types.derivation; defaultFunc = {inputs}: inputs.nixpkgs.pkgs.pyright; }; }; };
extraPackages = { type = types.listOf types.derivation; default = []; };
hooks = { type = types.attrsOf types.hook; defaultFunc = {inputs}: { "ruff-format" = { entry = "${inputs.nixpkgs.pkgs.ruff}/bin/ruff"; args = ["format" "--check"]; files = "\\.py$"; stages = ["pre-push"]; }; "ruff-check" = { entry = "${inputs.nixpkgs.pkgs.ruff}/bin/ruff"; args = ["check"]; files = "\\.py$"; stages = ["pre-push"]; }; }; }; };
impl = {options}: ( if !options.enable then {} else { packages = [options.package] ++ ( if options.lsp.enable then [options.lsp.package] else [] ) ++ options.extraPackages;
hookPresets = builtins.listToAttrs ( map (name: { name = "python-${name}"; value = options.hooks.${name}; }) (builtins.attrNames options.hooks) ); } ) // {inherit options;};
meta.maintainers = ["poacherGoneWild@proton.me"];}