Compare commits

...

30 Commits

Author SHA1 Message Date
chn
3895c35f5e packages.ufo: 编写例子的前两步 2024-09-04 15:14:33 +08:00
chn
1c4a3eea53 packages.ufo: add a test 2024-09-03 15:10:46 +08:00
chn
d67b60ded3 blog: 整理 2024-09-03 12:13:37 +08:00
chn
2d7974e256 packages.server: add compsize wrapper 2024-09-03 10:41:10 +08:00
chn
840f4a2c76 services.rsshub: add bilibili cookie 2024-09-03 07:57:36 +08:00
chn
e01eac40bd update rsshub 2024-09-03 07:16:13 +08:00
chn
09f2c713a0 fix build 2024-09-03 00:50:17 +08:00
chn
fe6ebb5e27 blog: 一些整理 2024-09-03 00:48:16 +08:00
chn
c75ec60995 modules.user: persistent subuidgid config 2024-09-02 23:14:25 +08:00
chn
e87911fef0 blog: correct emoji 2024-09-02 22:39:24 +08:00
chn
7367cae759 Revert "packages.firefox: add default-pwa profile"
This reverts commit 6fc2c61ca1.
2024-09-02 21:47:26 +08:00
chn
6fc2c61ca1 packages.firefox: add default-pwa profile 2024-09-02 21:14:56 +08:00
chn
57cdcaada2 services.postgresql: lower buffer 2024-09-02 13:20:12 +08:00
chn
651b1870af user.chn: use zsh 2024-09-02 13:18:50 +08:00
chn
e44d0f192a add note 2024-09-02 13:12:45 +08:00
chn
8180bb4792 packages.desktop: auto add wallpaper 2024-09-02 12:34:50 +08:00
chn
5d7dcd28de devices.vps7: change ip 2024-09-02 12:04:51 +08:00
chn
5e9b1fd039 devices.vps7: shrink disk size 2024-09-02 11:12:57 +08:00
chn
3350ee8680 services.rsshub: add restartTriggers 2024-09-02 01:11:10 +08:00
chn
bb598f6fa4 users.chn: add sops 2024-09-02 01:03:44 +08:00
chn
66cf4fedf5 services.vps7: add twitter auth token 2024-09-01 23:03:07 +08:00
chn
dab7902309 services.slurm: auto resume node after drain 2024-09-01 17:36:18 +08:00
chn
c5a3789e16 users.chn.konsole: fix 2024-09-01 17:25:51 +08:00
chn
16983ecbfb packages.firefox: move firefox configuration to global 2024-09-01 17:23:17 +08:00
chn
d2b5f8dda8 packages.firefox: enable pwa 2024-09-01 16:42:37 +08:00
chn
4e823d30b9 users.zzn: fix ssh key 2024-09-01 10:06:23 +08:00
chn
e38a8c277d devices.xmupc1: add zzn 2024-09-01 00:00:00 +08:00
chn
0e1aef2bf0 devices.xmupc1: add doc 2024-08-31 23:57:15 +08:00
chn
0058d1902d users: add zzn 2024-08-31 23:57:03 +08:00
chn
313fd7b9dc packages.nushell: add bin to PATH 2024-08-31 00:53:01 +08:00
45 changed files with 543 additions and 154 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ outputs
build
.vscode
.cache
.ccls-cache

View File

@@ -1,6 +1,19 @@
---
title: Introduction
type: docs
---
这里是主页
嗨,我的朋友,欢迎你!我想我会喜欢你的(如果我们之前没有仇的话)。
左侧是这个网站的目录,你可以看到这个网站上有哪些文章。
点进某一篇文章后,右侧会出现当前文章的目录。
上方还有搜索框和一些外部网站的链接。
本站的主要内容被分为“文档”和“博客”两个部分。
文档部分是一些比较系统化的内容,比如某些教程,
会随着时间的推移而更新,并会翻译成英语(如果我觉得有必要的话)。
博客部分是一些随手写的东西,大概写好之后就再也不会更新,其中的技术性内容也不保证完全正确,
往往充满了我自己的主观猜测。
{{< callout emoji="​🏗️" >}}
早期施工中,请戴好安全帽小心前行,谨防突然出现的 404。
{{< /callout >}}

19
blog/content/about.md Normal file
View File

@@ -0,0 +1,19 @@
---
title: 关于本站
---
嗨,我的朋友,欢迎你!我想我会喜欢你的(如果我们之前没有仇的话)。
左侧是这个网站的目录,你可以看到这个网站上有哪些文章。
点进某一篇文章后,右侧会出现当前文章的目录。
上方还有搜索框和一些外部网站的链接。
本站的主要内容被分为“文档”和“博客”两个部分。
文档部分是一些比较系统化的内容,比如某些教程,
会随着时间的推移而更新,并会翻译成英语(如果我觉得有必要的话)。
博客部分是一些随手写的东西,大概写好之后就再也不会更新,其中的技术性内容也不保证完全正确,
往往充满了我自己的主观猜测。
{{< callout emoji="​🏗️" >}}
早期施工中,请戴好安全帽小心前行,谨防突然出现的 404。
{{< /callout >}}

View File

@@ -4,4 +4,4 @@ bookFlatSection: true
title: "Example Site"
---
{{< callout emoji=":building_construction:" >}} 施工中 {{< /callout >}}
{{< callout emoji="🏗️" >}} 施工中 {{< /callout >}}

6
blog/data/icons.yaml Normal file
View File

@@ -0,0 +1,6 @@
misskey: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 1 24 22"><path fill="currentColor" d="M8.91 16.892c-1.039.003-1.931-.63-2.352-1.366c-.225-.322-.67-.437-.676 0v2.014q0 1.215-.876 2.1q-.85.86-2.078.86q-1.2 0-2.077-.86A2.93 2.93 0 0 1 0 17.54V6.46q0-.936.526-1.695a2.86 2.86 0 0 1 1.402-1.088a2.9 2.9 0 0 1 1-.177q1.353 0 2.253 1.063l2.997 3.515c.067.05.263.437.732.437c.47 0 .692-.386.758-.437l2.972-3.515Q13.567 3.5 14.918 3.5q.501 0 1.001.177a2.73 2.73 0 0 1 1.377 1.088q.55.758.55 1.695v11.08q0 1.215-.875 2.1q-.852.86-2.078.86q-1.201 0-2.078-.86a2.93 2.93 0 0 1-.85-2.1v-2.014c-.05-.55-.531-.204-.702 0c-.45.843-1.313 1.361-2.352 1.366M21.448 8.61q-1.05 0-1.802-.733q-.726-.759-.726-1.822c0-1.063.242-1.307.726-1.796a2.44 2.44 0 0 1 1.802-.758q1.05 0 1.803.758q.75.735.75 1.796q0 1.063-.75 1.822q-.751.732-1.803.733m.025.507q1.05 0 1.777.758q.75.759.751 1.822v6.248q0 1.064-.75 1.821a2.4 2.4 0 0 1-1.778.734q-1.05 0-1.802-.733a2.5 2.5 0 0 1-.75-1.822v-6.248a2.5 2.5 0 0 1 .75-1.822a2.44 2.44 0 0 1 1.802-.758"/></svg>
fediverse: <svg xmlns="http://www.w3.org/2000/svg" viewBox="20 20 216 216"><g fill="none"><path fill="#a730b8" d="M61.39 100.77a22.47 22.47 0 0 1-9.605 9.569l52.727 52.981l12.712-6.448zm69.548 69.882l-12.712 6.448l26.717 26.846a22.47 22.47 0 0 1 9.606-9.57z"/><path fill="#5496be" d="m191.943 121.734l-29.851 15.142l2.201 14.091l33.775-17.133a22.5 22.5 0 0 1-6.125-12.1m-47.18 23.932l-70.579 35.802a22.5 22.5 0 0 1 6.127 12.101l66.653-33.812z"/><path fill="#ce3d1a" d="m122.066 57.476l-34.057 66.548l10.055 10.103l36.059-70.459a22.45 22.45 0 0 1-12.057-6.192m-42.915 83.856l-17.25 33.708c4.56.772 8.77 2.934 12.056 6.192l15.249-29.797z"/><path fill="#d0188f" d="M51.492 110.487a22.44 22.44 0 0 1-11.218 2.347a23 23 0 0 1-2.168-.226l10.073 64.489a22.44 22.44 0 0 1 11.218-2.347q1.09.06 2.167.227z"/><path fill="#5b36e9" d="M80.364 193.888c.23 1.498.31 3.014.235 4.528a22.5 22.5 0 0 1-2.369 8.867l64.42 10.347a22.5 22.5 0 0 1-.236-4.528a22.5 22.5 0 0 1 2.37-8.867z"/><path fill="#30b873" d="m198.294 134.069l-29.733 58.102a22.45 22.45 0 0 1 12.058 6.193l29.734-58.101a22.45 22.45 0 0 1-12.059-6.194"/><path fill="#ebe305" d="M157.741 51.894a22.47 22.47 0 0 1-9.606 9.57l46.047 46.267a22.47 22.47 0 0 1 9.606-9.57z"/><path fill="#f47601" d="m115.713 45.14l-58.21 29.527a22.5 22.5 0 0 1 6.127 12.1l58.208-29.528a22.5 22.5 0 0 1-6.125-12.098"/><path fill="#57c115" d="M148.029 61.518a22.44 22.44 0 0 1-11.403 2.44a22 22 0 0 1-1.966-.206l5.157 33.048l14.069 2.26zm-5.216 54.494l12.191 78.134a22.45 22.45 0 0 1 11.055-2.265a23 23 0 0 1 2.349.258l-11.525-73.868z"/><path fill="#dbb210" d="M63.671 87.014a22.5 22.5 0 0 1 .247 4.6a22.5 22.5 0 0 1-2.334 8.803l33.043 5.312l6.494-12.695zm56.632 9.103l-6.495 12.696l78.072 12.55c-.224-1.481-.3-2.98-.226-4.476a22.5 22.5 0 0 1 2.395-8.915z"/><path fill="#ffca00" fill-opacity="0.996" d="M136.737 61.918c11.258.614 20.881-8.023 21.495-19.292c.613-11.268-8.016-20.9-19.275-21.515c-11.258-.613-20.881 8.024-21.495 19.292c-.613 11.269 8.017 20.901 19.275 21.515"/><path fill="#64ff00" fill-opacity="0.996" d="M212.966 138.513c11.259.614 20.882-8.023 21.495-19.292c.614-11.268-8.016-20.9-19.274-21.514s-20.882 8.023-21.495 19.292c-.613 11.268 8.016 20.901 19.274 21.514"/><path fill="#00a3ff" fill-opacity="0.996" d="M163.727 234.728c11.258.614 20.882-8.024 21.495-19.292s-8.016-20.901-19.274-21.515s-20.882 8.024-21.495 19.292c-.614 11.269 8.016 20.901 19.274 21.515"/><path fill="#9500ff" fill-opacity="0.996" d="M57.066 217.597c11.258.613 20.881-8.024 21.495-19.292c.613-11.269-8.017-20.901-19.275-21.515s-20.882 8.023-21.495 19.292c-.613 11.268 8.016 20.901 19.275 21.515"/><path fill="#f00" fill-opacity="0.996" d="M40.385 110.794c11.258.614 20.881-8.023 21.495-19.292c.613-11.268-8.017-20.9-19.275-21.514S21.724 78.01 21.11 89.28c-.613 11.268 8.017 20.901 19.275 21.514"/></g></svg>
matrix: <svg xmlns="http://www.w3.org/2000/svg" viewBox="30 20 196 216"><path fill="currentColor" d="M72 216a8 8 0 0 1-8 8H40a8 8 0 0 1-8-8V40a8 8 0 0 1 8-8h24a8 8 0 0 1 0 16H48v160h16a8 8 0 0 1 8 8M216 32h-24a8 8 0 0 0 0 16h16v160h-16a8 8 0 0 0 0 16h24a8 8 0 0 0 8-8V40a8 8 0 0 0-8-8m-32 88a32 32 0 0 0-56-21.13a31.93 31.93 0 0 0-40.71-6.15A8 8 0 0 0 72 96v64a8 8 0 0 0 16 0v-40a16 16 0 0 1 32 0v40a8 8 0 0 0 16 0v-40a16 16 0 0 1 32 0v40a8 8 0 0 0 16 0Z"/></svg>
wechat: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M15.85 8.14c.39 0 .77.03 1.14.08C16.31 5.25 13.19 3 9.44 3c-4.25 0-7.7 2.88-7.7 6.43c0 2.05 1.15 3.86 2.94 5.04L3.67 16.5l2.76-1.19c.59.21 1.21.38 1.87.47c-.09-.39-.14-.79-.14-1.21c-.01-3.54 3.44-6.43 7.69-6.43M12 5.89a.96.96 0 1 1 0 1.92a.96.96 0 0 1 0-1.92M6.87 7.82a.96.96 0 1 1 0-1.92a.96.96 0 0 1 0 1.92"/><path fill="currentColor" d="M22.26 14.57c0-2.84-2.87-5.14-6.41-5.14s-6.41 2.3-6.41 5.14s2.87 5.14 6.41 5.14c.58 0 1.14-.08 1.67-.2L20.98 21l-1.2-2.4c1.5-.94 2.48-2.38 2.48-4.03m-8.34-.32a.96.96 0 1 1 .96-.96c.01.53-.43.96-.96.96m3.85 0a.96.96 0 1 1 0-1.92a.96.96 0 0 1 0 1.92"/></svg>
qq: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M12 2a6.285 6.285 0 0 0-6.276 5.937l-.146 2.63a28 28 0 0 0-.615 1.41c-1.24 3.073-1.728 5.773-1.088 6.032c.335.135.913-.426 1.566-1.432a6.67 6.67 0 0 0 1.968 3.593c-1.027.35-1.91.828-1.91 1.33c0 .509 2.48.503 4.239.5h.001c.549-.002 1.01-.008 1.38-.057a6.7 6.7 0 0 0 1.76 0c.37.05.833.055 1.382.056c1.76.004 4.239.01 4.239-.499c0-.502-.883-.979-1.909-1.33a6.67 6.67 0 0 0 1.967-3.586c.65 1.002 1.227 1.56 1.56 1.425c.64-.259.154-2.96-1.088-6.032a28 28 0 0 0-.607-1.395l-.147-2.645A6.285 6.285 0 0 0 12 2"/></g></svg>
gitea: <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="currentColor" fill-rule="evenodd" d="M15.46 3.206s.14-.003.245.102l.01.01c.064.06.258.244.285 1.074c0 2.902-1.405 5.882-1.405 5.882a9 9 0 0 1-.359.713c-.458.802-.786 1.153-.786 1.153s-.318.379-.675.595c-.415.265-.72.263-.72.263L7.247 13c-.636-.079-1.29-.736-1.927-1.578c-.47-.677-.779-1.413-.779-1.413s-2.51.034-3.675-1.394C.235 7.895.103 7.067.06 6.769q0-.012-.004-.029c-.05-.324-.285-1.873.821-2.86c.517-.496 1.148-.638 1.37-.684c.371-.081.667-.06.903-.044l.09.006c.391.035 3.99.216 3.99.216s1.532.066 2.27.056c0 0 .003 1.853.003 2.78q.105.048.211.1l.212.1V3.427q.494-.005.996-.017h.011c1.545-.036 4.528-.204 4.528-.204ZM2.113 8.026s.28.26.94.477c.43.152 1.094.231 1.094.231S3.699 7.5 3.516 6.757c-.22-.886-.4-2.398-.4-2.398s-.438-.015-.789.079c-.766.19-.98.763-.98.763s-.384.688.036 1.813c.244.672.73 1.013.73 1.013Zm8.084 3.607c.344-.023.499-.392.499-.392s1.24-2.486 1.4-2.878a.7.7 0 0 0 .046-.438c-.07-.267-.39-.412-.39-.412l-1.926-.935l-.165.339l-.18.369a.46.46 0 0 1 .128.341s.433.186.743.387c0 0 .257.135.32.425c.075.273-.04.488-.066.539l-.002.003s-.216.51-.343.774l-.004.007q-.07.144-.139.28a.454.454 0 1 1-.32-.15s.41-.84.468-1.033c0 0 .096-.24.048-.38a.47.47 0 0 0-.19-.188a6 6 0 0 0-.678-.34s-.076.068-.18.09a.5.5 0 0 1-.158.014l-.611 1.25a.46.46 0 0 1 .046.587a.46.46 0 0 1-.578.138a.46.46 0 0 1-.232-.51a.46.46 0 0 1 .44-.35L8.8 7.886a.457.457 0 0 1 .361-.744l.185-.375l.167-.341l-.579-.281s-.251-.125-.458-.072a.6.6 0 0 0-.114.039c-.189.084-.31.33-.31.33L6.668 9.293s-.124.254-.068.46c.048.252.325.397.325.397l2.874 1.4l.135.054s.114.04.262.03Z" clip-rule="evenodd"/></svg>

View File

@@ -40,41 +40,29 @@ enableInlineShortcodes: true
menu:
main:
- identifier: documentation
name: Documentation
pageRef: /docs
weight: 1
- identifier: blog
name: Blog
pageRef: /blog
weight: 2
- identifier: about
name: About
pageRef: /about
weight: 3
- name: Search
weight: 4
weight: 1
params:
type: search
- name: GitHub
weight: 5
url: "https://github.com/imfing/hextra"
params:
icon: github
sidebar:
- identifier: more
name: More
params:
type: separator
weight: 1
- identifier: about
name: "About"
pageRef: "/about"
- identifier: welcome
name: 欢迎页
pageRef: /
weight: 2
- identifier: hugoDocs
name: "Hugo Docs ↗"
url: "https://gohugo.io/documentation/"
- identifier: about
name: 关于本站
pageRef: /about
weight: 3
- identifier: contact
name: 联系我
pageRef: /contact
weight: 4
params:
description: Modern, responsive, batteries-included Hugo theme for creating beautiful static websites.

View File

@@ -22,6 +22,7 @@ nix:
remote: ENC[AES256_GCM,data:uosYkxTCB0wiY+Uufk//OcBZFN3EzbZoQGZ95M9eZMjQ5AobAZqosi4laE+EMcZL1CqYqlWXaSoEUOB8biUaZPseo+1AX1TlmUgZ7QpkfOX0VKZu01C6C+lVyqVqMFq6z1BFyX/oeITMIfnd4a/2KwJCHLAZ4hMkJ5p+aJwByKGa3N/2m41HH/1S3z7pYQWj7YJxunTPPG6WNSiRncQki11rvmddwnXmsBF89+jW1Phge8U295haC57T5oIGPxR645IeTK4ZUlL8eVuZ+BhsnwbkYcaxvjSwe+DOIVPupR8GW+gis7KxwE89kqvnQhinamexcPUz4lGHlqO/Xn6jrJx6T/wXF+19epAzeHapYte3dTWNsdPwPLPJihT16YT5fwrLnH3zq8kexWz1crmnCGUoaBs4S2tHWHLgv2lTv0IHLx5F6ijpDBj/Avg9YILIURzdeea+rBxdycHasUDTVlJtYKRH5J+WbAKWI+oJ5qmXjIRUYL+O9xIUfOGO+1b3xs8MYxRWuvDV2P88N8vN,iv:yQQp5wjbSVn1oia5yL7d6GF9Vo704G0iOQRGMbzQHzg=,tag:bpBag5y5n+7ojOa8QOcDvA==,type:str]
github:
token: ENC[AES256_GCM,data:59z1zSofzUyv2Qfn8oS7dZplzJDtOD/zxhPm07MLbVLHt8mE57IGcw==,iv:nZ4JmIE1h496RN6BChvqo7XWHjur76jP4HMgqGBbMJQ=,tag:pUSGsofG7hvkvJxCRwkg1Q==,type:str]
age: ENC[AES256_GCM,data:EPjip4/tz50e+blPko9NpzDamLRO6BVy64kDnGAhUJJ/bMw6V9Of8RzuiqUupIjEmFiUcgWf9ZsV5RZO3Ai9udq0W7mYS1Y/zn4=,iv:TBs/o6mp8t+S3Ma5/QhnLhzgl852HB3sEzKy9SvKJjU=,tag:2yMUVWPua2g0VOkaXpJzKQ==,type:str]
sops:
kms: []
gcp_kms: []
@@ -46,8 +47,8 @@ sops:
OUlxNjdQaXdXMkZ6bnV1ek4yZ2dpbkEKpKGOAxo5Eef2jtGrg4iSzmGCeg+vTgvu
+K8b+O19MIkGMDBm6UbYUPtc/7eqoEZRiTUzNMTmfkLVS4ul5zou9A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-24T03:34:07Z"
mac: ENC[AES256_GCM,data:+nJ/wuO5G6pEsCiBNEHOYrbiYyGXXIHu3ZUgEVwqLQ10W94EOGLUto61IGtkapk4xmaHYAVmUlq76g2hRGrndLVlUthGnEc5QoQKZoUmrxK7ux1R2ubv0s1k+l2HpRerr/I8X+hHyV0fdxT6ivkpq6OsEzHDnxgewDvYNZGQS4k=,iv:TuzO1Yo0MPms5RrG8+GbwSCOILp9BF7Jsv5JvcAPwFw=,tag:fUNc+ccQDE/jcMLuQ4thCQ==,type:str]
lastmodified: "2024-09-01T15:21:26Z"
mac: ENC[AES256_GCM,data:eigkz85LgrpqqKTw5obgc14e9jtnmZJnjkD1iTOdXkluaqQyHC8qO2mgOfzKTM3dqusDA/hij+DR8nQbFzsBCFtvVdwb9chCqZLGo/fiJKvN8xt7Ccev8K5gS9nDnVmA7aUDgu1YWjZd3f/JpILlp2rsc5cozfcEAJoGFoSeWh0=,iv:FdzSdD6K8/6X39KcpcX+FEjkoiDWp7K4LWIN2ZdqXGM=,tag:vN1VD238pLcFm4s8KJsakA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
version: 3.9.0

View File

@@ -4,6 +4,7 @@ wireguard:
privateKey: ENC[AES256_GCM,data:P/tyZHaEAahZUBF22dJEZb6mACm/wmUunPDG0vS7SNW3sWbzxRSut0haR/g=,iv:8VMv5iotmDrYDLiszcOvJHkD8l6uE+SboPSILr6KuzU=,tag:U/FIBhvghwDTvFtUWEqr4g==,type:str]
github:
token: ENC[AES256_GCM,data:SyqrpFfy+y7syReWs0Bi23651ew41Us8aqjImBTzkDanOtWQgIYC6g==,iv:H3Y/TuP3VvZv6MlRAdLOY0CiNUeoqGZRNg0s58ZSkQ8=,tag:rSf4E8Whvue/LZ+VlSqDDQ==,type:str]
age: ENC[AES256_GCM,data:KEaMrk9eldR6oCqNqSpwhbJKj+JrN1KBkDL5p9itaszGf4tnDRidcleCQi1Ae17osYXIEh4+OxX/d6RKb9TP6JMLJe0iq6c9sC8=,iv:ztiP2Vz4AFZkd8ZG7xYlqYrV3JZYvmX07Ez6GtJ6yp0=,tag:PS8oSkkrrpgYYVfjbTtkaQ==,type:str]
sops:
kms: []
gcp_kms: []
@@ -28,8 +29,8 @@ sops:
a2xybTRFUFZZN20zajZJTVNwVEpGcEEKglmFMk7z1q5IlZ+lZf9M0HtknmvcYt/P
2/z5e8wLN1Hy0Zsbv0yIL/NmqwxAOGJOdzz7ElJszk/Y4kUr9aRasg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-24T03:36:38Z"
mac: ENC[AES256_GCM,data:Dv6WO5K0GFVm4Rt+GjXeE1vwqlPkP+kmRCGU41rbSR3YBcL8mkpBRQQXJiMU99cQQMK/rCGy+k91fhGnG5xFT/FdEZF8qUjRHPZ5MdWCjPOuY/LrXWnSnwwJa2neQLFH/ToUkNaGHCk/FngnZ/e0U43Rnwt3iHRDBG3io8oDY0M=,iv:Jf5EtkTuf/MFDq6UiOo8/31ev5zBiaP9WnlgsUgK5Y4=,tag:r6ql+UbXbG5A1vtbsGXnJQ==,type:str]
lastmodified: "2024-09-01T15:22:09Z"
mac: ENC[AES256_GCM,data:Br2+miNeZI41QyTXdhJ5Mdwq5no/d4kJgESwiltcRZV/Pax8R+GFeLDg/AQFoh1fLHU6bTX45SN0wnIrIeCnkoXV0U2RiT7bdtBaDrGxqnFvjMVE0VaUrj9bpagta13tahsEfI17cyUq4BqwS4BXx60RXvbvs9jZ5/dfpYunGsc=,iv:FfWYfS40XcFgF8lEYK4IHypLzz7svFxPL+WuudQm3oA=,tag:0KDBdf7w6BdcQ8Qt3k1isg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
version: 3.9.0

View File

@@ -45,7 +45,7 @@ inputs:
matrix = { port = 8009; redisPort = 6380; slidingSyncPort = 9001; };
};
vaultwarden.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 1024; loadAverage = 4; };
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
photoprism.enable = true;
nextcloud = {};
freshrss.enable = true;
@@ -63,7 +63,7 @@ inputs:
peers = [ "vps6" ];
publicKey = "n056ppNxC9oECcW7wEbALnw8GeW7nrMImtexKWYVUBk=";
wireguardIp = "192.168.83.2";
listenIp = "95.111.228.40";
listenIp = "144.126.144.62";
};
vikunja.enable = true;
chatgpt = {};

View File

@@ -35,6 +35,8 @@ rsshub:
youtube-client-id: ENC[AES256_GCM,data:dPo4+HsfXHdxrgF9F0qJmOGcSHDCn2KIkHx3ZYZU94iv8ImiPI9dTRfoz0zq8UIN7rwIKidQu9GxCRrg9aXk34pc35SXzEh8JQ==,iv:ROVHb0QjVsNae9eJevG6qc5dc4gkrGt+Y7S2QYrzmQ4=,tag:Advoh75OKPC7CnIeL4GFbA==,type:str]
youtube-client-secret: ENC[AES256_GCM,data:c/ALpo/4qJdccMgYiSLg9ZgG7ddaMYxHwJYZ/ogJN2ED21k=,iv:CkrIq+Vpuq28CsRNwdKRLnBq6L8NF37y4xhhnmHQHqQ=,tag:SKtHpm/QZWnGViDtSKlUUQ==,type:str]
youtube-refresh-token: ENC[AES256_GCM,data:pnXQ1euCdix2H7IxudmUUcpxc2OUhciKT8OcGV89c/EpoXHgx1+eLxwY5rRszroWwjge9M001RGHngvD/ny3phfWAwYmIzMJxun2f7JCPe7ybMesWmPSkiqVBss1Zfic1uB8mNM/yw==,iv:8p8/vATY8F3YuGA1TtjekiuaKOMnQyTMjrwDBJaK4VU=,tag:/jVg9FDOuLMNrupgrywpBQ==,type:str]
twitter-auth-token: ENC[AES256_GCM,data:65SbHggbYtfSfaaxJxRgD6+HpOX4vIfjnVZmOAZ9illPMYOu9MIchQ==,iv:49UuC8n6AGj1skuHzQX39Q/QuKlB9IxogIfiiy1GBnw=,tag:Rq6b0H9UFVZ19tU8ZeelRg==,type:str]
bilibili-cookie: ENC[AES256_GCM,data:58nO7ADu2oH/OgLJNYrEEzhf1J0zt8EpuygnSANkGXJju5oSmtM7WLnaMEjC96q14OTTA9QLiFVsbxiFY1eUnraA5W7g7+6CYRXVRZaxz91D/dhKzHGTMjB/LynnNqEIc6liONlcHbyjZNQ+WIqPtjVpCKMN7Mi8cv81/cFX/1GqAwncgDD2oXh1hMPOVY4dYcGKuOG0GjlY6RgOgTPqU3HawQjnoWQjPF+lq2rnWD5HP9ZTxOYa7hm2GgPrxkq1fkRrq+kKYeDh+6M7VLDcm5Fpf+biq6F8fZWzmw4NlVZT9BG0vJFa,iv:vxYXg9Yg9qIWFQXtwTYa4Ds0KSxZYg3M6xdtXKbdaig=,tag:TzCPehk9w+BL4wwgDc1CPg==,type:str]
mail:
bot-encoded: ENC[AES256_GCM,data:HstqDfhKoLqDip9O+mwYGbNlNQ==,iv:CZSTfxJHhI6nG7501cQdJiZ9l3uKS7d5YsA8iVTUuoE=,tag:Rj3rvXJzDp8XzODV/gABog==,type:str]
bot: ENC[AES256_GCM,data:j4Y5oYeVt0sd2z2Qwuqisw==,iv:wasQCTqEMAyttbn1zm9oKck6QiByom+F7ZIMDUse9Gc=,tag:92O4ka6f0I9qnlnVy2dltA==,type:str]
@@ -144,8 +146,8 @@ sops:
SnFHS1Z0SXUzTFdEd29KTy9DU3Y3R0UKfhh+rUmWDrf+UGjclP57dHipPLFoXSqy
HdelmfV6q4/c7ppx2E+oZw3VNgoZCsrxxzYZfwxHJiZb+5vkE0D8iA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-20T15:48:48Z"
mac: ENC[AES256_GCM,data:buEby7ZmmEFARmRp3r7JwYdMck87u4c3TGkeF2pkc5ORnqIgwSH1XVSjlbK8vTBWz2FKXeQh9wkX3BMaam9dU873/yPBe54BnbZNggZ7jDDEpSTeddfTsM8mrka0xDO3CUHbwCsqYWFm4NLAbCfRPKhrjvSJVyEC85K3eO45Z6M=,iv:/7cOdSi6oiaaFRkSnR+1/XXapjlQdMgom31xrpIGXHk=,tag:XW4WX93bw45zPweblW4Dtg==,type:str]
lastmodified: "2024-09-02T23:57:33Z"
mac: ENC[AES256_GCM,data:Tp7uSF3G1WALzv7jPSXGyIJbwYLHz4sF73NUoAI6KPboLs3juhDiZjJfkBkIIv4BawWNTvvAQfBL6hbpPbn3bLpkTvU8TiHyP9yiY5kJkid37I2s8KOHHaxKSu4CXlkAeXdZX0I1iujAOsKYUd2GnN19V07K0qwCtZOVvZXvjsk=,iv:fcsE7qXrcoaRdTv0C4nmfNvIDXtTXiKyF7TCfnkvRPg=,tag:Dgdq4gT2lzhkXZ10uUCwwQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View File

@@ -34,7 +34,7 @@ sbatch
提交一个 VASP GPU 任务的例子:
```bash
sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" vasp-nvidia
sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" --output=output.txt vasp-nvidia
```
* `--gpus` 指定使用GPU 的情况:
@@ -50,7 +50,7 @@ sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" vasp-nvidia
提交一个 VASP CPU 任务的例子:
```bash
sbatch --ntasks=4 --cpus-per-task=4 --hint=nomultithread --job-name="my great job" vasp-intel
sbatch --ntasks=4 --cpus-per-task=4 --hint=nomultithread --job-name="my great job" --output=output.txt vasp-intel
```
* `--ntasks=4 --cpus-per-task=4` 指定使用占用多少核。
@@ -85,6 +85,7 @@ scancel -u chn
```bash
scontrol top 114514
sudo scontrol update JobId=3337 Nice=-2147483645
```
要显示一个任务的详细信息(不包括服务器重启之前算过的任务):
@@ -130,6 +131,8 @@ sacct --units M --format=ALL -j 114514 | bat -S
-s, --oversubscribe
# 包裹一个二进制程序
--wrap=
# 设置为最低优先级
--nice=10000
```
# 支持的连接协议

View File

@@ -90,7 +90,7 @@ inputs:
hpcstat = {};
};
bugs = [ "xmunet" "amdpstate" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "zzn" ];
};
services.hardware.bolt.enable = true;
};

View File

@@ -19,6 +19,8 @@ users:
wp: ENC[AES256_GCM,data:3jeHpeu1YlFhK2+o19q2/JyJPhZFivPbUQzJJbJZ15GzAVh7i1VsTSN31LufXAgsC8KjZHAPhEZlGYvnGpCvPzoISQa5NVAJdQ==,iv:bL3ohgbjA2agFKDwgw0H3LgiHTWB4Y5KlQAtHfEMr+w=,tag:SfLtj7iDcmV3dgOlITFvxA==,type:str]
#ENC[AES256_GCM,data:YIlY7n5pcJTp,iv:Y/+ogxaMgSl0vcMPRr3qdSHjjnnhY+N2Q6jFojzIDyQ=,tag:zat02jxJ8jI2uk8noslmHQ==,type:comment]
hjp: ENC[AES256_GCM,data:Ii4P9ZsUOEh3cqt3AKWlgUH1CMNnmHln9QNWdTRR3vZXkkR5j5qKAIrAltml/i3xFlt4hftYNufnupog4UlAVWQJhYBlhCSE4g==,iv:eKWmUcKItjd1dsvVP1se5CAhIFqV/eVH03gPJhBau1E=,tag:ZTE0BTSoDpJGqECklGjs2g==,type:str]
#ENC[AES256_GCM,data:hCgqHfpmeJ1Z,iv:pEKUNxhUyNAVtniTIQ2IpMPmXr2O+twq2/3Y2lIoqdw=,tag:RTqcI0XCoOymQD3r4+yS9Q==,type:comment]
zzn: ENC[AES256_GCM,data:/CSffToFJiBotXZ5rPkz0UNgI/iC0ftusPF2Ce6Of3XckjpCcikWj6n3ahJ24XsWQjp3EvacOiBorh+Kg16LjCEl0P2RMIitTQ==,iv:u9IFdp/jw7ehTshPzQVssLeh33iBYCPjSyJSLsc5EVo=,tag:/KXgmU7dcTKG8C4Y7NcMhw==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:qQMD8SKNmxb3PdScXNqppF9zkX7dV5i7rvljvZuhiI5zLnu77qYCHBW6ymh0mrY14N9NjxmQZhZWX/H8TvBlcg==,iv:J5N3LjCYW3QmuEkMBpl7qvPFW1Z9ZoPLkj45jKcIW9U=,tag:Tl+ld07+lVkmzt7f/f2MqQ==,type:str]
hpcstat:
@@ -50,8 +52,8 @@ sops:
ZDNHUjE2QVlCV3p0NHdKYW5IMHVBZzQKkZtfyvfroOntg3yRjMw4jQHiQj8eaB2h
IeIHfW4y01mmVT2ofbtB0xYpjcl4gtUlQ8X3tn5iJ9P8gcVo0G598A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-30T06:31:26Z"
mac: ENC[AES256_GCM,data:3t5jUl0FE4mqMMZp5RFlgmHPdy0jhwFZqtgP5NsAPfHRnQdL10YenqinIHue+R/Bp/0Auq7h+OKX/puibsPpyyqKPtACU2ONmyDqHqDuR+dj4rqFHMiIuU4qCF14J7XUh/PkDGLdASO5GsGPxOJPAGEcj77a8N/zWNSXY0K9NlI=,iv:RYE7lWzAnEgvAvgNDSsNYZcgqR1Yf7rbNHumizxwHjs=,tag:mNs/5JJ40C04apBIo3DoyA==,type:str]
lastmodified: "2024-08-31T15:59:56Z"
mac: ENC[AES256_GCM,data:zd3ivzjgdbwGZpZssHeIwwkKFfHDxo/dzvb8ptw9noZ4hDVoC5RL9M/OLN6GrRM0wtpNFZJDs7Zz0i1zMascXdVu6mou/0il6/96r+FkQVBJWbrkY36Lk7ntDAcQmZKWxSUfSF0JPHx1rbkIQSVtsLQrpui9UDxaY5DP23xjLQg=,iv:+ouEpSlo0EovK0Qh27tm7NXSYncbjEc/EMWfWHIrCqE=,tag:4CHXmsJ4LhFBmbep3Wil3w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

6
flake.lock generated
View File

@@ -1330,11 +1330,11 @@
"rsshub": {
"flake": false,
"locked": {
"lastModified": 1724689272,
"narHash": "sha256-iTkKoHSO/mD+TPR3hT9PO9TdHnxiqJDREyHb6a2LqaY=",
"lastModified": 1725304080,
"narHash": "sha256-Hq64xQwl6r6bEwJHtQ745Bf8mjid8BfUlix7HRvGaU0=",
"owner": "DIYgod",
"repo": "RSSHub",
"rev": "6709293f140f38fbbcf3df8fc4e851f88800eafd",
"rev": "b5ad2fa0cb08e4a718285de575a97b107152eea1",
"type": "github"
},
"original": {

View File

@@ -186,7 +186,7 @@
ufo = pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.ufo.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.ccls ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
chn-bsub = pkgs.mkShell
@@ -204,5 +204,15 @@
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
};
src = let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{
nixos-wallpaper = pkgs.fetchgit
{
url = "https://git.chn.moe/chn/nixos-wallpaper.git";
rev = "1ad78b20b21c9f4f7ba5f4c897f74276763317eb";
sha256 = "0faahbzsr44bjmwr6508wi5hg59dfb57fzh5x6jh7zwmv4pzhqlb";
fetchLFS = true;
};
};
};
}

View File

@@ -95,13 +95,21 @@ inputs:
[{
config.programs =
{
plasma =
plasma =
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
plasmarc.Wallpapers.usersWallpapers.value =
let
inherit (inputs.topInputs.self.src) nixos-wallpaper;
isPicture = f: builtins.elem (inputs.lib.last (inputs.lib.splitString "." f))
[ "png" "jpg" "jpeg" "webp" ];
in builtins.concatStringsSep "," (builtins.map (f: "${nixos-wallpaper}/${f.name}")
(builtins.filter (f: (isPicture f.name) && (f.value == "regular"))
(inputs.localLib.attrsToList (builtins.readDir nixos-wallpaper))));
};
powerdevil =
let config =

View File

@@ -12,7 +12,63 @@ inputs:
{
enable = true;
languagePacks = [ "zh-CN" "en-US" ];
nativeMessagingHosts.packages = with inputs.pkgs; [ uget-integrator ];
nativeMessagingHosts.packages = with inputs.pkgs; [ uget-integrator firefoxpwa ];
};
nixos =
{
packages.packages._packages = [ inputs.pkgs.firefoxpwa ];
user.sharedModules =
[{
config =
{
programs.firefox =
{
enable = true;
nativeMessagingHosts = with inputs.pkgs; [ plasma-browser-integration uget-integrator firefoxpwa ];
# TODO: use fixed-version of plugins
policies.DefaultDownloadDirectory = "\${home}/Downloads";
profiles.default =
{
extensions = with inputs.pkgs.firefox-addons;
[
immersive-translate tampermonkey bitwarden cookies-txt dualsub firefox-color i-dont-care-about-cookies
metamask pakkujs switchyomega rsshub-radar rsspreview tabliss tree-style-tab ublock-origin wallabagger
wappalyzer grammarly plasma-integration zotero-connector
(buildFirefoxXpiAddon
{
pname = "pwas-for-firefox";
version = "2.12.1";
addonId = "firefoxpwa@filips.si";
url = "https://addons.mozilla.org/firefox/downloads/file/4293028/pwas_for_firefox-2.12.1.xpi";
sha256 = "sha256-m8BCAlQt37RxVnWw+2hIPnmofTicNa5OWkwXp/IXdWY=";
meta = {};
})
];
search = { default = "Google"; force = true; };
userChrome = builtins.readFile "${inputs.topInputs.lepton}/userChrome.css";
userContent = builtins.readFile "${inputs.topInputs.lepton}/userContent.css";
extraConfig = builtins.readFile "${inputs.topInputs.lepton}/user.js";
settings =
{
# general
"browser.search.region" = "CN";
"intl.locale.requested" = "zh-CN,en-US";
"browser.aboutConfig.showWarning" = false;
"browser.bookmarks.showMobileBookmarks" = true;
"browser.download.panel.shown" = true;
"browser.download.useDownloadDir" = true;
"browser.newtab.extensionControlled" = true;
"browser.toolbars.bookmarks.visibility" = "never";
# allow to apply userChrome.css
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
# automatically enable extensions
"extensions.autoDisableScopes" = 0;
};
};
};
home.file.".mozilla/firefox/profiles.ini".force = true;
};
}];
};
};
}

View File

@@ -17,7 +17,11 @@ inputs:
nushell =
{
enable = true;
extraConfig = "source ${inputs.topInputs.nu-scripts}/aliases/git/git-aliases.nu";
extraConfig =
''
source ${inputs.topInputs.nu-scripts}/aliases/git/git-aliases.nu
$env.PATH = ($env.PATH | split row (char esep) | append "~/bin")
'';
};
carapace.enable = true;
oh-my-posh =

View File

@@ -64,5 +64,8 @@ inputs:
fwupd.enable = true;
};
home-manager = { useGlobalPkgs = true; useUserPackages = true; };
# allow everyone run compsize
security.wrappers.compsize =
{ setuid = true; owner = "root"; group = "root"; source = "${inputs.pkgs.compsize}/bin/compsize"; };
};
}

View File

@@ -30,12 +30,12 @@ inputs:
vps7 =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY";
hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "95.111.228.40" "192.168.83.2" ];
hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "144.126.144.62" "192.168.83.2" ];
};
"initrd.vps7" =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIGZyQpdQmEZw3nLERFmk2tS1gpSvXwW0Eish9UfhrRxC";
hostnames = [ "initrd.vps7.chn.moe" "95.111.228.40" ];
hostnames = [ "initrd.vps7.chn.moe" "144.126.144.62" ];
};
nas =
{

View File

@@ -28,7 +28,7 @@ inputs:
settings =
{
unix_socket_permissions = "0700";
shared_buffers = "8192MB";
shared_buffers = "512MB";
work_mem = "512MB";
autovacuum = "on";
};

View File

@@ -31,6 +31,7 @@ inputs:
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
};
restartTriggers = [ inputs.config.sops.templates."rsshub/env".content ];
};
tmpfiles.rules = [ "d /var/cache/rsshub 0700 rsshub rsshub" ];
};
@@ -50,13 +51,17 @@ inputs:
YOUTUBE_CLIENT_ID='${placeholder."rsshub/youtube-client-id"}'
YOUTUBE_CLIENT_SECRET='${placeholder."rsshub/youtube-client-secret"}'
YOUTUBE_REFRESH_TOKEN='${placeholder."rsshub/youtube-refresh-token"}'
TWITTER_AUTH_TOKEN='${placeholder."rsshub/twitter-auth-token"}'
XDG_CONFIG_HOME='/var/cache/rsshub/chromium'
XDG_CACHE_HOME='/var/cache/rsshub/chromium'
BILIBILI_COOKIE_data0='${placeholder."rsshub/bilibili-cookie"}'
'';
secrets = (listToAttrs (map (secret: { name = "rsshub/${secret}"; value = {}; })
[
"pixiv-refreshtoken"
"youtube-key" "youtube-client-id" "youtube-client-secret" "youtube-refresh-token"
"twitter-auth-token"
"bilibili-cookie"
]));
};
users =

View File

@@ -83,6 +83,9 @@ inputs:
SchedulerParameters=enable_user_top
SlurmdDebug=debug2
# automatically resume node after drain
ReturnToService=2
'';
extraConfigPaths =
let gpuString = builtins.concatStringsSep "\n" (builtins.map

View File

@@ -8,9 +8,9 @@ inputs:
extraGroups = inputs.lib.intersectLists
[ "adbusers" "networkmanager" "wheel" "wireshark" "libvirtd" "ipfs" ]
(builtins.attrNames inputs.config.users.groups);
autoSubUidGidRange = true;
subUidRanges = [{ startUid = 100000; count = 65536; } ];
subGidRanges = [{ startGid = 100000; count = 65536; } ];
hashedPassword = "$y$j9T$xJwVBoGENJEDSesJ0LfkU1$VEExaw7UZtFyB4VY1yirJvl7qS7oiF49KbEBrV0.hhC";
shell = inputs.lib.mkForce inputs.pkgs.nushell;
};
home-manager.users.chn =
{

View File

@@ -1,45 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (inputs.config.nixos.packages.firefox != null)
{
home-manager.users.chn.config =
{
programs.firefox =
{
enable = true;
nativeMessagingHosts = [ inputs.pkgs.plasma-browser-integration ];
# TODO: switch to chromium as default browser
# TODO: use fixed-version of plugins
policies.DefaultDownloadDirectory = "\${home}/Downloads";
profiles.default =
{
extensions = with inputs.pkgs.firefox-addons;
[
immersive-translate tampermonkey bitwarden cookies-txt dualsub firefox-color i-dont-care-about-cookies
metamask pakkujs switchyomega rsshub-radar rsspreview tabliss tree-style-tab ublock-origin wallabagger
wappalyzer grammarly plasma-integration zotero-connector
];
search = { default = "Google"; force = true; };
userChrome = builtins.readFile "${inputs.topInputs.lepton}/userChrome.css";
userContent = builtins.readFile "${inputs.topInputs.lepton}/userContent.css";
extraConfig = builtins.readFile "${inputs.topInputs.lepton}/user.js";
settings =
{
# general
"browser.search.region" = "CN";
"intl.locale.requested" = "zh-CN,en-US";
"browser.aboutConfig.showWarning" = false;
"browser.bookmarks.showMobileBookmarks" = true;
"browser.download.panel.shown" = true;
"browser.download.useDownloadDir" = true;
"browser.newtab.extensionControlled" = true;
"browser.toolbars.bookmarks.visibility" = "never";
# allow to apply userChrome.css
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
};
};
home.file.".mozilla/firefox/profiles.ini".force = true;
};
};
}

View File

@@ -1 +0,0 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOH3AvxMlB3omzH6SFQt0Z5+f05x9nMJpFfSLH4OIYV+ chn@pc

View File

@@ -68,10 +68,7 @@ inputs:
(builtins.readFile "${inputs.pkgs.konsole}/share/konsole/Breeze.colorscheme");
};
environment.persistence =
let impermanence = inputs.config.nixos.system.impermanence;
in inputs.lib.mkIf impermanence.enable (inputs.lib.mkMerge (builtins.map
(user:
{ "${impermanence.root}".users.${user}.directories = [ ".local/share/konsole" ".local/share/yakuake" ]; })
inputs.config.nixos.user.users));
let impermanence = inputs.config.nixos.system.impermanence; in inputs.lib.mkIf impermanence.enable
{ "${impermanence.root}".users.chn.directories = [ ".local/share/konsole" ".local/share/yakuake" ]; };
};
}

View File

@@ -2,13 +2,7 @@ inputs:
{
config.home-manager.users.chn.config.programs.plasma.configFile =
let
nixos-wallpaper = inputs.pkgs.fetchgit
{
url = "https://git.chn.moe/chn/nixos-wallpaper.git";
rev = "1ad78b20b21c9f4f7ba5f4c897f74276763317eb";
sha256 = "0faahbzsr44bjmwr6508wi5hg59dfb57fzh5x6jh7zwmv4pzhqlb";
fetchLFS = true;
};
inherit (inputs.topInputs.self.src) nixos-wallpaper;
wallpaper =
{
pc = "${nixos-wallpaper}/pixiv-117612023.png";

16
modules/user/chn/sops.nix Normal file
View File

@@ -0,0 +1,16 @@
inputs:
{
config = inputs.lib.mkIf
(
(builtins.elem "chn" inputs.config.nixos.user.users)
&& (builtins.elem inputs.config.nixos.system.networking.hostname [ "pc" "surface" ])
)
{
home-manager.users.chn = homeInputs:
{
config.xdg.configFile."sops/age/keys.txt".source =
homeInputs.config.lib.file.mkOutOfStoreSymlink inputs.config.sops.secrets.age.path;
};
sops.secrets.age.owner = "chn";
};
}

View File

@@ -20,6 +20,7 @@ inputs:
test = 1006;
wp = 1007;
hjp = 1008;
zzn = 1009;
misskey-misskey = 2000;
misskey-misskey-old = 2001;
frp = 2002;
@@ -108,8 +109,7 @@ inputs:
users.users.root =
{
shell = inputs.pkgs.zsh;
openssh.authorizedKeys.keys =
[ (builtins.readFile ./chn/id_ed25519_sk.pub) (builtins.readFile ./chn/id_ed25519.pub) ];
openssh.authorizedKeys.keys = [(builtins.readFile ./chn/id_ed25519_sk.pub)];
hashedPassword = "$y$j9T$.UyKKvDnmlJaYZAh6./rf/$65dRqishAiqxCE6LEMjqruwJPZte7uiyYLVKpzdZNH5";
};
home-manager.users.root =

View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG+BwKfT2xCiu8qzTGCN2An9GHt0t0egwgMffWyk4WTD zzn

View File

@@ -1,3 +0,0 @@
CompileFlags:
Add: [ -Wall, -Wextra, -std=c++26 ]
Compiler: g++

View File

@@ -1 +0,0 @@
test

View File

@@ -25,3 +25,9 @@ install(TARGETS ufo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")
include(CTest)
add_test(NAME fold COMMAND ufo fold ${PROJECT_SOURCE_DIR}/test/fold/config.yaml)
add_test(NAME fold-compare COMMAND ${CMAKE_COMMAND} -E compare_files fold-output.yaml
${PROJECT_SOURCE_DIR}/test/fold/output.yaml)
set_tests_properties(fold-compare PROPERTIES DEPENDS fold)

View File

@@ -0,0 +1,45 @@
分为几个功能:
* fold根据要计算的单胞的 q 点路径,计算超胞中对应的 q 点路径,生成的路径再交给 phonopy 计算。
* unfold根据 phonopy 计算的结果,将超胞的结果展开到单胞中。
* plot对计算结果画图。
主要的输入输出格式均为 yaml。对于数据特别大的情况也可以从 hdf5 中读取一部分数据或者将一部分数据写入到 hdf5 文件中。
# fold
## 输入
```yaml
# 三个整数组成的向量,表示从单胞到超胞,三个晶格矢量的倍数
# 必写
SuperCellMultiplier: [2, 2, 2]
# 一个变换矩阵,表明超胞经历了怎样的扭曲。
# 可选,默认值为单位矩阵
SuperCellDeformation: [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
# 一个由三个浮点数组成的向量,表示考虑的 q 点
# 必写
Qpoints:
- [0, 0, 0]
- [0.1, 0, 0]
- [0.2, 0, 0]
- [0.3, 0, 0]
- [0.4, 0, 0]
- [0.5, 0, 0]
# 一个 DataFile 类型的对象,表明输出结果到哪个文件
# 必写
OutputFile:
```
## 输出
```yaml
# 得到的 q 点坐标
Qpoints:
- [0, 0, 0]
- [0.1, 0, 0]
- [0.2, 0, 0]
- [0.3, 0, 0]
- [0.4, 0, 0]
- [0.5, 0, 0]
```

View File

@@ -0,0 +1,33 @@
# write many output files
LWAVE = F
LCHARG = F
LELF = F
LEPSILON = F
LCALCEPS = F
# use high precision
PREC = Accurate
EDIFF = 1E-7
EDIFFG = -1E-3
# enough ionic steps
NSW = 100
# calculate forces and stress tensor, and allow all degrees of freedom (atom positions, cell shape, and cell volume)
ISIF = 3
# use conjugate gradient algorithm to do ionic relaxation
IBRION = 2
# use Gaussian smearing to set partial occupancies for each orbital, commonly suggested
ISMEAR = 0
# use Vosko-Wilk-Nusair interpolation to enchange the estimation of magnetic moments and energies
VOSKOWN = 1
# set symmetry
ISYM = 2
# projection done in reciprocal space for small unit cells,
# in real space for large unit cells
LREAL = F

View File

@@ -0,0 +1,5 @@
3X3X3
0
Gamma
3 3 3
0 0 0

View File

@@ -0,0 +1,103 @@
POSCAR file written by Ovito 3.7.11
1
9.2397000789 0.0 0.0
0.0 10.6690864562 0.0
0.0 0.0 10.0822000504
Si C
48 47
Direct
0.1666666667 0.083333336 0.25
0.1666666567 0.4166666865 0.75
0.0 0.0 0.0
0.0 0.0 0.5
0.0 0.3333333135 0.25
0.0 0.1666666715 0.75
0.1666666567 0.25 0.0
0.1666666567 0.25 0.5
0.1666666667 0.583333336 0.25
0.1666666567 0.9166666865 0.75
0.0 0.5 0.0
0.0 0.5 0.5
0.0 0.8333333135 0.25
0.0 0.6666666715 0.75
0.1666666567 0.75 0.0
0.1666666567 0.75 0.5
0.5 0.083333336 0.25
0.49999999 0.4166666865 0.75
0.3333333333 0.0 0.0
0.3333333333 0.0 0.5
0.3333333333 0.3333333135 0.25
0.3333333333 0.1666666715 0.75
0.49999999 0.25 0.0
0.49999999 0.25 0.5
0.5 0.583333336 0.25
0.49999999 0.9166666865 0.75
0.3333333333 0.5 0.0
0.3333333333 0.5 0.5
0.3333333333 0.8333333135 0.25
0.3333333333 0.6666666715 0.75
0.49999999 0.75 0.0
0.49999999 0.75 0.5
0.8333333333 0.083333336 0.25
0.8333333233 0.4166666865 0.75
0.6666666667 0.0 0.0
0.6666666667 0.0 0.5
0.6666666667 0.3333333135 0.25
0.6666666667 0.1666666715 0.75
0.8333333233 0.25 0.0
0.8333333233 0.25 0.5
0.8333333333 0.583333336 0.25
0.8333333233 0.9166666865 0.75
0.6666666667 0.5 0.0
0.6666666667 0.5 0.5
0.6666666667 0.8333333135 0.25
0.6666666667 0.6666666715 0.75
0.8333333233 0.75 0.0
0.8333333233 0.75 0.5
0.1666666667 0.083333336 0.435380012
0.1666666567 0.4166666865 0.935379982
0.0 0.0 0.189610004
0.0 0.0 0.689610004
0.0 0.3333333135 0.435380012
0.0 0.1666666715 0.935379982
0.1666666567 0.25 0.189610004
0.1666666567 0.25 0.689610004
0.1666666667 0.583333336 0.435380012
0.1666666567 0.9166666865 0.935379982
0.0 0.5 0.189610004
0.0 0.5 0.689610004
0.0 0.8333333135 0.435380012
0.0 0.6666666715 0.935379982
0.1666666567 0.75 0.189610004
0.1666666567 0.75 0.689610004
0.5 0.083333336 0.435380012
0.49999999 0.4166666865 0.935379982
0.3333333333 0.0 0.189610004
0.3333333333 0.0 0.689610004
0.3333333333 0.3333333135 0.435380012
0.3333333333 0.1666666715 0.935379982
0.49999999 0.25 0.189610004
0.49999999 0.25 0.689610004
0.5 0.583333336 0.435380012
0.49999999 0.9166666865 0.935379982
0.3333333333 0.5 0.189610004
0.3333333333 0.5 0.689610004
0.3333333333 0.8333333135 0.435380012
0.3333333333 0.6666666715 0.935379982
0.49999999 0.75 0.189610004
0.49999999 0.75 0.689610004
0.8333333333 0.083333336 0.435380012
0.8333333233 0.4166666865 0.935379982
0.6666666667 0.0 0.189610004
0.6666666667 0.0 0.689610004
0.6666666667 0.3333333135 0.435380012
0.6666666667 0.1666666715 0.935379982
0.8333333233 0.25 0.189610004
0.8333333233 0.25 0.689610004
0.8333333333 0.583333336 0.435380012
0.8333333233 0.9166666865 0.935379982
0.6666666667 0.5 0.189610004
0.6666666667 0.5 0.689610004
0.6666666667 0.8333333135 0.435380012
0.6666666667 0.6666666715 0.935379982
0.8333333233 0.75 0.189610004

View File

@@ -0,0 +1,90 @@
本例子演示,计算一个包含 95 个原子且带有一个 C 空位的 4H-SiC 超胞的声子谱并将它近似反折叠到原胞8 原子)的声子谱中。
每一步用到的文件已经在当前目录中给出。简单起见,我们将仅仅计算 Gamma-M 线上的声子谱。
# 第一步:建立模型
我们首先准备一个 4H-SiC 原胞的模型,并将它弛豫:
```{{ filename = "4H-SiC.in" }}
1.0
3.0799000263 0.0000000000 0.0000000000
-1.5399500132 2.6672716639 0.0000000000
0.0000000000 0.0000000000 10.0822000504
Si C
4 4
Direct
0.333333343 0.666666687 0.250000000
0.666666627 0.333333313 0.750000000
0.000000000 0.000000000 0.000000000
0.000000000 0.000000000 0.500000000
0.333333343 0.666666687 0.435380012
0.666666627 0.333333313 0.935379982
0.000000000 0.000000000 0.189610004
0.000000000 0.000000000 0.689610004
```
再准备一个含有 C 空位的 4H-SiC 超胞的模型。
注意到超胞模型中已经被提前扣掉了一个 C 原子。
记下弛豫后的晶胞尺寸,稍后会用到。
TODO: 有必要弛豫原胞吗?
```yaml
PrimitiveCell:
- [ 3.0799, 0, 0 ]
- [ -1.53995, 2.66727, 0 ]
- [ 0, 0, 10.0822 ]
SuperCell:
- [ 9.2397, 0, 0 ]
- [ -4.61985, 8.00181, 0 ]
- [ 0, 0, 10.0822 ]
```
# 第二步:计算超胞中的 Q 点坐标
为了得到原胞中 Gamma-M 线上的声子模式,我们需要计算超胞中哪些 Q 点处的模式?
这个问题不仅看上去似乎有些难以回答,而且实际上人手算起来也一点不简单。
因此我写了功能来处理这个问题:
```yaml
SuperCellMultiplier: [ 3, 4, 1 ]
SuperCellDeformation:
- [ 1, 0, 0 ]
- [ 0.66666, 1, 0 ]
- [ 0, 0, 1 ]
Qpoints:
- [0, 0, 0]
- [0.05, 0, 0]
- [0.1, 0, 0]
- [0.15, 0, 0]
- [0.2, 0, 0]
- [0.25, 0, 0]
- [0.3, 0, 0]
- [0.35, 0, 0]
- [0.4, 0, 0]
- [0.45, 0, 0]
- [0.5, 0, 0]
OutputFile:
Filename: fold-output.yaml
Format: yaml
```
得到:
```yaml
Qpoints:
- [ 0.00000000, 0.00000000, 0.00000000 ]
- [ 0.15000000, 0.09999999, 0.00000000 ]
- [ 0.30000000, 0.19999998, 0.00000000 ]
- [ 0.45000000, 0.29999997, 0.00000000 ]
- [ 0.60000000, 0.39999996, 0.00000000 ]
- [ 0.75000000, 0.49999995, 0.00000000 ]
- [ 0.90000000, 0.59999994, 0.00000000 ]
- [ 0.05000000, 0.69999993, 0.00000000 ]
- [ 0.20000000, 0.79999992, 0.00000000 ]
- [ 0.35000000, 0.89999991, 0.00000000 ]
- [ 0.50000000, 0.99999990, 0.00000000 ]
```
大致在草稿纸上画个图,可以确认这个结果是合理的。

View File

@@ -18,7 +18,7 @@ namespace ufo
Eigen::Matrix3d PrimativeCell;
// 单胞到超胞的格矢转换时用到的矩阵
// SuperCellMultiplier 是一个三维列向量且各个元素都是整数,表示单胞在各个方向扩大到多少倍之后,可以得到和超胞一样的体积
// SuperCsolver.hpp>mation 是一个行列式为 1 的矩阵,它表示经过 SuperCellMultiplier 扩大后,还需要怎样的变换才能得到超胞
// SuperCellDeformation 是一个行列式为 1 的矩阵,它表示经过 SuperCellMultiplier 扩大后,还需要怎样的变换才能得到超胞
// SuperCell = (SuperCellDeformation * SuperCellMultiplier.asDiagonal()) * PrimativeCell
// ReciprocalPrimativeCell = (SuperCellDeformation * SuperCellMultiplier.asDiagonal()).transpose()
// * ReciprocalSuperCell

View File

@@ -5,18 +5,11 @@ namespace ufo
FoldSolver::InputType::InputType(std::string config_file)
{
auto input = YAML::LoadFile(config_file);
for (unsigned i = 0; i < 3; i++)
SuperCellMultiplier(i) = input["SuperCellMultiplier"][i].as<unsigned>();
SuperCellMultiplier = input["SuperCellMultiplier"].as<std::array<unsigned, 3>>() | biu::toEigen<>;
if (input["SuperCellDeformation"])
{
SuperCellDeformation.emplace();
for (unsigned i = 0; i < 3; i++)
for (unsigned j = 0; j < 3; j++)
(*SuperCellDeformation)(i, j) = input["SuperCellDeformation"][i][j].as<double>();
}
for (auto& qpoint : input["Qpoints"].as<std::vector<std::vector<double>>>())
Qpoints.push_back(Eigen::Vector3d
{{qpoint.at(0)}, {qpoint.at(1)}, {qpoint.at(2)}});
SuperCellDeformation = input["SuperCellDeformation"].as<std::array<std::array<double, 3>, 3>>() | biu::toEigen<>;
for (auto& qpoint : input["Qpoints"].as<std::vector<std::array<double, 3>>>())
Qpoints.push_back(qpoint | biu::toEigen<>);
OutputFile = DataFile(input["OutputFile"], {"yaml"}, config_file);
}
void FoldSolver::OutputType::write(std::string filename) const
@@ -55,32 +48,28 @@ namespace ufo
std::optional<Eigen::Matrix<double, 3, 3>> super_cell_deformation
)
{
// 首先需要将 q 点转移到 ModifiedSuperCell 的倒格子中
// 将 q 点坐标扩大, 然后取小数部分, 就可以了
auto qpoint_by_reciprocal_modified_super_cell = super_cell_multiplier.cast<double>().asDiagonal()
* qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell;
auto qpoint_in_reciprocal_modified_super_cell_by_reciprocal_modified_super_cell =
(qpoint_by_reciprocal_modified_super_cell.array() - qpoint_by_reciprocal_modified_super_cell.array().floor())
.matrix();
if (!super_cell_deformation)
return qpoint_in_reciprocal_modified_super_cell_by_reciprocal_modified_super_cell;
/*
对 q 点平移数个 SupreCell, 直到它落在超胞的倒格子中
这等价于直接将 q 点坐标用 SuperCell 的倒格子表示, 然后取小数部分.
ModifiedSuperCell = SuperCellMultiplier * PrimativeCell
SuperCell = SuperCellDeformation * ModifiedSuperCell
ReciprocalModifiedSuperCell = ModifiedSuperCell.inverse().transpose()
ReciprocalSuperCell = SuperCell.inverse().transpose()
Qpoint = QpointByReciprocalModifiedSuperCell.transpose() * ReciprocalModifiedSuperCell
Qpoint = QpointByReciprocalSuperCell.transpose() * ReciprocalSuperCell
首先需要将 q 点坐标的单位转换为 ModifiedSuperCell 的格矢,可知:
QpointByReciprocalModifiedSuperCell = SuperCellMultiplier * QpointByReciprocalPrimitiveCell;
接下来考虑将 q 点坐标的单位转换为 SuperCell 的格矢
ModifiedSuperCell = SuperCellMultiplier * PrimativeCell;
SuperCell = SuperCellDeformation * ModifiedSuperCell;
ReciprocalModifiedSuperCell = ModifiedSuperCell.inverse().transpose();
ReciprocalSuperCell = SuperCell.inverse().transpose();
Qpoint = QpointByReciprocalModifiedSuperCell.transpose() * ReciprocalModifiedSuperCell;
Qpoint = QpointByReciprocalSuperCell.transpose() * ReciprocalSuperCell;
整理可以得到:
QpointByReciprocalSuperCell = SuperCellDeformation * QpointByReciprocalModifiedSuperCell
QpointByReciprocalSuperCell = SuperCellDeformation * QpointByReciprocalModifiedSuperCell;
两个式子结合,可以得到:
QpointByReciprocalSuperCell = SuperCellDeformation * SuperCellMultiplier * QpointByReciprocalPrimitiveCell;
*/
auto qpoint_in_reciprocal_modified_super_cell_by_reciprocal_super_cell =
(*super_cell_deformation * qpoint_in_reciprocal_modified_super_cell_by_reciprocal_modified_super_cell).eval();
auto qpoint_in_reciprocal_super_cell_by_reciprocal_super_cell =
qpoint_in_reciprocal_modified_super_cell_by_reciprocal_super_cell.array()
- qpoint_in_reciprocal_modified_super_cell_by_reciprocal_super_cell.array().floor();
return qpoint_in_reciprocal_super_cell_by_reciprocal_super_cell;
auto qpoint_by_reciprocal_super_cell = (super_cell_deformation.value_or(Eigen::Matrix3d::Identity())
* super_cell_multiplier.cast<double>().asDiagonal()
* qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell).eval();
/*
到目前为止,我们还没有移动过 q 点的坐标。现在,我们将它移动整数个 ReciprocalSuperCell,直到它落在超胞的倒格子中。
这等价于直接取 QpointByReciprocalSuperCell - QpointByReciprocalSuperCell.floor()。
*/
return (qpoint_by_reciprocal_super_cell.array() - qpoint_by_reciprocal_super_cell.array().floor()).matrix();
}
}

View File

@@ -0,0 +1,20 @@
SuperCellMultiplier: [ 3, 4, 1 ]
SuperCellDeformation:
- [ 1, 0, 0 ]
- [ 0.6666666, 1, 0 ]
- [ 0, 0, 1 ]
Qpoints:
- [0, 0, 0]
- [0.05, 0, 0]
- [0.1, 0, 0]
- [0.15, 0, 0]
- [0.2, 0, 0]
- [0.25, 0, 0]
- [0.3, 0, 0]
- [0.35, 0, 0]
- [0.4, 0, 0]
- [0.45, 0, 0]
- [0.5, 0, 0]
OutputFile:
Filename: fold-output.yaml
Format: yaml

View File

@@ -0,0 +1,12 @@
Qpoints:
- [ 0.00000000, 0.00000000, 0.00000000 ]
- [ 0.15000000, 0.09999999, 0.00000000 ]
- [ 0.30000000, 0.19999998, 0.00000000 ]
- [ 0.45000000, 0.29999997, 0.00000000 ]
- [ 0.60000000, 0.39999996, 0.00000000 ]
- [ 0.75000000, 0.49999995, 0.00000000 ]
- [ 0.90000000, 0.59999994, 0.00000000 ]
- [ 0.05000000, 0.69999993, 0.00000000 ]
- [ 0.20000000, 0.79999992, 0.00000000 ]
- [ 0.35000000, 0.89999991, 0.00000000 ]
- [ 0.50000000, 0.99999990, 0.00000000 ]

View File

@@ -0,0 +1,2 @@
在 4H-SiC 超胞中,存在一个 C 空位,计算它的声子。

View File

@@ -22,4 +22,5 @@ ssh-keygen -t ed25519 -C root@pe -f /mnt/nix/persistent/etc/ssh/ssh_host_ed25519
systemd-machine-id-setup --root=/mnt/nix/persistent
pg_dump -h 127.0.0.1 -U synapse -Fc -f synaps.dump synapse
pg_restore -h 127.0.0.1 -U misskey -d misskey --data-only --jobs=4 misskey.dump
cryptsetup luksUUID --uuid=<the new UUID> /dev/sda1
```