3 Commits
1 ... main

Author SHA1 Message Date
chn
65e17d3450 add readme 2025-08-09 16:16:54 +08:00
chn
e495a1ae52 2025-08-09 14:11:30 +08:00
chn
133be5465d 2025-08-08 11:13:45 +08:00
4 changed files with 36 additions and 6 deletions

12
README.md Normal file
View File

@@ -0,0 +1,12 @@
This is my slide on NixOS CN Meetup #1.
Title: 在科学计算中使用Nix实战经验与挑战
Download in [Release](https://git.chn.moe/chn/nixos-cn-meetup-presentation/releases).
Build it using Nix, reproducively:
```nix
nix build git+https://git.chn.moe/chn/nixos-cn-meetup-presentation
```

BIN
atom.png LFS Normal file

Binary file not shown.

View File

@@ -9,7 +9,7 @@
{
packages.x86_64-linux.default = pkgs.runCommand "presentation"
{
nativeBuildInputs = [(pkgs.typst.withPackages (ps: with ps; [ minimal-presentation ]))];
nativeBuildInputs = [(pkgs.typst.withPackages (ps: with ps; [ minimal-presentation xarrow ]))];
src = ./.;
env.TYPST_FONT_PATHS = builtins.concatStringsSep ":" (builtins.map (p: "${p}/share/fonts")
(with pkgs; [ corefonts source-han-serif nerd-fonts.fira-code ]));

View File

@@ -1,4 +1,5 @@
#import "@preview/minimal-presentation:0.6.0": *
#import "@preview/xarrow:0.3.1": xarrow
// 中文使用思源宋体,英文使用 Times New Roman
#set text(font: ("Times New Roman", "Source Han Serif SC"))
@@ -41,8 +42,8 @@
== 使用过的发行版
- 桌面2018年起主力使用LinuxDeepin #sym.arrow Arch #sym.arrow Gentoo #sym.arrow NixOS (2023-05-28)
- 服务器主要是VPSOpenWRT #sym.arrow Ubuntu #sym.arrow Arch #sym.arrow Gentoo #sym.arrow NixOS
// - xmurp-ua 是我写的,用来绕过一些大学中,宿舍不许多设备共享网络的限制。
- 个人服务器OpenWRT #sym.arrow Ubuntu #sym.arrow Arch #sym.arrow Gentoo #sym.arrow NixOS
- 著名作品xmurp-ua
- 科学计算2020年硕士入组Gentoo + Ubuntu #sym.arrow NixOS (2023-09)
== 科研方向
@@ -51,6 +52,19 @@
- 个人:第一性原理计算,兼职管理服务器。
- *第一性原理*计算:仅依赖最基础的物理原理(量子力学),原则上不引入经验值。
#columns-content[
#figure(image("atom.png", width: 70%))
][
#show math.equation: set text(size: 40pt)
#xarrow(sym: sym.arrow, [$hat(H)phi = hat(E)phi$])
][
稳定结构?
电学/热学/光学性质?
缺陷/杂质?
]
= 科学计算在实践中面临的困难
== 科学计算特点
@@ -150,7 +164,7 @@ Nix 的优势:将 *编译/配置过程* 抽象成 *可复现、可版本管理
- 使用可读写的 store 目录。编译机上建立相同的目录,编译好再上传。
- 不能设置 `real` 参数指向 `/nix/store`,否则会破坏编译机的 Nix 数据库。
```
```sh
# this will break the build machine's nix database
sudo nix build --store 'local?store=/data/gpfs01/jykang/.nix/store&real=/nix/store' .#jykang
# this is safe
@@ -183,9 +197,10 @@ sudo nix build --store 'local?store=/data/gpfs01/jykang/.nix/store&state=/data/g
=== 一个例子(曾经的 NVIDIA HPC SDK 打包)
```
```nix
let
builder = buildFHSEnv { targetPkgs = _: []; extraBwrapArgs = [ "--bind" "$out" "$out" ]; };
builder = buildFHSEnv
{ extraBwrapArgs = [ "--bind" "$out" "$out" ]; };
buildScript = writeShellScript "build.sh" ''xxxxx'';
in stdenvNoCC.mkDerivation
{