Nix Flakes: Toward Portable, Reproducible and Dependency-Isolated General-Purpose Development Environments

By Yueh-Shun Li (ShamrockLee)

議題

Nix Flakes: Toward Portable, Reproducible and Dependency-Isolated General-Purpose Development Environments

TR 214 [[ new Date( '2023-07-30 05:00:00+00:00' ).toLocaleDateString('ja', {year: 'numeric', month: '2-digit', day: '2-digit'}) ]] [[ new Date( '2023-07-30 05:00:00+00:00' ).toLocaleTimeString('zh-Hant', {hour12: false, hour: '2-digit', minute:'2-digit'}) ]] ~ [[ new Date( '2023-07-30 05:30:00+00:00' ).toLocaleTimeString('zh-Hant', {hour12: false, hour: '2-digit', minute:'2-digit'}) ]] en
加入行事曆 加入關注 加入關注 已關注

How many packages have you ever installed on your system? How many patches are you maintaining to bring up your project? In which directory hides the library missing on your labmate's machine?

The HPC cluster doesn't even have Docker, and you don't have permission to install the packages needed to run the code. Is there any way other than manually compiling them and their dependency trees to make it work?

Nix Flakes to the rescue!

In this session, let's introduce a workflow that establishes the development environment, automates the building and testing, and executes arbitrary programs with the single Nix binary and the Nix Flakes configuration files.

We'll discuss the <language>2nix projects integrating Nix and Programming-language-specific dependency managers taking Python as an example. We'll also talk about dream2nix, the attempt to unify all the <language>2nix projects and a PoC of the next-generation Nixpkgs infrastructure.


還記得曾經在電腦上 apt installpip install 過多少軟體包嗎?為了這個專案,已經幫 dependencies 加上多少 patch 了?現在程式到底是用哪邊安裝的函式庫,為什麼換到伺服器、同學的電腦上就抓不到函式庫了?HPC 伺服器上連 Docker 都不能裝,怎麼辦?

這次議程介紹如何透過 Nix 執行檔以及 Nix Flakes 設定檔,不必依靠預裝程式或環境設定就能重建整個開發環境、指定要套用的 patches 、並自動化建置、測試。

另以 Python 開發環境為例,講述 Nix 與其他軟體包、專案管理器整合的現況。並介紹 dream2nix 這項作為 Nixpkgs 未來架構的試金石,試圖一統所有 <language>2nix 專案的嘗試。

講者

Yueh-Shun Li (ShamrockLee)

Yueh-Shun Li (ShamrockLee)

Greetings everyone! Shamrock here from Taiwan. I'm a graduate student studying High Energy Physics (Particle Physics) at National Central University. I'm also a six-year Linux user and two-year Nixpkgs contributor.

In our lab, I analyze the data produced by the CERN Large Hadron Collider with a C++-based statistical framework called CERN ROOT.

My contribution to Nixpkgs mainly focuses on scientific software and solutions to make Nix available for unprivileged users in Nix-less, restricted environments such as HPC clusters. Aside from that, I get my hands on everything I encounter and contribute whenever it builds and runs.

GitHub: ShamrockLee

Student Adventure Time 學生社群大亂鬥 YGERZZ general (30mins)