2020-10-05 01:38:58 +00:00
|
|
|
# Another language for portable shell scripting.
|
|
|
|
# This installs Python 3 with my usual packages.
|
|
|
|
# For projects with other libraries (e.g., Django, Pytorch), you can just have a `default.nix` (and a `shell.nix` for more convenience).
|
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
2020-10-25 15:49:14 +00:00
|
|
|
let cfg = config.modules.dev.python;
|
2020-10-05 01:38:58 +00:00
|
|
|
in {
|
|
|
|
options.modules.dev.python = let
|
2020-10-25 15:49:14 +00:00
|
|
|
mkBoolOption = bool:
|
|
|
|
mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = bool;
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
enable = mkBoolOption false;
|
|
|
|
math.enable = mkBoolOption false;
|
2020-10-05 01:38:58 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2020-10-25 15:49:14 +00:00
|
|
|
my.packages = with pkgs;
|
|
|
|
[
|
|
|
|
(python37.withPackages (p:
|
|
|
|
with python3Packages;
|
|
|
|
[
|
|
|
|
beautifulsoup4 # How soups are beautiful again?
|
|
|
|
requests # The requests for your often-asked questions.
|
|
|
|
pip # Named after a certain mouse that lives in a barnyard and its ability to keep track of dependencies.
|
|
|
|
pytools # It's the little things that counts.
|
|
|
|
pytest # Try to make a good grade or else.
|
|
|
|
poetry # It rhymes...
|
|
|
|
scrapy # Create an extractor from a box of scraps.
|
|
|
|
setuptools # Setup your stuff.
|
|
|
|
]
|
2020-10-05 01:38:58 +00:00
|
|
|
|
2020-10-25 15:49:14 +00:00
|
|
|
++ (if cfg.math.enable then [
|
|
|
|
numpy # Numbers are also good, right?
|
|
|
|
sympy # When will you notice that math is good?
|
|
|
|
] else
|
|
|
|
[ ])))
|
|
|
|
];
|
2020-10-05 01:38:58 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|