Compare commits

...

9 Commits

Author SHA1 Message Date
Antoine Fauroux 42e24c49d1 Merge branch 'master' of https://git.ws.kcnhub.com/DavidC/WS-KCNHUB 2025-09-11 14:18:22 -04:00
Antoine Fauroux e098c93f11 kcnhub: user: david: unstable emacs 2025-09-11 14:16:13 -04:00
Antoine Fauroux 136cdff6fc kcnhub: add waypipe 2025-09-11 14:15:51 -04:00
Antoine Fauroux 2f419b91a7 kcnhub: enable vscode server 2025-09-11 14:15:36 -04:00
Antoine Fauroux 6f3443047e kcnhub: users: add Raiyan (Milads Lab) 2025-08-25 07:31:26 -04:00
Antoine Fauroux 11a8ab0822 adding some packages for ngilab 2025-08-22 17:29:25 -04:00
Antoine Fauroux 130037d1fc kcnhub: user: add arthur 2025-07-28 09:46:31 -04:00
Antoine Fauroux 1b7e4d9a2b Overlays: Add Smoldyn (Depends on fenix) 2025-06-10 14:56:59 -04:00
Antoine Fauroux cd960974ff kcnhub: Add Umar 2025-06-10 13:38:41 -04:00
16 changed files with 593 additions and 7 deletions

View File

@ -1,5 +1,26 @@
{ {
"nodes": { "nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1749537578,
"narHash": "sha256-dYEEiNRw7rClQi4Y7t9jlHjbuUvSbdTdM/jXwXuaDeQ=",
"owner": "nix-community",
"repo": "fenix",
"rev": "5e3ce25aa3048f14f206a6c4fab46af6ad939482",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -16,6 +37,24 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nix-matlab": { "nix-matlab": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -85,12 +124,45 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1682134069,
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fd901ef4bf93499374c5af385b2943f5801c0833",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": { "root": {
"inputs": { "inputs": {
"fenix": "fenix",
"nix-matlab": "nix-matlab", "nix-matlab": "nix-matlab",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix" "sops-nix": "sops-nix",
"vscode-server": "vscode-server"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1749493129,
"narHash": "sha256-nQ+gKRLXkl7gLY836ULyAwR3O0E/+vakZt78OQ+p9Fc=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "bf6d44581085bb9b6e285902a7fae77325703171",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
} }
}, },
"sops-nix": { "sops-nix": {
@ -113,6 +185,40 @@
"repo": "sops-nix", "repo": "sops-nix",
"type": "github" "type": "github"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"vscode-server": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1753541826,
"narHash": "sha256-foGgZu8+bCNIGeuDqQ84jNbmKZpd+JvnrL2WlyU4tuU=",
"owner": "nix-community",
"repo": "nixos-vscode-server",
"rev": "6d5f074e4811d143d44169ba4af09b20ddb6937d",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-vscode-server",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -16,8 +16,15 @@
# Follow the system nixpkgs # Follow the system nixpkgs
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, nix-matlab }@attrs: let vscode-server = {
url = "github:nix-community/nixos-vscode-server";
};
};
outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, nix-matlab, vscode-server, ... }@attrs: let
system = "x86_64-linux"; system = "x86_64-linux";
unfree-overlay = final: prev: { unfree-overlay = final: prev: {
unfree = import nixpkgs { unfree = import nixpkgs {
@ -35,7 +42,7 @@
config.cudaSupport = true; config.cudaSupport = true;
}; };
}; };
python-overlay = import ./overlays/python.nix; python-overlay = import ./overlays/python.nix attrs;
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 {
@ -45,6 +52,7 @@
modules = [ modules = [
flakes flakes
(applyOverlays [ unfree-overlay unstable-overlay python-overlay ]) (applyOverlays [ unfree-overlay unstable-overlay python-overlay ])
vscode-server.nixosModules.default
./machines/kcnhub/configuration.nix ./machines/kcnhub/configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
]; ];

View File

@ -1,5 +1,7 @@
{ pkgs, ...}: { { pkgs, ...}: {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
embree embree
ranger
blender
]; ];
} }

View File

@ -45,6 +45,8 @@
spynnaker spynnaker
# fetching neuromorphic data: # fetching neuromorphic data:
tonic tonic
# Stochastic simulation
# smoldyn-py
# Librairies to deal with mesh # Librairies to deal with mesh

View File

@ -11,5 +11,6 @@
vim vim
tmux tmux
screen screen
unstable.waypipe
]; ];
} }

View File

@ -3,4 +3,5 @@
./services/ssh.nix ./services/ssh.nix
./services/xrdp.nix ./services/xrdp.nix
]; ];
services.vscode-server.enable = true;
} }

View File

@ -21,6 +21,9 @@
./users/iffat.nix ./users/iffat.nix
./users/jkaethee.nix ./users/jkaethee.nix
./users/afauroux.nix ./users/afauroux.nix
./users/umar.nix
./users/arthur.nix
./users/raiyan.nix
# Groups # Groups
./users/groups/admin.nix ./users/groups/admin.nix

View File

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

View File

@ -4,7 +4,7 @@
homeSize = "50g"; homeSize = "50g";
homeProjectId = 100; homeProjectId = 100;
packages = with pkgs; [ packages = with pkgs; [
emacs unstable.emacs
]; ];
}; };
} }

View File

@ -0,0 +1,9 @@
{ ... }: {
users.groups."ngilab_shared" = {
members = [
"afauroux"
"ngilab"
"zhenyangsun"
];
};
}

View File

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

View File

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

56
overlays/libsbml.nix Normal file
View File

@ -0,0 +1,56 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
bzip2,
libxml2,
swig,
python ? null,
withPython ? false,
}:
stdenv.mkDerivation (attrs: {
pname = "libsbml";
version = "5.20.4";
src = fetchFromGitHub {
owner = "sbmlteam";
repo = "libsbml";
rev = "v${attrs.version}";
hash = "sha256-qWTN033YU4iWzt+mXQaP5W/6IF5nebF4PwNVkyL8wTg=";
};
nativeBuildInputs = [
cmake
pkg-config
swig
] ++ lib.optional withPython python.pkgs.pythonImportsCheckHook;
buildInputs = [
bzip2.dev
libxml2
] ++ lib.optional withPython python;
# libSBML doesn't always make use of pkg-config
cmakeFlags = [
"-DLIBXML_INCLUDE_DIR=${lib.getDev libxml2}/include/libxml2"
"-DLIBXML_LIBRARY=${lib.getLib libxml2}/lib/libxml2${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DPKG_CONFIG_EXECUTABLE=${lib.getBin pkg-config}/bin/pkg-config"
"-DSWIG_EXECUTABLE=${lib.getBin swig}/bin/swig"
] ++ lib.optional withPython "-DWITH_PYTHON=ON";
postInstall = lib.optional withPython ''
mv $out/${python.sitePackages}/libsbml/libsbml.py $out/${python.sitePackages}/libsbml/__init__.py
'';
pythonImportsCheck = [ "libsbml" ];
meta = with lib; {
description = "Library for manipulating Systems Biology Markup Language (SBML)";
homepage = "https://github.com/sbmlteam/libsbml";
license = licenses.lgpl21Only;
maintainers = [ maintainers.kupac ];
platforms = platforms.all;
};
})

View File

@ -126,4 +126,4 @@ final: final-py: prev-py: {
pytorch-data pytorch-data
]; ];
}; };
} // (import ./spynnaker.nix final final-py prev-py) } // (import ./spynnaker.nix final final-py prev-py) #// (import ./smoldyn.nix final final-py prev-py)

View File

@ -1,5 +1,8 @@
final: prev: { inputs: final: prev:
(inputs.fenix.overlays.default final prev) // {
pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [( pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [(
(import ./python-packages.nix final) (import ./python-packages.nix final)
)]; )];
libsbml = final.callPackage ./libsbml.nix { };
} }

362
overlays/smoldyn.nix Normal file
View File

@ -0,0 +1,362 @@
final: final-py: prev-py: let
rust-new = p: p.fenix.stable;
rustPlatform = final.makeRustPlatform {
inherit (rust-new final) cargo rustc;
};
py = final-py;
pyenv-smoldyn = py.python.withPackages (p: with p; [
setuptools
wheel
pybind11
pip
]);
smoldyn = final.fastStdenv.mkDerivation rec {
pname = "smoldyn";
version = "2.74";
outputs = [ "out" "py" ];
env.NIX_CFLAGS_COMPILE = "-march=native -mtune=native";
src = final.fetchzip {
url = "https://www.smoldyn.org/smoldyn-${version}.zip";
hash = "sha256-cKUMGgnPrHf2dNyFHmjpERgIMU0OltUZ/uhBfxpU4e4=";
};
nativeBuildInputs = with final; [
cmake
];
cmakeFlags = [
"-DSMOLDYN_VERSION=${version}"
"-DOPTION_ZLIB=ON"
];
buildInputs = with final; [
libGL
libGLU
freeglut
libtiff
zlib
pyenv-smoldyn
];
postInstall = ''
cp -r py $py
'';
};
in {
libsbml = final.libsbml.override {
python=py.python;
withPython=true;
};
libcombine = py.buildPythonPackage rec {
pname = "libcombine";
version = "0.2.20";
src = final.fetchFromGitHub {
owner = "sbmlteam";
repo = "libcombine";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-9MMQr0hQLo1l8B4nlzkk48zohCohdheojRTjKrCE6og=";
};
preBuild = ''
cd ..
cp src/bindings/python/setup.py .
'';
nativeBuildInputs = with final; [
swig cmake
];
buildInputs = with py; [
libsbml
final.zlib
];
};
libsedml = py.buildPythonPackage rec {
pname = "libsedml";
version = "2.0.28";
src = final.fetchFromGitHub {
owner = "fbergmann";
repo = "libSEDML";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-Pxts0kKj3BlfrwhXJjNvL936aSXiTb1cnccsW2lbUaM=";
};
preBuild = ''
cp src/bindings/python/setup.py .
'';
buildInputs = [
final.cmake
];
};
pyomexmeta = py.buildPythonPackage rec {
pname = "pyomexmeta";
version = "1.2.14";
src = final.fetchFromGitHub {
owner = "sys-bio";
repo = "libOmexMeta";
rev = "v${version}";
hash = "sha256-OMCq8uR3kC5cZpFyy28A02OSiVO4b49lFyWmbCeaw6c=";
};
};
# https://github.com/simularium/simulariumio/blob/main/pyproject.toml
simulariumio = py.buildPythonPackage rec {
pname = "simulariumio";
version = "1.12.0";
src = final.fetchFromGitHub {
owner = "simularium";
repo = "simulariumio";
rev = "v${version}";
hash = "sha256-Jl7KXEXeheYJRpgVcHyK6YUzyQMafQnABlrZM9d7c9g=";
leaveDotGit = true;
};
format = "pyproject";
nativeBuildInputs = with py; [
setuptools
setuptools_scm
wheel
];
SETUPTOOLS_SCM_PRETEND_VERSION=version;
propagatedBuildInputs = with py; [
numpy
pandas
pint
];
};
# https://github.com/biosimulators/Biosimulators_simularium
biosimulator_simularium = py.buildPythonPackage rec {
pname = "biosimulator";
version = "0.6.3";
src = final.fetchFromGitHub {
owner = "biosimulators";
repo = "biosimulators_simularium";
rev = "v${version}";
hash = "sha256-t0YM5Ika6Glvw3wvV71w7IHo6AovXz+7012rueEkoFw=";
};
format = "pyproject";
nativeBuildInputs = with py; [
poetry-core
];
};
biosimulator_util = py.buildPythonPackage rec {
pname = "biosimulator";
version = "0.2.3";
src = final.fetchFromGitHub {
owner = "biosimulators";
repo = "biosimulators_utils";
rev = "${version}";
hash = "sha256-/4HxruGpyJ6Guk4or/i+XI1JnHh2y7tWmw0AgdP5bkU=";
};
nativeBuildInputs = with py; [
pip
];
propagatedBuildInputs = with py; [
capturer
pkg_utils
jsonschema
flaky
bezier
rdflib
kisao
appdirs
matplotlib
docker
cement
regex
biopython
lxml
natsort
simplejson
libcombine
libsedml
pyomexmeta
pyyaml
evalidate
];
doCheck = false;
};
# https://github.com/yaroslaff/evalidate
evalidate = py.buildPythonPackage rec {
pname = "evalidate";
version = "2.0.3";
format = "pyproject";
src = final.fetchFromGitHub {
owner = "yaroslaff";
repo = "evalidate";
rev = "v${version}";
hash = "sha256-0SdGjsddX/iYeXpB9AdD7hnBH8raGHvSZ7D30a3sRXE=";
};
nativeBuildInputs = with py; [
hatchling
];
propagatedBuildInputs = with py; [
uritools
];
};
pkg_utils = py.buildPythonPackage rec {
pname = "pkg_utils";
version = "0.0.5";
src = final.fetchFromGitHub {
owner = "KarrLab";
repo = "pkg_utils";
rev = "${version}";
hash = "sha256-u6t4z1MoEkgoPkZtJuTYUbL5HyrkYthSPu9bhm8IZwo=";
};
nativeBuildInputs = with py; [
pip
];
propagatedBuildInputs = with py; [
glob2
requirements-parser
configparser
];
};
pronto = py.buildPythonPackage rec {
pname = "pronto";
version = "2.7.0";
src = final.fetchFromGitHub {
owner = "althonos";
repo = "pronto";
rev = "v${version}";
hash = "sha256-e+Nf+0kOH8d8KU2U9imxfeP1AjY2g/oZwZmQG394cts=";
};
nativeBuildInputs = with py; [
setuptools
];
buildInputs = with py; [
python-dateutil
];
format = "pyproject";
};
kisao = py.buildPythonPackage rec {
pname = "kisao";
version = "2.34";
src = final.fetchFromGitHub {
owner = "SED-ML";
repo = "Kisao";
rev = "${version}";
hash = "sha256-ozL1G9ylRhQL+lUCLwb2LSjooF5P8AgiWRMOWrBrDl8=";
};
prePatch = ''
cd libkisao/python
'';
nativeBuildInputs = with py; [
pip
];
propagatedBuildInputs = with py; [
pkg_utils
termcolor
pronto
python-dateutil
networkx
fastobo
chardet
];
};
fastobo = py.buildPythonPackage rec {
pname = "fastobo";
version = "0.13.0";
src = final.fetchFromGitHub {
owner = "fastobo";
repo = "fastobo-py";
rev = "v${version}";
hash = "sha256-8v9KjYX6Fy/ALFlYfSXpW40p0z54F5tpr10TAWenizk=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-USh7WK18I8A4VdGsUAnbrSiJuBYyq4539MlyS5ANSGo=";
};
format = "pyproject";
nativeBuildInputs = [
rustPlatform.cargoSetupHook
(rustPlatform.maturinBuildHook.override {
pkgsHostTarget = {
inherit (rust-new final.pkgsHostTarget) cargo rustc;
inherit (final.pkgsHostTarget) maturin;
};
})
];
};
bezier = py.buildPythonPackage rec {
pname = "bezier";
version = "2020.2.3";
src = final.fetchFromGitHub {
owner = "dhermes";
repo = "bezier";
rev = "${version}";
hash = "sha256-yuq2+Yy9XO2KwLlsB0IxjseG/axNBa5KuxBZ2J22ruE=";
};
BEZIER_NO_EXTENSION="1";
nativeBuildInputs = with py; [
pip
];
buildInputs = with py; [
pytest
matplotlib
seaborn
scipy
];
propagatedBuildInputs = with py; [
numpy
sympy
];
};
smoldyn-py = py.buildPythonPackage {
pname = "smoldyn";
version = smoldyn.version;
src = smoldyn.py;
postPatch = ''
sed -e '37,38d' -i setup.py
'';
propagatedBuildInputs = with py; [
biosimulator_util
biosimulator_simularium
simulariumio
numpy
pandas
h5py
openpyxl
pyvista
];
};
}