Skip to content

Commit

Permalink
Move programming related stuff to a module
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Oct 13, 2024
1 parent 1248588 commit b0fa416
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 93 deletions.
4 changes: 2 additions & 2 deletions modules/nixos/environment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
}: {
imports = [
./gui
./programming

./packages.nix
./cachix.nix
./fonts.nix
./latex.nix
./ld.nix
./programming.nix
./python.nix

./amd
./intel.nix
Expand All @@ -21,6 +20,7 @@
cachix.enable = lib.mkDefault false;
gui.enable = lib.mkDefault true;
latex.enable = lib.mkDefault false;
programming.enable = lib.mkDefault true;

amd.enable = lib.mkDefault false;
intel.enable = lib.mkDefault false;
Expand Down
21 changes: 0 additions & 21 deletions modules/nixos/environment/programming.nix

This file was deleted.

35 changes: 35 additions & 0 deletions modules/nixos/environment/programming/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
pkgs,
lib,
config,
...
}: {
imports = [
./python.nix
];

options.programming.enable = lib.mkEnableOption "Setup programming tools";

config = lib.mkIf config.programming.enable {
python.enable = lib.mkDefault true;

environment = {
systemPackages = with pkgs; [
gfortran
gcc
gcc-unwrapped
gnumake
julia-bin
#unstable.ruff
#ruff

# rust
cargo
rustc

# misc
hyperfine
];
};
};
}
49 changes: 49 additions & 0 deletions modules/nixos/environment/programming/python.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
pkgs,
lib,
config,
...
}: let
packages = ps:
with ps; [
# Jupyter
jupyter
ipython
python-lsp-server
# Must
jax
matplotlib
numba
numba-scipy
numpy
pandas
plotly
streamlit
# Misc
manim
psutil
# Optional
# opencv4
# pillow
# requests
# scikit-image
];
in {
options.python.enable = lib.mkEnableOption "Setup a python environment";

config = lib.mkIf config.python.enable {
environment = {
systemPackages = with pkgs; [
(python3.withPackages packages)
manim
manim-slides
mkdocs
poetry
];

sessionVariables = {
PYTHON_KEYRING_BACKEND = "keyring.backends.null.Keyring";
};
};
};
}
70 changes: 0 additions & 70 deletions modules/nixos/environment/python.nix

This file was deleted.

0 comments on commit b0fa416

Please sign in to comment.