mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 02:09:26 +08:00
update root
This commit is contained in:
@@ -1,30 +1,38 @@
|
||||
inputs:
|
||||
{
|
||||
options.nixos.packages.root = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.nullOr (types.submodule {});
|
||||
default = {};
|
||||
};
|
||||
{ type = types.nullOr (types.submodule {}); default = {}; };
|
||||
config = let inherit (inputs.config.nixos.packages) root; in inputs.lib.mkIf (root != null)
|
||||
{
|
||||
nixos.packages.packages =
|
||||
let jupyterPath = inputs.pkgs.jupyter-kernel.create { definitions.root = rec
|
||||
{
|
||||
displayName = "ROOT";
|
||||
language = "c++";
|
||||
argv = [ "/run/current-system/sw/bin/python3" "-m" "JupyROOT.kernel.rootkernel" "-f" "{connection_file}" ];
|
||||
logo64 = "${inputs.pkgs.root}/etc/root/notebook/kernels/root/logo-64x64.png";
|
||||
logo32 = inputs.pkgs.runCommand "logo-32x32.png" {}
|
||||
"${inputs.pkgs.imagemagick}/bin/convert ${logo64} -resize 32x32 $out";
|
||||
};};
|
||||
let
|
||||
root = inputs.pkgs.root.overrideAttrs rec
|
||||
{
|
||||
version = "6.34.00-rc1";
|
||||
src = inputs.pkgs.fetchurl
|
||||
{
|
||||
url = "https://root.cern/download/root_v${version}.source.tar.gz";
|
||||
sha256 = "1fx6nyv3drcb16a36np7h3vmjlm937j6y9vxkv0sny0grrxcj9lw";
|
||||
};
|
||||
patches = [];
|
||||
};
|
||||
jupyterPath = inputs.pkgs.jupyter-kernel.create { definitions.root = rec
|
||||
{
|
||||
displayName = "ROOT";
|
||||
language = "c++";
|
||||
argv = [ "/run/current-system/sw/bin/python3" "-m" "JupyROOT.kernel.rootkernel" "-f" "{connection_file}" ];
|
||||
logo64 = "${root}/etc/root/notebook/kernels/root/logo-64x64.png";
|
||||
logo32 = inputs.pkgs.runCommand "logo-32x32.png" {}
|
||||
"${inputs.pkgs.imagemagick}/bin/convert ${logo64} -resize 32x32 $out";
|
||||
};};
|
||||
in
|
||||
{
|
||||
_packages = [ inputs.pkgs.root ];
|
||||
_packages = [ root ];
|
||||
_pythonPackages = [(pythonPackages: with pythonPackages; [ metakernel notebook ])];
|
||||
_pythonEnvFlags =
|
||||
[
|
||||
"--prefix JUPYTER_PATH : ${jupyterPath}"
|
||||
"--suffix NIX_PYTHONPATH : ${inputs.pkgs.root}/lib"
|
||||
"--suffix NIX_PYTHONPATH : ${root}/lib"
|
||||
];
|
||||
_vscodeEnvFlags = [ "--prefix JUPYTER_PATH : ${jupyterPath}" ];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user