Compare commits

...

9 Commits

Author SHA1 Message Date
David Crompton bda6871fc7 KCNHUB: Matlab: Add Support for PAM-auth 2024-07-18 19:07:48 -04:00
David Crompton 703675d218 KCNHUB: Python: Overlays for MNE & EDFIO 2024-07-18 19:07:10 -04:00
David Crompton bb1ca71158 JupyterHub Collab Extension is Broken 2024-07-10 10:29:40 -04:00
David Crompton f24d5cf194 Python: Add Openpyxl 2024-05-14 11:44:56 -04:00
David Crompton 905d0acefe Python: Merge packages between jupyter & system 2024-05-10 14:38:47 -04:00
David Crompton d14c11f044 Python: MNE-Fix 2024-05-10 14:27:47 -04:00
David Crompton 29a13e0149 Users: Add Josh & Groups: NFRF Add Josh 2024-04-24 09:42:07 -04:00
David Crompton d35c9ffc37 Users: Add Michael, Ryan, Reza, Yupeng, Zoe 2024-04-23 10:12:07 -04:00
David Crompton faafde6dda Groups: NFRF, add Nooshin 2024-04-23 09:18:29 -04:00
16 changed files with 192 additions and 57 deletions

View File

@ -35,6 +35,7 @@
config.cudaSupport = true; config.cudaSupport = true;
}; };
}; };
python-overlay = import ./overlays/python.nix;
applyOverlays = overlays: ({...}:{ nixpkgs.overlays = overlays; }); applyOverlays = overlays: ({...}:{ nixpkgs.overlays = overlays; });
flakes = {...}: {nix.settings.experimental-features = [ "nix-command" "flakes" ];}; flakes = {...}: {nix.settings.experimental-features = [ "nix-command" "flakes" ];};
in { in {
@ -43,7 +44,7 @@
specialArgs = attrs; specialArgs = attrs;
modules = [ modules = [
flakes flakes
(applyOverlays [ unfree-overlay unstable-overlay ]) (applyOverlays [ unfree-overlay unstable-overlay python-overlay ])
./machines/kcnhub/configuration.nix ./machines/kcnhub/configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];

View File

@ -2,8 +2,14 @@
virtualisation = { virtualisation = {
podman = { podman = {
enable = true; enable = true;
dockerCompat = true;
}; };
docker.rootless = {
enable = true;
setSocketVariable = true;
};
# For compatability, and for some reason this isn't able to be per
# container?
oci-containers.backend = "docker";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [

View File

@ -59,7 +59,9 @@
# matlab's installers) # matlab's installers)
matlab-env = pkgs.buildFHSUserEnv { matlab-env = pkgs.buildFHSUserEnv {
name = "matlab-env"; name = "matlab-env";
targetPkgs = (ps: nix-matlab.targetPkgs ps); targetPkgs = (ps: (nix-matlab.targetPkgs ps) ++ (with ps; [
linux-pam
]));
}; };
# Script used to get the most up to date version of the desired MATLAB # Script used to get the most up to date version of the desired MATLAB
@ -126,7 +128,7 @@
''; '';
runScript = pkgs.writeScript "matlab-run-${f}-script" '' runScript = pkgs.writeScript "matlab-run-${f}-script" ''
export QT_QPA_PLATFORM=xcb export QT_QPA_PLATFORM=xcb
${MATLAB_INSTALL_DIR}/bin/${f} "$@" "$MATLAB_INSTALL_DIR/bin/${f}" "$@"
''; '';
}; };
@ -144,6 +146,7 @@ in {
environment.systemPackages =(with pkgs; [ environment.systemPackages =(with pkgs; [
matlab-update-script matlab-update-script
matlab matlab
matlab-env
matlab-mex matlab-mex
octaveFull octaveFull
]); ]);

View File

@ -1,12 +1,62 @@
{config, lib, pkgs, ...}: { {config, lib, pkgs, ...}: {
environment.systemPackages = with pkgs; [ options = {
(pkgs.python3.withPackages (p: with p; [ pythonPackages = lib.mkOption {
type = lib.types.anything;
default = p: with p; [];
example = p: with p; [ numpy scipy ];
description = "List of Python Packages installed";
};
};
config = {
environment.systemPackages = with pkgs; [
((pkgs.python3.withPackages config.pythonPackages).override (args: { ignoreCollisions = true; }))
];
pythonPackages = (p: with p; [
# Common Python Libraries
numpy numpy
scipy scipy
scikit-learn
pandas pandas
openpyxl
matplotlib matplotlib
tqdm ipympl
matplotlib-inline
seaborn seaborn
]))
]; # Neural Data Processing Libraries
# Temporarily broken?: https://github.com/NixOS/nixpkgs/issues/259812
mne-python
edfio
nibabel
# View niftis!
ipyniivue
neo
# Neurosimulators
neuronpy
# nest with MPI is incompatible with Jupyter:
# https://www.nest-simulator.org/pynest-api/_modules/nest.html
# see pynestkernel comments about their workaround
(nest.override {
withMpi = false;
})
brian2
# Machine learning toolkits:
tensorflow
tensorboard
keras
edward
transformers
tflearn
torch
torchvision
torchsde
torchmetrics
torchio
torchdiffeq
botorch
lion-pytorch
]);
};
} }

View File

@ -133,7 +133,7 @@
# Configuration options defined ^ # Configuration options defined ^
# mem_limit must be higher to allow for MATLAB # mem_limit must be higher to allow for MATLAB
extraConfig = '' extraConfig = ''
c.SystemdSpawner.mem_limit = '8G' c.SystemdSpawner.mem_limit = '32G'
c.SystemdSpawner.cpu_limit = 2.0 c.SystemdSpawner.cpu_limit = 2.0
c.SystemdSpawner.isolate_devices = False c.SystemdSpawner.isolate_devices = False
c.SystemdSpawner.extra_paths = [ c.SystemdSpawner.extra_paths = [
@ -164,7 +164,7 @@
jupyterhub jupyterhub
jupyterlab jupyterlab
# Extensions: # Extensions:
jupyter-collaboration # jupyter-collaboration
jupyter-server-mathjax jupyter-server-mathjax
jupyter-console jupyter-console
jupyterlab-lsp jupyterlab-lsp
@ -175,7 +175,8 @@
kernels = { kernels = {
python3 = let python3 = let
env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages; [ env = (pkgs.python3.withPackages (pythonPackages: with pythonPackages;
(config.pythonPackages pythonPackages) ++ [
# Necessary for use as a kernel # Necessary for use as a kernel
ipykernel ipykernel
ipdb ipdb
@ -185,52 +186,8 @@
mediapy mediapy
# Progress bars etc. for in Jupyter/IPython # Progress bars etc. for in Jupyter/IPython
halo halo
# Common Python Libraries
numpy
scipy
scikit-learn
pandas
# Tables displayed in Jupyter: like Pandas Dataframes # Tables displayed in Jupyter: like Pandas Dataframes
ipytablewidgets ipytablewidgets
matplotlib
ipympl
matplotlib-inline
seaborn
# Neural Data Processing Libraries
# Temporarily broken?: https://github.com/NixOS/nixpkgs/issues/259812
# mne-python
nibabel
# View niftis!
ipyniivue
neo
# Neurosimulators
neuronpy
# nest with MPI is incompatible with Jupyter:
# https://www.nest-simulator.org/pynest-api/_modules/nest.html
# see pynestkernel comments about their workaround
(nest.override {
withMpi = false;
})
brian2
# Machine learning toolkits:
tensorflow
tensorboard
keras
edward
transformers
tflearn
torch
torchvision
torchsde
torchmetrics
torchio
torchdiffeq
botorch
lion-pytorch
])).override (args: { ignoreCollisions = true; }); ])).override (args: { ignoreCollisions = true; });
# Odd collision between tensorboard of torch & tensorflow # Odd collision between tensorboard of torch & tensorflow
# need to resolve later # need to resolve later

View File

@ -9,6 +9,7 @@ in {
# "Normal" User: for Podman Usage # "Normal" User: for Podman Usage
isNormalUser = true; isNormalUser = true;
home = stateDir; home = stateDir;
linger = true;
}; };
groups.overleaf = {}; groups.overleaf = {};
}; };

View File

@ -11,6 +11,12 @@
./users/ngilab.nix ./users/ngilab.nix
./users/milad.nix ./users/milad.nix
./users/nooshin.nix ./users/nooshin.nix
./users/zoe.nix
./users/yupeng.nix
./users/reza.nix
./users/michael.nix
./users/ryan.nix
./users/josh.nix
# Groups # Groups
./users/groups/admin.nix ./users/groups/admin.nix

View File

@ -3,6 +3,8 @@
members = [ members = [
"spandan" "spandan"
"frances" "frances"
"nooshin"
"josh"
]; ];
}; };
} }

View File

@ -0,0 +1,11 @@
{ pkgs, ... }: {
users.users.josh = {
isNormalUser = true;
extraGroups = [ ];
homeSize = "50g";
homeProjectId = 117;
packages = with pkgs; [
];
};
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
users.users.michael = {
isNormalUser = true;
extraGroups = [ ];
homeSize = "50g";
homeProjectId = 114;
initialHashedPassword = "$y$j9T$i8NenYjqKmfJvKvmx2UmY0$5lqRmnrq2PDjELQj4F7xr/MS2Dd0iEOXDWp9kJwXYZ7";
packages = with pkgs; [
];
};
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
users.users.reza = {
isNormalUser = true;
extraGroups = [ ];
homeSize = "50g";
homeProjectId = 115;
initialHashedPassword = "$y$j9T$i8NenYjqKmfJvKvmx2UmY0$5lqRmnrq2PDjELQj4F7xr/MS2Dd0iEOXDWp9kJwXYZ7";
packages = with pkgs; [
];
};
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
users.users.ryan = {
isNormalUser = true;
extraGroups = [ ];
homeSize = "50g";
homeProjectId = 116;
initialHashedPassword = "$y$j9T$i8NenYjqKmfJvKvmx2UmY0$5lqRmnrq2PDjELQj4F7xr/MS2Dd0iEOXDWp9kJwXYZ7";
packages = with pkgs; [
];
};
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
users.users.yupeng = {
isNormalUser = true;
extraGroups = [ ];
homeSize = "50g";
homeProjectId = 113;
initialHashedPassword = "$y$j9T$i8NenYjqKmfJvKvmx2UmY0$5lqRmnrq2PDjELQj4F7xr/MS2Dd0iEOXDWp9kJwXYZ7";
packages = with pkgs; [
];
};
}

View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
users.users.zoe = {
isNormalUser = true;
extraGroups = [ ];
homeSize = "50g";
homeProjectId = 112;
initialHashedPassword = "$y$j9T$i8NenYjqKmfJvKvmx2UmY0$5lqRmnrq2PDjELQj4F7xr/MS2Dd0iEOXDWp9kJwXYZ7";
packages = with pkgs; [
];
};
}

View File

@ -0,0 +1,33 @@
final: final-py: prev-py: {
mne-python = prev-py.mne-python.overridePythonAttrs (old: {
pyproject = true;
format = null;
propagatedBuildInputs = old.propagatedBuildInputs ++ [
final-py.setuptools-scm
];
});
edfio = let
version = "0.4.1";
pname = "edfio";
in final-py.buildPythonPackage {
inherit pname version;
format = "pyproject";
src = final.fetchFromGitHub {
owner = "the-siesta-group";
repo = pname;
rev = "v${version}";
hash = "sha256-+yb3Q/JximkVS6SOTFnjMYghbOi+UBbqW2Bs29eSonA=";
};
nativeBuildInputs = with final-py; [
poetry-core
poetry-dynamic-versioning
];
propagatedBuildInputs = with final-py; [
numpy
];
};
}

5
overlays/python.nix Normal file
View File

@ -0,0 +1,5 @@
final: prev: {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [(
(import ./python-packages.nix final)
)];
}