Files
nixos-cn-meetup-presentation/main.typ
2025-08-04 19:20:07 +08:00

73 lines
2.1 KiB
Typst
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#import "@preview/minimal-presentation:0.6.0": *
// 中文使用思源宋体,英文使用 Times New Roman
#set text(font: ("Times New Roman", "Source Han Serif SC"))
#show raw: set text(font: "Fira Code")
#show: project.with(
title: "在科学计算中使用Nix",
sub-title: "非CS专业人士的使用经验与困难",
author: "陈浩南",
date: "2025-08-09",
index-title: "目录",
logo: image("./nix-snowflake-colours.svg"),
logo-light: image("./nix-snowflake-white.svg"),
cover: image("./DSC_0210.JPG"),
main-color: rgb("#3e5c98"),
lang: "zh",
)
= 背景介绍
== 个人Linux使用经验
- 桌面2018年起主力使用LinuxDeepin #sym.arrow Arch #sym.arrow Gentoo #sym.arrow NixOS (2023-05-28)
- 服务器VPS差不多时间OpenWRT #sym.arrow Ubuntu #sym.arrow Arch #sym.arrow Gentoo #sym.arrow NixOS
- 科学计算HPC2020年硕士入组开始接触Gentoo + Ubuntu #sym.arrow NixOS (2023-09)
== 科学计算现状
#columns-content(colwidths: (1fr, 1.8fr))[
#figure(
image("meme.jpg", width: 100%)
)
- *复古*的包管理手动修改Makefile指定编译器/参数/库路径。
- *随意*的编程无视标准、能用就行C/C++不分Fortran/MPI只有特定编译器能编译。
- *闭源*的编译器Intel OneAPI / NVIDIA HPC SDK。
- *混乱*的用户权限:超算共用账户,小组随意`sudo make install`
]
== 我们需要更多的可复现!
#figure(
image("更多的.png", width: 120%)
)
= 切换到Nix/NixOS后解决的问题
== 切换到Nix/NixOS后解决的问题
- 方便打补丁、魔改软件,无需研究具体软件的编译流程:
```
xxx = prev.xxx.overrideAttrs (prev: patches = prev.patches or [] ++ [ ./my.patch ])
```
- 编译/运行环境可复现:
- “你遇到的问题网上肯定也有人遇到过。Gentoo除外。”
- 再也不会忘记自己去年配置的服务是怎么配置的了。
- 跨服务/跨机器共享配置
// TODO举个例子
// TODO: highlight code
= 尚待解决的问题
== 尚待解决的问题
- 闭源编译器和 stdenv
- 无root权限安装nix
- FHSStdenv
- impermanence /home-manager 与共享文件系统