Compare commits

...

8 Commits

Author SHA1 Message Date
chn
0d444e570b devices.srv2: add node2, swap node0/1 2025-10-27 13:51:20 +08:00
chn
fcf9cb1943 modules.system.nixpkgs: remove native kernel patching 2025-10-27 13:51:20 +08:00
chn
6b080d7bed flake: update blog 2025-10-01 23:58:04 +08:00
chn
a8fbca34c6 src: fix netboot 2025-09-27 15:48:38 +08:00
chn
29f9309318 lib.buildNixpkgsConfig: fix sphinx build 2025-09-27 00:25:50 +08:00
chn
e86581da43 devices.jykang: remove unused packages 2025-09-26 17:26:01 +08:00
chn
1264a0e612 devices.jykang.xmuhpc: add python-lyj 2025-09-26 17:25:58 +08:00
chn
3967974068 packages.pybinding: init 2025-09-26 17:25:14 +08:00
16 changed files with 312 additions and 37 deletions

View File

@@ -2,15 +2,23 @@
# sudo nix-store --store 'local?store=/data/gpfs01/jykang/.nix/store&state=/data/gpfs01/jykang/.nix/state&log=/data/gpfs01/jykang/.nix/log' -qR ./result | grep -Fxv -f <(ssh jykang find .nix/store -maxdepth 1 -exec realpath '{}' '\;') | sudo xargs nix-store --store 'local?store=/data/gpfs01/jykang/.nix/store&state=/data/gpfs01/jykang/.nix/state&log=/data/gpfs01/jykang/.nix/log' --export | xz -T0 | pv > jykang.nar.xz
# cat data.nar | nix-store --import
{ inputs, localLib }:
let pkgs = import inputs.nixpkgs (localLib.buildNixpkgsConfig
{
inputs = { inherit (inputs.nixpkgs) lib; topInputs = inputs; };
nixpkgs = { march = "haswell"; cuda = null; nixRoot = "/data/gpfs01/jykang/.nix"; nixos = false; };
});
let
pkgs = import inputs.nixpkgs (localLib.buildNixpkgsConfig
{
inputs = { inherit (inputs.nixpkgs) lib; topInputs = inputs; };
nixpkgs = { march = "haswell"; cuda = null; nixRoot = "/data/gpfs01/jykang/.nix"; nixos = false; };
});
python-lyj =
let python = pkgs.pkgs-2411.python310.withPackages (_: [ pkgs.localPackages.pybinding ]);
in pkgs.runCommand "python-lyj" { }
''
mkdir -p $out/bin
ln -s ${python}/bin/python3 $out/bin/python-lyj
'';
in pkgs.symlinkJoin
{
name = "jykang";
paths = with pkgs; [ hello iotop gnuplot localPackages.vaspkit pv btop ];
paths = with pkgs; [ gnuplot localPackages.vaspkit pv python-lyj ];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs; };
}

View File

@@ -19,6 +19,8 @@ inputs:
"6.1"
# 2080 Ti
"7.5"
# A30
"8.0"
# 3090
"8.6"
# 4090

View File

@@ -7,7 +7,7 @@ inputs:
model.cluster.nodeType = "master";
system =
{
nixpkgs.march = "skylake";
nixpkgs.march = "icelake-server";
network =
{
static.eno2 = { ip = "192.168.178.1"; mask = 24; };

View File

@@ -0,0 +1,43 @@
inputs:
{
config =
{
nixos =
{
model.cluster.nodeType = "master";
system =
{
nixpkgs.march = "skylake";
network =
{
static.eno2 = { ip = "192.168.178.1"; mask = 24; };
masquerade = [ "eno2" ];
trust = [ "eno2" ];
};
nix.remote.slave = {};
fileSystems =
{
swap = [ "/dev/disk/by-partlabel/srv2-node2-swap" ];
mount.btrfs."/dev/disk/by-partlabel/srv2-node2-root1" =
{
"/nix/remote/jykang.xmuhpc" = "/data/gpfs01/jykang/.nix";
"/nix/remote/xmuhk" = "/public/home/xmuhk/.nix";
};
};
};
services =
{
xray.client.dnsmasq = { extraInterfaces = [ "eno1" "eno2" ]; hosts."hpc.xmu.edu.cn" = "121.192.191.11"; };
beesd."/" = { hashTableSizeMB = 16 * 128; loadAverage = 8; };
xrdp = { enable = true; hostname = [ "srv2.chn.moe" ]; };
samba = { hostsAllowed = ""; shares = { home.path = "/home"; root.path = "/"; }; };
groupshare = {};
hpcstat = {};
ollama = {};
sshd = { groupBanner = true; motd = true; };
speedtest = {};
lumericalLicenseManager.macAddress = "70:20:84:09:a3:52";
};
};
};
}

View File

@@ -0,0 +1,34 @@
xray-client:
uuid: ENC[AES256_GCM,data:j2R0UtfS/es2A+Ic+Kq6FZJSqXlA/Q8tGkuAIX0ZdTsV4hGk,iv:Ovp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g==,type:str]
wireless:
#ENC[AES256_GCM,data:n9OPSJsB7yNk,iv:xQzKJxqPB7uT83m/B4UoOje6NQbPLhuHR7Hp93oNz8A=,tag:gtsTx6ALnS/7fIDd7VimOg==,type:comment]
409的5G: ENC[AES256_GCM,data:K9wm3zedoil7jHgTcb+VmbdbkG2dgrMdr3BmDRUHDVADqLANMvnUMSecggYTO4HaiI9q6uv2/BSkluanD5K4Dw==,iv:7dGET3ULKlnaDMVmkuXDek+hQPLZ2VUbPqvEOX+5jlQ=,tag:MBGmQ0NNNqX+T9EsBiWCaw==,type:str]
sops:
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0Rmc2Ull1WFB4Smh3c0Zl
emlTNGJKZkpIK2JFeUNVeUcrR2FzRXRQZHlvCkhzMHpzYmZRZ0M0cXdRVi8wZmp6
ZDRZQ2FkOWt6M0lrdjBHa3VTWXBDKzgKLS0tIGtJbTRRelg1VVk2QStwdzlFM1g4
M1JOd1g3cVdjUFRhZ0FxcWphZXZJbkkKFXDtJVoi+qIrXp6cznevuZ+peBiRRITP
rrplqLiYsNIGKmKYtRIUu8WXDZ2q2CJ8Z+pka3W3H/U+m957hBDWyw==
-----END AGE ENCRYPTED FILE-----
- recipient: age1l4stuz0vr7gs7pqwjrmezam44702jp2vmqaqyxw0l0r42kf9updq4dfhrw
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsSHdka3FPQUYrcXQzcTFo
a000TUllT0MvUzk5ZzVFbXZheG9ZVTM2S253CkE5VW9tQktvL2pMWFoxcnFjTGpr
Z0p1RjZWRGpSZ01TdTZRcEJXM2NOUkUKLS0tIC9rNmNzWitMdEd5dXQvdWlELzhM
M0xoL1dQR0kvMWpzN0RMNWVCTFQxNFUKj9LPjBo5NGOrGYNvu8qZ13PLYjLEWllU
LARzEn4XgkeHckouwvxZYMCx7WxmAruRWaOvnxTIczzSNP7wIrqnkA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-07-12T04:13:47Z"
mac: ENC[AES256_GCM,data:W+e5d1scvV24AdVdl7Pisp9HxsXQ/tPjN2NV/Bd0RXZNBRB7LNQrSfk1GadboBnihW0ctAQOFk66PZsxwE2czfFL2/yzFxm9Cf11Mc822ZL3BwjnQBK4uR9LJrbjL7x1lFUk9v0AIPhjrir8F6dcX8mq6++hHNN0wjGaH3J9E0Y=,iv:RK7e4Dxog+Qsgk6gxK0f8PN8oF9bjWIrTyYK67Cdras=,tag:QSKsETYXbhnvhhjavP4UiA==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2

33
flake.lock generated
View File

@@ -25,12 +25,12 @@
"blog": {
"flake": false,
"locked": {
"lastModified": 1757155808,
"lastModified": 1759333393,
"lfs": true,
"narHash": "sha256-dngkmShADPQOziASLZmwXNop0R6O4PlbHYOUAXfaoxs=",
"narHash": "sha256-0ruJ4kw82hQZDLp5oIBG2Kq+SBeOUoTSMJzFofOz4Sg=",
"ref": "refs/heads/public",
"rev": "0b2cb19d9f9da2a8cab440c0053029ec93d263b7",
"revCount": 36,
"rev": "e6d2bc75a815a8ea73eea24091af10b4eb595b95",
"revCount": 37,
"type": "git",
"url": "https://git.chn.moe/chn/blog-public.git"
},
@@ -851,11 +851,11 @@
},
"nixpkgs-2311": {
"locked": {
"lastModified": 1735377590,
"narHash": "sha256-U9W9H/HYoaKa5wzSL2IBmnFDhxlesuKAcKi/hl5xPvE=",
"lastModified": 1760234929,
"narHash": "sha256-4W0o4O8ANykPCOQD2Jb6pdGerDSLNzIVNF7AoVNMZvM=",
"owner": "CHN-beta",
"repo": "nixpkgs",
"rev": "0c3e74a65634ae3f43be7d0f6c3b5156ac54747b",
"rev": "66170f3c82eecdee7dcd29a7e72ed87965bde4fc",
"type": "github"
},
"original": {
@@ -1213,6 +1213,24 @@
"type": "github"
}
},
"pybinding": {
"flake": false,
"locked": {
"lastModified": 1598796477,
"narHash": "sha256-4DtGtQ40TEaM6qSydwsj9gD3JqpaCFpcvWJISwn69Zk=",
"ref": "refs/heads/master",
"rev": "ec1128aaa84a1b43a74fb970479ce4544bd63179",
"revCount": 774,
"submodules": true,
"type": "git",
"url": "https://github.com/dean0x7d/pybinding"
},
"original": {
"submodules": true,
"type": "git",
"url": "https://github.com/dean0x7d/pybinding"
}
},
"root": {
"inputs": {
"aagl": "aagl",
@@ -1254,6 +1272,7 @@
"plasma-manager": "plasma-manager",
"pocketfft": "pocketfft",
"py4vasp": "py4vasp",
"pybinding": "pybinding",
"rsshub": "rsshub",
"rycee": "rycee",
"sops-nix": "sops-nix",

View File

@@ -64,6 +64,7 @@
phono3py = { url = "github:phonopy/phono3py"; flake = false; };
sticker = { url = "git+https://git.chn.moe/chn/sticker.git?lfs=1"; flake = false; };
speedtest = { url = "github:librespeed/speedtest"; flake = false; };
pybinding = { url = "git+https://github.com/dean0x7d/pybinding?submodules=1"; flake = false; };
};
outputs = inputs: let localLib = import ./flake/lib inputs.nixpkgs.lib; in

View File

@@ -81,7 +81,22 @@ in platformConfig //
{
pkgs-2305 = "nixpkgs-2305";
pkgs-2311 = "nixpkgs-2311";
pkgs-2411 = { source = "nixpkgs-2411"; overlays = [ inputs.topInputs.bscpkgs.overlays.default ]; };
pkgs-2411 =
{
source = "nixpkgs-2411";
overlays =
[
inputs.topInputs.bscpkgs.overlays.default
(final: prev: inputs.lib.optionalAttrs (nixpkgs.march != null)
{
pythonPackagesExtensions = prev.pythonPackagesExtensions or [] ++ [(final: prev:
{
sphinx = prev.sphinx.overridePythonAttrs (prev:
{ disabledTests = prev.disabledTests or [] ++ [ "test_xml_warnings" ]; });
})];
})
];
};
pkgs-unstable =
{
source = "nixpkgs-unstable";

View File

@@ -1,7 +1,7 @@
{ inputs, localLib }:
let
singles = [ "nas" "pc" "vps4" "vps6" "r2s" ];
cluster = { srv1 = 3; srv2 = 2; };
cluster = { srv1 = 3; srv2 = 3; };
deviceModules = builtins.listToAttrs
(
(builtins.map

View File

@@ -29,7 +29,7 @@
netboot = pkgs.fetchurl
{
url = "https://boot.netboot.xyz/ipxe/netboot.xyz.iso";
sha256 = "01hlslbi2i3jkzjwn24drhd2lriaqiwr9hb83r0nib9y1jvr3k5p";
sha256 = "6GeOcugqElGPoPXeaWVpjcV5bCFxNLShGgN/sjsVzuI=";
};
};
vasp =

View File

@@ -5,8 +5,8 @@ inputs:
type = types.nullOr (types.enum [ "intel" "amd" ]);
default = let inherit (inputs.config.nixos.system.nixpkgs) march; in
if march == null then null
else if inputs.lib.hasPrefix "znver" march then "amd"
else if (inputs.lib.hasSuffix "lake" march)
else if inputs.lib.hasInfix "znver" march then "amd"
else if (inputs.lib.hasInfix "lake" march)
|| (builtins.elem march [ "sandybridge" "silvermont" "haswell" "broadwell" ])
then "intel"
else null;

View File

@@ -20,23 +20,5 @@ inputs:
inherit inputs;
nixpkgs = nixpkgs // { nixRoot = null; nixos = true; inherit (inputs.config.nixos.model) arch; };
};
boot.kernelPatches = inputs.lib.mkIf (nixpkgs.march != null)
(
let configName =
if inputs.config.nixos.system.kernel.variant == "xanmod-unstable" then "structuredExtraConfig"
else "extraStructuredConfig";
in
[{
name = "native kernel";
patch = null;
${configName} =
let kernelConfig = { znver2 = "MZEN2"; znver3 = "MZEN3"; znver4 = "MZEN4"; znver5 = "MZEN5"; };
in
{
GENERIC_CPU = inputs.lib.kernel.no;
${kernelConfig.${nixpkgs.march} or "M${inputs.lib.toUpper nixpkgs.march}"} = inputs.lib.kernel.yes;
};
}]
);
};
}

View File

@@ -147,6 +147,11 @@ inputs: rec
atomkit = inputs.pkgs.callPackage ./atomkit.nix { src = inputs.topInputs.self.src.atomkit; };
xinli = inputs.pkgs.callPackage ./xinli
{ inherit biu; stdenv = inputs.pkgs.clang18Stdenv; inherit (inputs.pkgs.pkgs-unstable) httplib; };
pybinding = inputs.pkgs.pkgs-2411.python310Packages.callPackage ./pybinding
{
src = inputs.topInputs.pybinding;
buildProxy = inputs.pkgs.lib.mkBuildproxy ./pybinding/proxy.nix;
};
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}

View File

@@ -0,0 +1,12 @@
{ src, buildPythonPackage, setuptools, cmake, buildProxy, distutils, numpy, scipy, matplotlib, pytest }:
buildPythonPackage
{
name = "pybinding";
inherit src;
pyproject = true;
build-system = [ setuptools cmake distutils ];
dependencies = [ numpy scipy matplotlib pytest ];
dontUseCmakeConfigure = true;
preBuild = ''source ${buildProxy}'';
patches = [ ./fix.patch ];
}

View File

@@ -0,0 +1,24 @@
diff --git a/cppcore/include/numeric/arrayref.hpp b/cppcore/include/numeric/arrayref.hpp
index e1ef1ba..722ebdc 100644
--- a/cppcore/include/numeric/arrayref.hpp
+++ b/cppcore/include/numeric/arrayref.hpp
@@ -7,6 +7,7 @@
#include <numeric>
#include <stdexcept>
#include <array>
+#include <cstdint>
namespace cpb { namespace num {
diff --git a/cppmodule/deps/pybind11/include/pybind11/attr.h b/cppmodule/deps/pybind11/include/pybind11/attr.h
index 6962d6fc..f8261bc3 100644
--- a/cppmodule/deps/pybind11/include/pybind11/attr.h
+++ b/cppmodule/deps/pybind11/include/pybind11/attr.h
@@ -11,6 +11,7 @@
#pragma once
#include "cast.h"
+#include <cstdint>
NAMESPACE_BEGIN(PYBIND11_NAMESPACE)

View File

@@ -0,0 +1,130 @@
{ fetchurl }:
[
{
url = "https://gitlab.com/libeigen/eigen/-/archive/3.3.3/eigen-3.3.3.tar.gz";
file = fetchurl
{
url = "https://gitlab.com/libeigen/eigen/-/archive/3.3.3/eigen-3.3.3.tar.gz";
hash = "sha256-/XJpQ5C9joFYYgVxfSz4I+cY9YS3eaFV23R9HmhIGi4=";
};
status_code = 200;
headers =
{
"content-type" = "application/octet-stream";
"content-disposition" = "attachment; filename=eigen-3.3.3.tar.gz";
};
}
{
url = "https://raw.githubusercontent.com/mapbox/variant/v1.1.4/include/mapbox/variant.hpp";
file = fetchurl
{
url = "https://raw.githubusercontent.com/mapbox/variant/v1.1.4/include/mapbox/variant.hpp";
hash = "sha256-TsAoFQ3nrnXwS8cxg2RLiu6U7CxZGYHmIm7mHemTgSA=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "31575";
};
}
{
url = "https://raw.githubusercontent.com/mapbox/variant/v1.1.4/include/mapbox/recursive_wrapper.hpp";
file = fetchurl
{
url = "https://raw.githubusercontent.com/mapbox/variant/v1.1.4/include/mapbox/recursive_wrapper.hpp";
hash = "sha256-Su1xw27Ctf7TM8isDU8SGXiKg9rM9LvxEh8bUiaGnR0=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "2632";
};
}
{
url = "https://raw.githubusercontent.com/mapbox/variant/v1.1.4/include/mapbox/variant_visitor.hpp";
file = fetchurl
{
url = "https://raw.githubusercontent.com/mapbox/variant/v1.1.4/include/mapbox/variant_visitor.hpp";
hash = "sha256-JiPsMvUm0V8P/cXxM3BMHrCAk+cU2JGzWAoK5T2e9DI=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "743";
};
}
{
url = "https://github.com/p12tic/libsimdpp/archive//v2.0-rc2.tar.gz";
file = fetchurl
{
url = "https://github.com/p12tic/libsimdpp/archive//v2.0-rc2.tar.gz";
hash = "sha256-dLYHn29FfiMm8HGclKiB/XN4Xu71mpKGjGmTWcuXndg=";
};
status_code = 200;
headers =
{
"content-disposition" = "attachment; filename=libsimdpp-2.0-rc2.tar.gz";
"content-type" = "application/x-gzip";
"content-length" = "287439";
};
}
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/format.h";
file = fetchurl
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/format.h";
hash = "sha256-7v0pfyt2c2KDtMhot68W9nt13pN+j2OswuuKeB/ZnBs=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "119800";
};
}
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/format.cc";
file = fetchurl
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/format.cc";
hash = "sha256-cwjmLJljDJ/iQbF5dD6PHnvUSGYfx1Elfq1kebFVzE0=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "28777";
};
}
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/ostream.h";
file = fetchurl
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/ostream.h";
hash = "sha256-is8VgEdM7FovPR6X3MuRGoPfd+Gm7vtHT+3r6rZasII=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "2830";
};
}
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/ostream.cc";
file = fetchurl
{
url = "https://raw.githubusercontent.com/fmtlib/fmt/3.0.2/fmt/ostream.cc";
hash = "sha256-NKg67BJHmwd5YAIkOqjNEDjvqSspLFHN2+23W5XImSQ=";
};
status_code = 200;
headers =
{
"content-type" = "text/plain; charset=utf-8";
"content-length" = "1073";
};
}
]