From d8b96a32e8b40bb39efbb8cf237bf8016643a09d Mon Sep 17 00:00:00 2001 From: Haonan Chen Date: Mon, 5 Jan 2026 11:45:21 +0800 Subject: [PATCH] devices.wlin: fix env --- devices/wlin/default.nix | 2 +- devices/wlin/files/.bash_profile | 7 ------- devices/wlin/files/.bashrc | 11 +++++++---- packages/vasp/intel/default.nix | 4 ++-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/devices/wlin/default.nix b/devices/wlin/default.nix index 8ee63676..eedbf49f 100644 --- a/devices/wlin/default.nix +++ b/devices/wlin/default.nix @@ -17,7 +17,7 @@ let paths = with pkgs; [ gnuplot localPackages.vaspkit pv python localPackages.vasp.intel chn-bsub hwloc - lsd prrte.dev + lsd glibc glibc.bin ]; postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version"; passthru = { inherit pkgs chn-bsub; archive = pkgs.closureInfo { rootPaths = [ wlin.drvPath ]; }; }; diff --git a/devices/wlin/files/.bash_profile b/devices/wlin/files/.bash_profile index 9e8058dd..b1b93f74 100644 --- a/devices/wlin/files/.bash_profile +++ b/devices/wlin/files/.bash_profile @@ -1,10 +1,3 @@ -# .bash_profile - -# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi - -# User specific environment and startup programs -export PATH=/data/gpfs01/wlin/.nix/state/gcroots/current/bin:$HOME/bin:$PATH -ulimit -s unlimited diff --git a/devices/wlin/files/.bashrc b/devices/wlin/files/.bashrc index a5a134f8..32bbef08 100644 --- a/devices/wlin/files/.bashrc +++ b/devices/wlin/files/.bashrc @@ -1,7 +1,10 @@ -# .bashrc - -# Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi -export HISTFILESIZE=1000000 + +if [ -z "${BASHRC_SOURCED-}" ]; then + export PATH=$HOME/.nix/state/gcroots/current/bin:$HOME/bin:$PATH + ulimit -s unlimited + export HISTFILESIZE=1000000 + export BASHRC_SOURCED=1 +fi diff --git a/packages/vasp/intel/default.nix b/packages/vasp/intel/default.nix index fb920958..7a52193d 100644 --- a/packages/vasp/intel/default.nix +++ b/packages/vasp/intel/default.nix @@ -1,4 +1,4 @@ -{ stdenv, src, writeShellScriptBin, lib, rsync, which, wannier90, hdf5, mpi, mkl }: +{ stdenv, src, writeShellScriptBin, lib, rsync, which, wannier90, hdf5, mpi, mkl, prrte }: let vasp = stdenv.mkDerivation { @@ -26,7 +26,7 @@ let }; wrapper = writeShellScriptBin "vasp-intel" '' - export PATH=${vasp}/bin:${mpi}/bin''${PATH:+:$PATH} + export PATH=${vasp}/bin:${mpi}/bin:${mpi.dev}/bin:${prrte}/bin:${prrte.dev}/bin''${PATH:+:$PATH} # set OMP_NUM_THREADS if SLURM_CPUS_PER_TASK is set if [ -z "$OMP_NUM_THREADS" ] && [ -n "$SLURM_CPUS_PER_TASK" ]; then