packages: 移动src

This commit is contained in:
2025-04-12 15:16:05 +08:00
parent 41cd77d578
commit 857f41c32f
11 changed files with 102 additions and 122 deletions

View File

@@ -31,6 +31,15 @@
version = "3.1.2";
hash = "sha256-f2cu+itsoNs03paOW1dmsUsbPa3iEtL4oIPGAKETRc4=";
};
vasp =
{
vasp = pkgs.requireFile
{
name = "vasp.6.4.3.tgz";
# nix-prefetch-url file://$(pwd)/vasp.6.4.3.tgz
sha256 = "1x14dixils77rr4c6yqmxkvyzgfz6906badsw2shksd3y9ryfc7y";
message = "Source file not found.";
};
vtst =
{
patch = pkgs.fetchzip
@@ -44,6 +53,7 @@
sha256 = "18gsw2850ig1mg4spp39i0ygfcwx0lqnamysn5whiax22m8d5z67";
};
};
};
huginn = pkgs.dockerTools.pullImage
{
imageName = "ghcr.io/huginn/huginn";
@@ -95,4 +105,38 @@
sha256 = "Tq4AzQgde2KIWKA1k6JlxvdphGG9JluHMZjVw0fBUeQ=";
};
};
# nix-store --query --hash $(nix store add-path . --name 'mirism')
mirism-old = pkgs.requireFile
{
name = "mirism";
sha256 = "0f50pvdafhlmrlbf341mkp9q50v4ld5pbx92d2w1633f18zghbzf";
hashMode = "recursive";
message = "Source file not found.";
};
pslist =
{
version = "1.4.0";
src = pkgs.fetchzip
{
url = "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pslist/1.4.0-4/pslist_1.4.0.orig.tar.xz";
sha256 = "1sp1h7ccniz658ms331npffpa9iz8llig43d9mlysll420nb3xqv";
};
};
vaspkit = rec
{
version = "1.5.1";
potcar = pkgs.requireFile
{
name = "POTCAR";
sha256 = "01adpp9amf27dd39m8svip3n6ax822vsyhdi6jn5agj13lis0ln3";
hashMode = "recursive";
message = "POTCAR not found.";
};
vaspkit = pkgs.fetchurl
{
url = "mirror://sourceforge/vaspkit/Binaries/vaspkit.${version}.linux.x64.tar.gz";
sha256 = "1cbj1mv7vx18icwlk9d2vfavsfd653943xg2ywzd8b7pb43xrfs1";
};
};
mathematica = pkgs.mathematica.src;
}

View File

@@ -6,8 +6,5 @@ inputs:
default = null;
};
config = let inherit (inputs.config.nixos.packages) mathematica; in inputs.lib.mkIf (mathematica != null)
{
nixos.packages.packages._packages = [ (inputs.pkgs.mathematica.overrideAttrs
(prev: { postInstall = (prev.postInstall or "") + "ln -s ${prev.src} $out/src"; })) ];
};
{ nixos.packages.packages._packages = [ inputs.pkgs.mathematica ]; };
}

View File

@@ -8,7 +8,11 @@ inputs: rec
src = inputs.topInputs.misskey;
extraIntegritySha256 = inputs.topInputs.self.src.misskey;
};
vaspkit = inputs.pkgs.callPackage ./vaspkit.nix { inherit (inputs.localLib) attrsToList; };
vaspkit = inputs.pkgs.callPackage ./vaspkit.nix
{
inherit (inputs.localLib) attrsToList;
src = inputs.topInputs.self.src.vaspkit;
};
v-sim = inputs.pkgs.callPackage ./v-sim.nix { src = inputs.topInputs.v-sim; };
concurrencpp = inputs.pkgs.callPackage ./concurrencpp.nix { src = inputs.topInputs.concurrencpp; };
matplotplusplus = inputs.pkgs.callPackage ./matplotplusplus.nix
@@ -18,11 +22,12 @@ inputs: rec
};
zpp-bits = inputs.pkgs.callPackage ./zpp-bits.nix { src = inputs.topInputs.zpp-bits; };
nameof = inputs.pkgs.callPackage ./nameof.nix { src = inputs.topInputs.nameof; };
pslist = inputs.pkgs.callPackage ./pslist.nix {};
pslist = inputs.pkgs.callPackage ./pslist.nix { src = inputs.topInputs.self.src.pslist; };
tgbot-cpp = inputs.pkgs.callPackage ./tgbot-cpp.nix { src = inputs.topInputs.tgbot-cpp; };
mirism-old = inputs.pkgs.callPackage ./mirism-old.nix
{
inherit cppcoro nameof tgbot-cpp date;
src = inputs.topInputs.self.src.mirism-old;
nghttp2 = inputs.pkgs.callPackage "${inputs.topInputs."nixpkgs-23.05"}/pkgs/development/libraries/nghttp2"
{ enableAsioLib = true; stdenv = inputs.pkgs.gcc12Stdenv; };
stdenv = inputs.pkgs.gcc12Stdenv;
@@ -31,26 +36,23 @@ inputs: rec
date = inputs.pkgs.callPackage ./date.nix { src = inputs.topInputs.date; };
blurred-wallpaper = inputs.pkgs.callPackage ./blurred-wallpaper.nix { src = inputs.topInputs.blurred-wallpaper; };
slate = inputs.pkgs.callPackage ./slate.nix { src = inputs.topInputs.slate; };
vasp = rec
vasp =
{
src = inputs.pkgs.callPackage ./vasp/source.nix {};
gnu = inputs.pkgs.callPackage ./vasp/gnu
{
inherit (inputs.pkgs.llvmPackages) openmp;
inherit src;
src = inputs.topInputs.self.src.vasp.vasp;
hdf5 = inputs.pkgs.hdf5.override { mpiSupport = true; fortranSupport = true; cppSupport = false; };
};
nvidia = inputs.pkgs.callPackage ./vasp/nvidia
{
inherit (nvhpcPackages) stdenv hdf5 mpi;
inherit src;
vtst = inputs.topInputs.self.src.vtst.patch;
src = inputs.topInputs.self.src.vasp;
wannier90 = inputs.pkgs.wannier90.overrideAttrs { buildFlags = [ "dynlib" ]; };
};
intel = inputs.pkgs.callPackage ./vasp/intel
{
inherit src;
vtst = inputs.topInputs.self.src.vtst.patch;
src = inputs.topInputs.self.src.vasp;
inherit (inputs.pkgs.intelPackages_2023) stdenv;
mpi = inputs.pkgs.openmpi.override
{
@@ -67,7 +69,7 @@ inputs: rec
};
wannier90 = inputs.pkgs.wannier90.overrideAttrs { buildFlags = [ "dynlib" ]; };
};
vtst = inputs.pkgs.callPackage ./vasp/vtst.nix { src = inputs.topInputs.self.src.vtst.script; };
vtst = inputs.pkgs.callPackage ./vasp/vtst.nix { src = inputs.topInputs.self.src.vasp.vtst.script; };
};
mumax = inputs.pkgs.callPackage ./mumax.nix { src = inputs.topInputs.mumax; };
biu = inputs.pkgs.callPackage ./biu

View File

@@ -1,17 +1,9 @@
{
lib, stdenv, requireFile,
lib, stdenv, requireFile, src,
boost, nghttp2, brotli, nameof, cppcoro, tgbot-cpp, libbacktrace, fmt, date
}: stdenv.mkDerivation rec
}: stdenv.mkDerivation
{
name = "mirism";
# nix-store --query --hash $(nix store add-path . --name 'mirism')
src = requireFile
{
inherit name;
sha256 = "0f50pvdafhlmrlbf341mkp9q50v4ld5pbx92d2w1633f18zghbzf";
hashMode = "recursive";
message = "Source file not found.";
};
buildInputs = [ boost nghttp2.dev brotli nameof cppcoro tgbot-cpp libbacktrace fmt date ];
buildPhase =
''
@@ -24,7 +16,6 @@
runHook preInstall
mkdir -p $out/bin
cp build/{ng01,beta} $out/bin
ln -s ${src} $out/src
runHook postInstall
'';
}

View File

@@ -1,14 +1,9 @@
# http://launchpadlibrarian.net/632309499/pslist_1.4.0-4_all.deb
# https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pslist/1.4.0-4/pslist_1.4.0.orig.tar.xz
{ lib, stdenv, fetchzip, perl, procps }: stdenv.mkDerivation
{ stdenv, src, perl, procps }: stdenv.mkDerivation
{
pname = "pslist";
version = "1.4.0";
src = fetchzip
{
url = "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pslist/1.4.0-4/pslist_1.4.0.orig.tar.xz";
sha256 = "1sp1h7ccniz658ms331npffpa9iz8llig43d9mlysll420nb3xqv";
};
inherit (src) version src;
buildInstall = [ perl procps ];
installPhase =
''

View File

@@ -24,7 +24,6 @@ let vasp = stdenvNoCC.mkDerivation
for i in std gam ncl; do
cp bin/vasp_$i $out/bin/vasp-$i
done
ln -s ${src} $out/src
'';
};
in writeShellApplication

View File

@@ -1,18 +1,15 @@
{
stdenv, src, writeShellScriptBin, lib,
rsync, which, wannier90, hdf5, vtst, mpi, mkl
}:
{ stdenv, src, writeShellScriptBin, lib, rsync, which, wannier90, hdf5, mpi, mkl }:
let vasp = stdenv.mkDerivation
{
name = "vasp-intel";
inherit src;
src = src.vasp;
patches = [ ../vtst.patch ];
configurePhase =
''
cp ${./makefile.include} makefile.include
chmod +w makefile.include
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
cp -r ${vtst}/vtstcode6.4.3/* src
cp -r ${src.vtst.patch}/vtstcode6.4.3/* src
chmod -R +w src
'';
buildInputs = [ hdf5 wannier90 mkl ];
@@ -21,22 +18,10 @@ let vasp = stdenv.mkDerivation
''
mkdir -p $out/bin
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
mkdir $out/src
ln -s ${src} $out/src/vasp
ln -s ${vtst} $out/src/vtst
'';
# NIX_DEBUG = "7";
# enable parallel build
enableParallelBuilding = true;
DEPS = "1";
# vasp directly include headers under ${mkl}/include/fftw
MKLROOT = mkl;
# tell openmpi use ifx
OMPI_F90 = "ifx";
env = { DEPS = "1"; MKLROOT = mkl; OMPI_F90 = "ifx"; };
};
in writeShellScriptBin "vasp-intel"
''

View File

@@ -1,18 +1,15 @@
{
stdenv, src, writeShellScriptBin,
rsync, which, wannier90, hdf5, vtst, mkl, mpi
}:
{ stdenv, src, writeShellScriptBin, rsync, which, wannier90, hdf5, mkl, mpi }:
let vasp = stdenv.mkDerivation
{
name = "vasp-nvidia";
inherit src;
src = src.vasp;
patches = [ ../vtst.patch ];
configurePhase =
''
cp ${./makefile.include} makefile.include
chmod +w makefile.include
cp ${../constr_cell_relax.F} src/constr_cell_relax.F
cp -r ${vtst}/vtstcode6.4.3/* src
cp -r ${src.vtst.patch}/vtstcode6.4.3/* src
chmod -R +w src
'';
buildInputs = [ hdf5 wannier90 mkl ];
@@ -21,20 +18,10 @@ let vasp = stdenv.mkDerivation
''
mkdir -p $out/bin
for i in std gam ncl; do cp bin/vasp_$i $out/bin/vasp-$i; done
mkdir $out/src
ln -s ${src} $out/src/vasp
ln -s ${vtst} $out/src/vtst
'';
# enable parallel build
enableParallelBuilding = true;
env =
{
DEPS = "1";
# vasp directly include headers under ${mkl}/include/fftw
MKLROOT = mkl;
QD = "${stdenv.cc.cc}/Linux_x86_64/${stdenv.cc.cc.version}/compilers/extras/qd";
};
env = { DEPS = "1"; MKLROOT = mkl; QD = "${stdenv.cc.cc}/Linux_x86_64/${stdenv.cc.cc.version}/compilers/extras/qd"; };
};
in writeShellScriptBin "vasp-nvidia"
''

View File

@@ -1,7 +0,0 @@
{ requireFile }: requireFile
{
name = "vasp.6.4.3.tgz";
# nix-prefetch-url file://$(pwd)/vasp.6.4.3.tgz
sha256 = "1x14dixils77rr4c6yqmxkvyzgfz6906badsw2shksd3y9ryfc7y";
message = "Source file not found.";
}

View File

@@ -1,22 +1,11 @@
{ stdenv, fetchurl, requireFile, autoPatchelfHook, makeWrapper, python3, attrsToList, gnused }:
{ stdenv, src, autoPatchelfHook, makeWrapper, python3, attrsToList, gnused }:
let
potcar = requireFile
{
name = "POTCAR";
sha256 = "01adpp9amf27dd39m8svip3n6ax822vsyhdi6jn5agj13lis0ln3";
hashMode = "recursive";
message = "POTCAR not found.";
};
unwrapped = stdenv.mkDerivation rec
unwrapped = stdenv.mkDerivation
{
pname = "vaspkit-unwrapped";
version = "1.5.1";
inherit (src) version;
src = src.vaspkit;
buildInputs = [ autoPatchelfHook stdenv.cc.cc ];
src = fetchurl
{
url = "mirror://sourceforge/vaspkit/Binaries/vaspkit.${version}.linux.x64.tar.gz";
sha256 = "1cbj1mv7vx18icwlk9d2vfavsfd653943xg2ywzd8b7pb43xrfs1";
};
installPhase =
''
runHook preInstall
@@ -26,7 +15,7 @@ let
'';
};
python = python3.withPackages (pythonPackages: with pythonPackages; [ numpy scipy matplotlib ]);
envirmentVariables =
envirmentVariables = let inherit (src) potcar; in
{
LDA_PATH = "${potcar}/PAW_LDA";
PBE_PATH = "${potcar}/PAW_PBE";

View File

@@ -1,9 +1,7 @@
{
lib, stdenv, fetchurl, autoPatchelfHook, wrapGAppsHook, makeWrapper, src,
glib, gtk2, xorg, libGLU, gtk3, writeShellScript, gsettings-desktop-schemas, xdg-utils, webkitgtk, jdk
}:
stdenv.mkDerivation
}: stdenv.mkDerivation
{
pname = "vesta";
inherit (src) src version;