Compare commits

...

1117 Commits

Author SHA1 Message Date
chn
3de91db3fd add freshrss 2023-11-06 18:29:46 +08:00
chn
65bd74aa2d 写入 knownHosts 2023-10-22 13:28:15 +08:00
chn
00572e7b29 packages: add try 2023-10-22 12:15:35 +08:00
chn
5be30df0af add haskell patch to nixpkgs-unstable 2023-10-22 00:30:20 +08:00
chn
e4219ddefb packages: add fastfetch 2023-10-21 20:22:37 +08:00
chn
108cf36835 packages.chromium: add MetaMask 2023-10-21 19:56:29 +08:00
chn
5645c3d1bd vps6: fix xlog proxy 2023-10-21 15:35:14 +08:00
chn
4a56408a7a local.pkgs.misskey: update 2023-10-21 14:23:24 +08:00
chn
c8d6ed06a6 vps6: enable forward for xlog 2023-10-21 14:05:37 +08:00
chn
b6122fde21 packages: add electrum 2023-10-21 11:07:03 +08:00
chn
85ed0026cb packages.vscode: add todo-tree 2023-10-20 20:52:10 +08:00
chn
7ef8b41350 yoga: workaround bugs 2023-10-19 20:08:33 +08:00
chn
856ccc5281 typo 2023-10-19 19:58:44 +08:00
chn
fb924cd8e0 fix lenovo-yogabook module not found for kernel-lts 2023-10-18 21:45:28 +08:00
chn
66e602e750 pc: use lts kernel 2023-10-18 21:15:37 +08:00
chn
570b82015e system.gui: disable plasma-nm when gui is not preferred 2023-10-18 20:57:58 +08:00
chn
eaa5a7f7a3 try workaround nvme bug 2023-10-16 10:43:09 +08:00
chn
f38b2b3596 update misskey 2023-10-15 18:06:26 +08:00
chn
c1eb35b7d8 bug.nvme: use software iommu 2023-10-15 14:40:31 +08:00
chn
0b90b9831f packages: add ydict 2023-10-15 14:02:50 +08:00
chn
a56011bf6d fix biu 2023-10-14 23:19:32 +08:00
chn
4bb77b3351 update libbiu 2023-10-14 22:51:07 +08:00
chn
2982615a25 nas: fix swap 2023-10-14 21:29:00 +08:00
chn
279483923e Revert "services.misskey: temporarily disable redis"
This reverts commit 1334fe2b47.
2023-10-14 19:57:17 +08:00
chn
1334fe2b47 services.misskey: temporarily disable redis 2023-10-14 19:30:00 +08:00
chn
954dd962bc vps7.services.meilisearch: do not limit io 2023-10-14 17:49:18 +08:00
chn
62255316be services.misskey: do not limit runtime 2023-10-14 17:48:23 +08:00
chn
b2aa00afa6 add libbiu 2023-10-14 16:20:48 +08:00
chn
41d14eff54 add tgbot-cpp 2023-10-14 14:23:12 +08:00
chn
97e25871ae add localPackages overlay 2023-10-13 21:13:28 +08:00
chn
b59f68d3b1 systemd coredump write to rootfs 2023-10-11 22:24:08 +08:00
chn
dc4a836bbb sysreq use 438 2023-10-11 19:27:44 +08:00
chn
a6cddb2f7f fix cjktty 2023-10-09 12:11:14 +08:00
chn
f05d75d041 add yogabook kmod 2023-10-09 11:56:54 +08:00
chn
df76f20ff5 try to get halo keyboard working 2023-10-08 23:19:09 +08:00
chn
7133b45ffe try to fix touch keyboard 2023-10-08 19:27:16 +08:00
chn
4370b99ee6 fix touch keyboard 2023-10-08 19:09:45 +08:00
chn
bfd47d1dcf yoga: enable halo-keyboard 2023-10-08 19:04:39 +08:00
chn
9b89e61f20 yoga: disable smartd 2023-10-08 19:03:18 +08:00
chn
f1e4bfd9bc fix halo-keyboard service 2023-10-08 19:01:26 +08:00
chn
62aa651c15 add chromiumos-touch-keyboard 2023-10-08 17:00:27 +08:00
chn
5ffdec57c0 add propagatedBuildInputs 2023-10-08 13:34:38 +08:00
chn
e20527b4cd add glad 2023-10-08 13:33:32 +08:00
chn
be54e681c3 add yoga to default 2023-10-08 11:55:20 +08:00
chn
fe9c7b9363 system: adjust swappiness 2023-10-08 11:35:53 +08:00
chn
62c3c6ab29 add checks 2023-10-08 10:57:57 +08:00
chn
f97db074e6 services.misskey: fix postgresql.enable 2023-10-08 10:53:28 +08:00
chn
22ef0c27f5 local.pkgs.matplotplusplus: enable opengl 2023-10-07 22:11:22 +08:00
chn
f6a5022aca merge next 2023-10-07 20:41:14 +08:00
chn
53020f6373 allow deploy to yoga 2023-10-07 19:46:39 +08:00
chn
089fd25d8c nas: enable swap 2023-10-07 19:14:59 +08:00
chn
effb920c82 Merge branch 'main' into next 2023-10-07 11:41:19 +08:00
chn
a2c316a6f7 fix aagl build failed 2023-10-06 16:58:30 +08:00
chn
857625884d system: enable fstrim 2023-10-06 16:24:06 +08:00
chn
56a63df3c2 add pslist 2023-10-06 11:54:49 +08:00
chn
fee894fa0a anime-game use native package 2023-10-05 21:30:59 +08:00
chn
723e859079 update everything 2023-10-05 21:14:51 +08:00
chn
864b4c06eb fix 2023-10-05 19:21:12 +08:00
chn
9ec12f8bfc Merge branch 'nas-beesd' 2023-10-05 19:16:26 +08:00
chn
27515d37fe nas: enable beesd 2023-10-05 19:16:12 +08:00
chn
cbec6f8d8d add jupyterlab 2023-10-05 18:58:02 +08:00
chn
4a7c532b31 Merge branch 'vps7-beesd' 2023-10-05 16:47:15 +08:00
chn
50aba26cfc vps7: enable beesd 2023-10-05 16:46:59 +08:00
chn
d7a781ad1a Merge branch 'vps6-beesd' 2023-10-05 16:17:24 +08:00
chn
625c3264af services.nextcloud: disable update checker 2023-10-05 16:12:53 +08:00
chn
9f78a34e6a vps6: enable beesd 2023-10-05 15:55:39 +08:00
chn
b72c8a43fa vps7: prepare for beesd 2023-10-05 15:52:39 +08:00
chn
286fc162c9 vps6: prepare for beesd 2023-10-05 15:45:30 +08:00
chn
47126a7429 local.pkgs: update rsshub 2023-10-05 11:30:12 +08:00
chn
be3c0e5821 services.nextcloud: add app 2023-10-04 21:06:35 +08:00
chn
14f62cf255 Revert "services.nextcloud: enable appstore"
This reverts commit 60f3ccc506.
2023-10-04 20:45:05 +08:00
chn
60f3ccc506 services.nextcloud: enable appstore 2023-10-04 20:38:20 +08:00
chn
2bac21f4cf services.nextcloud: fix mail 2023-10-04 20:06:45 +08:00
chn
ea02adcf4d vps6: enable nextcloud 2023-10-04 19:51:48 +08:00
chn
7fb51ba080 fix nextcloud mail config 2023-10-04 16:19:57 +08:00
chn
6020e071c0 fix 2023-10-04 15:56:11 +08:00
chn
c83c90050a fix 2023-10-04 15:51:11 +08:00
chn
15d89d99ad fix 2023-10-04 15:46:55 +08:00
chn
4b5078a76c fix 2023-10-04 15:42:34 +08:00
chn
073aa595d3 vps7: enable nextcloud 2023-10-04 15:41:00 +08:00
chn
2b5349ae06 services.nextcloud: init 2023-10-04 15:40:28 +08:00
chn
3f62ee0dcd fix 2023-10-04 12:11:40 +08:00
chn
b9f5478c26 vps6: enable photoprism
vps7: enable photoprism
2023-10-04 12:09:01 +08:00
chn
11ee42d876 fix 2023-10-04 12:04:54 +08:00
chn
d7adea94eb services.mariadb: fix user password and permissions 2023-10-04 11:48:39 +08:00
chn
990a5cf0be services.photoprism: init 2023-10-04 11:15:23 +08:00
chn
2cbe5945b7 services.mariadb: init 2023-10-04 10:13:56 +08:00
chn
e06623ce79 move zsh history 2023-10-04 00:35:59 +08:00
chn
4eeae31498 vps6: enable element-web 2023-10-03 21:47:46 +08:00
chn
9c75d2ac8d fix 2023-10-03 20:41:09 +08:00
chn
f2b88fa5a3 services.nginx.http: rename from httpProxy, allow static site 2023-10-03 20:34:54 +08:00
chn
259a1cc6f9 move xxx-proxy to nginx 2023-10-03 20:11:43 +08:00
chn
e4d1320373 restore old misskey 2023-10-03 19:00:33 +08:00
chn
4f24bcce18 vps7: migrate misskey 2023-10-03 11:44:31 +08:00
chn
e3336b95f8 fix 2023-10-02 22:27:35 +08:00
chn
97952ec828 service.misskey: allow multiple instances 2023-10-02 21:38:06 +08:00
chn
66bcb54311 prepare beesd for nas 2023-10-02 16:21:18 +08:00
chn
a0ef3198c2 fix remote-decrypt 2023-10-02 14:20:21 +08:00
chn
68b94f7216 nas: add networking driver into initrd 2023-10-02 14:10:23 +08:00
chn
b533b80f31 nas: enable sshd in initrd 2023-10-02 13:55:40 +08:00
chn
a7315cd8b5 fix initrd.nas.chn.moe 2023-10-02 13:52:32 +08:00
chn
0a6a8fdd7b fix remote-decrypt 2023-10-02 13:49:26 +08:00
chn
d6d0a0e230 nas: enable remote decryption 2023-10-02 13:36:27 +08:00
chn
8d583b626f nas.snapper: disable 2023-10-02 11:41:04 +08:00
chn
14ef69b54a pc.services.snapper: enable
pc.services.beesd: adjust
2023-10-02 09:54:58 +08:00
chn
b69d4648b5 Revert "services.beesd: use 4 threads"
This reverts commit 70e6430750.
2023-10-02 00:28:47 +08:00
chn
2efb0afcfe system.kernel: update to 6.4.15 2023-10-01 23:41:31 +08:00
chn
70e6430750 services.beesd: use 4 threads 2023-10-01 23:35:50 +08:00
chn
3dc8a2d73a bugs: add nvme 2023-10-01 23:12:34 +08:00
chn
795d55baee services.beesd: use 8 threads 2023-10-01 22:46:56 +08:00
chn
705d279a94 system.fileSystems.rollingRootfs: fix 2023-10-01 22:46:11 +08:00
chn
d88610f3b7 services.beesd: more threads 2023-10-01 19:54:14 +08:00
chn
e832412f3b system.fileSystems.rollingRootFs: make old rootfs readonly 2023-10-01 19:15:32 +08:00
chn
78b27d3ae5 system.impermanence: kvm image save to nodatacow 2023-10-01 18:29:27 +08:00
chn
a694ada2ee Revert "pc.services.beesd: disable"
This reverts commit bacfb9ccf2.
2023-10-01 18:01:40 +08:00
chn
bacfb9ccf2 pc.services.beesd: disable
pc.services.snapper: enable
2023-10-01 17:49:09 +08:00
chn
fbe4c21e9a Revert "services.beesd: adjust thread count"
This reverts commit 4340106787.
2023-10-01 17:45:38 +08:00
chn
4340106787 services.beesd: adjust thread count 2023-10-01 17:33:21 +08:00
chn
f42e1df555 services.snapper: remove patch 2023-10-01 17:08:11 +08:00
chn
63664f4fc7 pc.services.beesd: larger hash table size
pc.snapper: disable
2023-10-01 17:04:04 +08:00
chn
33b96bd46f pc: enable beesd 2023-10-01 16:25:25 +08:00
chn
106112d16f local.pkgs.misskey: fix 2023-10-01 16:11:46 +08:00
chn
38b6378160 services.beesd: disable 2023-10-01 09:22:08 +08:00
chn
33f7702330 packages: fix octave gui 2023-09-30 15:50:11 +08:00
chn
556ac1994d local.pkgs.misskey: 2023.9.1 -> 2023.9.3 2023-09-30 10:59:38 +08:00
chn
99aa6ecbf7 Revert "local.pkgs.misskey: use symlink for pnpm store"
This reverts commit fde802ebfc.
2023-09-30 10:54:41 +08:00
chn
fde802ebfc local.pkgs.misskey: use symlink for pnpm store 2023-09-30 10:51:37 +08:00
chn
1118e86d62 services.beesd: do not deduplicate snapshots 2023-09-30 10:45:57 +08:00
chn
ca59f06646 services.beesd: disable for boot 2023-09-29 18:33:35 +08:00
chn
9eec3611d4 services.beesd: set hashTableSizeMB 2023-09-29 10:52:14 +08:00
chn
3f54c4256c services.beesd: use only one thread 2023-09-29 09:38:44 +08:00
chn
91d7ab5b8f services.beesd: lower io priority 2023-09-29 01:02:39 +08:00
chn
dcf7f8ace0 system.nix: disable auto-optimise-store 2023-09-29 00:33:31 +08:00
chn
b7d524671a enable beesd for all machines 2023-09-29 00:32:48 +08:00
chn
f9a5581410 add beesd 2023-09-28 23:44:04 +08:00
chn
8c70c96d8e add nameof 2023-09-28 11:17:50 +08:00
chn
1957d68247 add eigen 2023-09-28 10:06:06 +08:00
chn
ceb91a8ed8 add btrfs-assistant 2023-09-28 00:41:49 +08:00
chn
093b27a225 system.networking.nebula: try to fix nebula at boot 2023-09-26 17:49:36 +08:00
chn
79cad7f58a users.yxy: add yxy_id_rsa.pub 2023-09-26 17:47:49 +08:00
chn
84ad6e3ae4 packages: prebuild unstablePackages.gcc13Stdenv 2023-09-26 13:52:38 +08:00
chn
6318b938c2 concurrencpp: fix cmake 2023-09-26 12:40:32 +08:00
chn
e21c7a916a add zpp-bits 2023-09-25 21:26:20 +08:00
chn
bdd8e82b4c services.misskey: fix version and add passthru 2023-09-25 16:33:18 +08:00
chn
e967a2511f services: misskey: update 2023-09-25 16:31:22 +08:00
chn
b509fd7a51 ssh: fix hpc ls color 2023-09-25 15:46:18 +08:00
chn
0259ee11ec services: misskey: fix build 2023-09-24 23:23:35 +08:00
chn
473c4f4d17 services: misskey: update 2023-09-24 21:42:40 +08:00
chn
469b765f99 meilisearch: add io limit 2023-09-24 20:47:46 +08:00
chn
ad7be5bc2b matplotplusplus: fix build 2023-09-23 18:44:19 +08:00
chn
fefd22a7eb matplotplusplus: fix build 2023-09-23 18:20:59 +08:00
chn
e4076219e1 add matplotplusplus 2023-09-23 17:33:17 +08:00
chn
8dc5b34cc1 packages: fix p10k instant prompt 2023-09-22 16:48:26 +08:00
chn
4f39c1a1f3 virtualisation: kvmHost: parallel shutdown 2023-09-21 15:46:58 +08:00
chn
cf6e8dff66 packages: update rsshub 2023-09-21 15:33:44 +08:00
chn
cb9665bbb6 Merge branch 'next' 2023-09-21 15:31:19 +08:00
chn
a419838515 ready to merge into main 2023-09-21 15:28:19 +08:00
chn
164c5737d2 packages: zsh: p10k instant prompt set to quiet 2023-09-21 14:06:05 +08:00
chn
91ba3d8ec2 openexr: fix build 2023-09-21 14:03:06 +08:00
chn
9fd8c2d7c6 system: impermanence: clear /home/chn/.cache 2023-09-21 00:10:52 +08:00
chn
11efee5bb3 packages: phonopy: update 2023-09-20 21:36:57 +08:00
chn
677e8111bf flake: default package do not build yoga 2023-09-20 16:52:45 +08:00
chn
d48beec819 system: networking: nebula: always restart 2023-09-20 16:51:46 +08:00
chn
6bf6eabaa3 meilisearch: allow to use 16G memory 2023-09-20 09:18:45 +08:00
chn
273fcbb7c5 packages: enable p10k instant prompt 2023-09-19 21:36:30 +08:00
chn
22aadba0da packages: add eigengdb 2023-09-19 19:47:42 +08:00
chn
5555396f5d vscode: add native debugger 2023-09-19 19:05:40 +08:00
chn
d935330515 lock: downgrade nix-vscode-extensions 2023-09-19 18:51:36 +08:00
chn
a215b50761 vscode: use stable version 2023-09-19 18:44:03 +08:00
chn
52fd57469e packages: update vscode 2023-09-19 18:36:49 +08:00
chn
b003a1be43 packages: add gdb 2023-09-19 16:52:49 +08:00
chn
4bd0b01d9b nixpkgs: currently do not use ccache 2023-09-19 14:29:33 +08:00
chn
c3901eeeb8 packages: add hdfview 2023-09-19 13:15:58 +08:00
chn
77c4a604e9 nixpkgs: enable ccache 2023-09-19 12:33:08 +08:00
chn
7c361dab09 chromium: enable ccache 2023-09-19 12:31:05 +08:00
chn
b9efd5eb70 update everything 2023-09-19 00:41:46 +08:00
chn
1a2d11cef8 nix-store: fix 2023-09-18 23:45:11 +08:00
chn
bfec0e24a0 nginx: externalIp allow multiple ips 2023-09-18 23:33:40 +08:00
chn
de9945635b pc: enable nginx transparent proxy 2023-09-18 23:29:41 +08:00
chn
915fcc348d vps7: enable fontconfig 2023-09-18 21:30:02 +08:00
chn
91475e40d3 security: disable u2f auth for backup key 2023-09-18 20:59:50 +08:00
chn
565b7dd6bc sshd: use key without fido2 pin 2023-09-18 20:46:49 +08:00
chn
5a2b46898d sshd: remove ca key support 2023-09-18 20:25:17 +08:00
chn
3850b9bc05 删除 docker huginn linger
太难搞了,一年之内不再搞
2023-09-18 20:02:33 +08:00
chn
fb8c3cf89d add docker 2023-09-18 19:21:04 +08:00
chn
df5be06957 users: enable linger 2023-09-18 19:08:04 +08:00
chn
894607b933 users: root: enable autoSubUidGidRange 2023-09-18 14:03:17 +08:00
chn
aec4d38497 清理,放弃使用 rootless docker 2023-09-18 14:02:05 +08:00
chn
2312a8398c temp 2023-09-18 06:47:49 +08:00
chn
2e4a542c06 system: set home-manager state version 2023-09-18 05:45:56 +08:00
chn
69c7177b73 users: minor fix 2023-09-18 05:40:04 +08:00
chn
981643af44 users: add linger option 2023-09-18 05:35:56 +08:00
chn
5f88cd5cf5 users: manually import sharedModules 2023-09-18 05:28:02 +08:00
chn
a519053c2a 整理 users 2023-09-18 05:16:38 +08:00
chn
34c0ee6ced add wine-staging 2023-09-17 18:50:42 +08:00
chn
bdc7945e71 Revert "暂存"
This reverts commit beffb2bb95.
2023-09-17 12:48:11 +08:00
chn
beffb2bb95 暂存 2023-09-17 12:48:06 +08:00
chn
77ecc9787c nginx: remove unnecessary acme path 2023-09-16 17:50:45 +08:00
chn
f087027c6b misskey: fix mount options 2023-09-16 16:26:23 +08:00
chn
aad3849ee1 整理 frp 2023-09-16 16:01:23 +08:00
chn
f48a494e4f nginx: httpProxy add rewriteHttps option
nginx: httpProxy add locations support
vaultwarden: init
2023-09-16 15:34:27 +08:00
chn
4463cab071 nginx: fix streamProxy rewriteHttps 2023-09-16 00:22:17 +08:00
chn
286967f7fe meilisearch: remove some IO limits 2023-09-15 22:53:20 +08:00
chn
fc6fa4b1db drop unused machines 2023-09-15 21:52:21 +08:00
chn
a21d4258f2 nginx: fix resolver 2023-09-15 21:21:33 +08:00
chn
4387adde3f nginx: add streamProxy
vps6: enable nginx streamProxy
2023-09-15 20:59:18 +08:00
chn
bb456479b0 disable avx2 for cryptonie 2023-09-15 13:48:48 +08:00
chn
9efc93db49 nas: add user zem, yjq, yxy 2023-09-14 19:11:33 +08:00
chn
2130ded160 nas: enable user xll 2023-09-14 18:50:03 +08:00
chn
d51a8177d6 sshd: allow password authentication 2023-09-14 18:38:10 +08:00
chn
0eb722dab1 整理samba 2023-09-13 23:52:49 +08:00
chn
25995e7dd8 fix permission 2023-09-13 23:32:10 +08:00
chn
da1a328165 users: fix home-manager for xll 2023-09-13 22:27:40 +08:00
chn
040352d30a groupshare: fix permissions 2023-09-13 22:21:16 +08:00
chn
544b071081 fix 2023-09-13 21:21:13 +08:00
chn
f5ff5c3a9e xrdp: allow multiple hostnames 2023-09-13 21:19:08 +08:00
chn
9847e21bff acme: allow multiple domains 2023-09-13 21:13:13 +08:00
chn
4ad8abda21 nas: enable some services 2023-09-13 19:26:56 +08:00
chn
0e7385c408 nas: enable xrayClient 2023-09-13 19:12:32 +08:00
chn
ef7fe907a6 chn: nas use office.chn.moe 2023-09-13 19:05:16 +08:00
chn
48b1480206 programs: fix gpg 2023-09-13 13:51:30 +08:00
chn
eccdd913ed fileSystems: disable acl for vfat 2023-09-13 13:27:35 +08:00
chn
4eaa4f8df2 pc: enable nebula relay
nas: enable nebula relay
2023-09-13 10:25:42 +08:00
chn
1e631be14d nebula: fix firewall rules, allow relay 2023-09-13 10:23:00 +08:00
chn
01213d9eff nebula: use relay 2023-09-13 02:12:52 +08:00
chn
b8dcfa0fd6 groupshare: fix 2023-09-13 02:12:41 +08:00
chn
53be0e13c4 add groupshare (currently not working) 2023-09-12 23:08:35 +08:00
chn
716a4cbfcf fileSystems: set all file systems to neededForBoot 2023-09-12 21:37:47 +08:00
chn
d2c547ca46 nas: install system to ssd 2023-09-12 21:34:48 +08:00
chn
3f917a0cd1 nas: enable xrdp 2023-09-12 20:56:58 +08:00
chn
a1e0e17543 disable baloo for all user 2023-09-12 20:52:41 +08:00
chn
128ce69ce3 nas: enable nebula 2023-09-12 16:38:14 +08:00
chn
58e862661f 整理 users 2023-09-12 16:31:20 +08:00
chn
84effe92c6 nebula: bypass xray client transparent proxy 2023-09-12 12:27:22 +08:00
chn
f5ae7b00f9 add vlc 2023-09-11 20:33:49 +08:00
chn
e7fd01b42f update openexr 2023-09-11 10:23:36 +08:00
chn
6215e59f74 workstation: add gcc13Stdenv to prebuildPackages 2023-09-10 22:58:24 +08:00
chn
228a538819 fix concurrencpp include path 2023-09-10 21:53:18 +08:00
chn
a08c325d86 add concurrencpp 2023-09-10 21:23:22 +08:00
chn
007438ba1f pe: add deploy 2023-09-10 18:09:48 +08:00
chn
9b03c80b9a nas: enable gui 2023-09-10 17:03:26 +08:00
chn
eef8b0f312 set gcc flags for unstablePackages 2023-09-10 16:40:19 +08:00
chn
dfcd4582ba nas: enable deploy 2023-09-10 15:32:32 +08:00
chn
0fc95d4abf ssh: fix authorized_keys 2023-09-10 15:31:39 +08:00
chn
32712534e4 set nas ip 2023-09-10 15:26:34 +08:00
chn
e7df638e35 nas: final setup 2023-09-10 15:07:19 +08:00
chn
eba953b7ad waydroid use unstablePackages 2023-09-10 14:35:08 +08:00
chn
b286d9c8dc update nixpkgs 2023-09-10 12:05:08 +08:00
chn
14d61eb3a7 pe: enable kvmGuest 2023-09-10 11:20:33 +08:00
chn
77b8330ed5 Revert "nixpkgs: use generic haskellPackages"
This reverts commit fd13864f48.
2023-09-10 01:51:40 +08:00
chn
fd13864f48 nixpkgs: use generic haskellPackages 2023-09-10 00:31:00 +08:00
chn
b4792327e6 Revert "nixpkgs: use generic pandoc"
This reverts commit 558a61a0f1.
2023-09-10 00:26:51 +08:00
chn
558a61a0f1 nixpkgs: use generic pandoc 2023-09-10 00:23:53 +08:00
chn
87db616f7e add krita 2023-09-09 21:38:53 +08:00
chn
96271f7ac6 fileSystems: fix mdadm 2023-09-09 21:22:56 +08:00
chn
bc9c2a45d4 pc 基本上编译通过 2023-09-09 14:15:57 +08:00
chn
40dec0e342 Merge branch 'main' into stable 2023-09-09 11:11:53 +08:00
chn
812d646adc systemd: fix coredump 2023-09-09 00:40:39 +08:00
chn
6f166dcb80 update nur 2023-09-08 10:28:18 +08:00
chn
3ea27ee691 Revert "misskey: fix systemd shutdown"
This reverts commit 6d2c08e434.
2023-09-08 08:40:52 +08:00
chn
2615ed6437 暂存 2023-09-08 05:49:52 +08:00
chn
7c674ebbf9 update everything 2023-09-07 11:43:05 +08:00
chn
6d2c08e434 misskey: fix systemd shutdown 2023-09-07 04:17:24 +08:00
chn
6d1266b2b4 restart misskey everyday 2023-09-07 03:58:02 +08:00
chn
b402bff18b add v_sim 2023-09-06 20:04:23 +08:00
chn
eceb956c5e add huginn 2023-09-06 17:58:46 +08:00
chn
6aca2d605d update cjktty 2023-09-06 16:50:31 +08:00
chn
42879f22cb add bundix 2023-09-06 16:44:55 +08:00
chn
04bf86f89e kernel: update 2023-09-06 13:06:02 +08:00
chn
d5cd5d256e vasp: use openmpi without cuda support 2023-09-06 02:14:56 +08:00
chn
12705172fb Revert "disable nix-ld"
This reverts commit c146f56df5.
2023-09-06 01:43:16 +08:00
chn
865f2c3c78 vesta: fix build 2023-09-06 01:43:02 +08:00
chn
c146f56df5 disable nix-ld 2023-09-06 01:22:42 +08:00
chn
c5a9da5a4b add openbox 2023-09-06 00:19:19 +08:00
chn
63ee2ce5d9 slack: use stablePackages 2023-09-06 00:18:50 +08:00
chn
ed7d9b1fb7 meilisearch: limit io 2023-09-05 22:54:40 +08:00
chn
8bf884e09c Revert "use xorg as default session"
This reverts commit 4a93baf5de.
2023-09-05 21:00:23 +08:00
chn
0ede3816f5 intel: allow to use modesetting driver 2023-09-05 20:57:55 +08:00
chn
71681f75ec xrdp: fix 2023-09-05 20:10:46 +08:00
chn
4fb686af8a i915: try to no use modesetting driver 2023-09-05 20:08:27 +08:00
chn
244e690908 xrdp: fix ssl group 2023-09-05 19:47:57 +08:00
chn
7aebf47beb add xrdp 2023-09-05 17:17:43 +08:00
chn
14adcecc06 pc: enable misskey
add genymotion
2023-09-05 13:37:35 +08:00
chn
ff5c9b6701 add cage 2023-09-05 10:47:58 +08:00
chn
b79e06f52a add weston 2023-09-05 10:17:11 +08:00
chn
99213b8135 add 12to11 2023-09-05 09:50:37 +08:00
chn
4a93baf5de use xorg as default session 2023-09-05 01:51:39 +08:00
chn
d8dd5d7034 remove variable NIXOS_OZONE_WL 2023-09-05 01:42:03 +08:00
chn
1171f8d2b0 fix obs-studio 2023-09-05 01:31:27 +08:00
chn
ac17e255c1 Revert "add slack"
This reverts commit 6050d12010.
2023-09-05 00:50:33 +08:00
chn
6050d12010 add slack 2023-09-05 00:49:39 +08:00
chn
86e2c18d70 add slack 2023-09-05 00:30:10 +08:00
chn
eaaf70ffc8 xray: proxy zoom 2023-09-05 00:16:30 +08:00
chn
aaafe6a660 update zoom 2023-09-05 00:06:12 +08:00
chn
9fcc05fc22 add vaspkit 2023-09-04 23:23:46 +08:00
chn
5fbe508b33 add vasp gnu 2023-09-04 19:26:33 +08:00
chn
b218ac50b1 workstation: add vasp and phonon-unfolding 2023-09-03 22:48:20 +08:00
chn
d7e5e5aba9 nixpks: add option oneapiArch
nomacs: fix build with cuda
vasp: add vasp
phonon-unfolding: add phonon-unfolding
2023-09-03 22:46:18 +08:00
chn
6faed2aed6 vps7: enable gui 2023-09-03 18:20:32 +08:00
chn
2a2654ae2b nixpkgs: add cudaSupport 2023-09-03 17:17:10 +08:00
chn
267279bc81 misskey: use nebula to proxy 2023-09-03 16:53:56 +08:00
chn
203fc9cffd synapse: use nebula to proxy 2023-09-03 16:36:28 +08:00
chn
1a8b47032f nebula: add nebula.nebula to trustedInterfaces 2023-09-03 16:10:12 +08:00
chn
3671fde36b vps7: enable nebula 2023-09-03 14:37:38 +08:00
chn
ac9a792095 impermanence: enable nodatacow by default
impermanence: persist /var/backup
2023-09-03 14:23:43 +08:00
chn
99043047db move nebula to system.networking 2023-09-02 22:28:51 +08:00
chn
7e15a7f3b3 move sops to system 2023-09-02 22:11:08 +08:00
chn
4483e28dfe 整理 system.security 2023-09-02 21:47:12 +08:00
chn
289ed2fb27 整理 systemd.security 2023-09-02 21:39:01 +08:00
chn
438d1181ff 整理 system.networking 2023-09-02 21:33:09 +08:00
chn
b2ccf88adc 整理 system.nixpkgs 2023-09-02 21:21:29 +08:00
chn
6305555760 整理 system.gui 2023-09-02 21:03:23 +08:00
chn
6b8d105349 fix build 2023-09-02 16:55:49 +08:00
chn
5132bded49 将 impermanence 移到 system 模块中 2023-09-02 16:40:17 +08:00
chn
b00a0b51e7 增加 phpfpm 2023-09-02 16:30:21 +08:00
chn
e6969fb0c2 整理 system.kernel 2023-09-02 15:25:05 +08:00
chn
e1e88dfdba 整理 system.initrd 2023-09-02 15:07:16 +08:00
chn
72571d5d88 整理 system.grub 2023-09-02 14:54:37 +08:00
chn
0a7e808b6c 整理 system.fileSystems 2023-09-02 14:21:27 +08:00
chn
2d5397b0f1 整理 system.nix 2023-09-02 14:04:03 +08:00
chn
0115d96f11 add todo 2023-09-02 00:00:48 +08:00
chn
15ca93ada1 Revert "分离 nix 配置"
This reverts commit 9ff5212fe7.
2023-09-01 23:49:45 +08:00
chn
9ff5212fe7 分离 nix 配置 2023-09-01 23:44:51 +08:00
chn
735217d1b8 修改 hostname 为 pc 2023-09-01 21:18:09 +08:00
chn
3e029b25a5 tab 替换为空格 2023-09-01 21:05:26 +08:00
chn
0d46532922 add dguibert-nur-packages (nvhpc) 2023-09-01 14:37:51 +08:00
chn
9902ce82f8 add fake packages to build system
nix registry nixos-config to nixos
2023-09-01 02:09:16 +08:00
chn
c407e6c56c 打包,打个屁,人家都已经写好了 2023-09-01 01:54:15 +08:00
chn
7511fbacf1 暂存 2023-08-31 22:22:50 +08:00
chn
83959b68cc oneapi: 重新打包 2023-08-31 21:37:11 +08:00
chn
fe0130fa9d 整理 2023-08-31 18:53:48 +08:00
chn
9aab39149a update vscode extensions
use nil
2023-08-31 18:38:55 +08:00
chn
b013ca70b3 pc: enable nebula
nebula fix firewall
2023-08-31 17:37:45 +08:00
chn
9ae78ee549 vps6 enable nebula 2023-08-31 17:20:17 +08:00
chn
82c5d9c087 packages: add libfido2 to udev.packages 2023-08-31 16:38:09 +08:00
chn
b9ed4609f8 add yubico-piv-tool 2023-08-31 16:23:47 +08:00
chn
2415889698 coturn: allow both tls and non-tls connections
synapse: coturn use both tls and non-tls connections
2023-08-31 01:27:42 +08:00
chn
613bbb8513 coturn: change port to 5349
synapse: coturn use default port, allow both tcp and udp
2023-08-30 23:56:52 +08:00
chn
e413b16605 synapse: coturn set port 2023-08-30 23:49:51 +08:00
chn
b679bc595a synapse: coturn use udp 2023-08-30 23:40:41 +08:00
chn
c5974e5d5d coturn: set port to 3478
synapse: use turns instead of turn
2023-08-30 23:36:04 +08:00
chn
d5673acf64 nginx: allow port 80
coturn: allow ports
2023-08-30 23:24:50 +08:00
chn
0dd3c2b03d meilisearch: remove IODeviceLatencyTargetSec 2023-08-30 22:16:38 +08:00
chn
db5c126098 postgresql: enable autovacuum 2023-08-30 21:49:18 +08:00
chn
1fe0be0d82 meilisearch: lower IO priority 2023-08-30 21:39:34 +08:00
chn
9d98d1ac4d meilisearch: use idle scheduling 2023-08-30 20:26:53 +08:00
chn
d6cc45bdb8 meilisearch: set max_indexing_threads to 1 2023-08-30 20:21:52 +08:00
chn
0cdefd8d79 Revert "misskey: remove meilisearch"
This reverts commit a3a5ab23c0.
2023-08-30 20:08:08 +08:00
chn
a3a5ab23c0 misskey: remove meilisearch 2023-08-30 20:00:37 +08:00
chn
0296ca679f nginx: fix 2023-08-30 16:14:08 +08:00
chn
f2c975999c deploy: disable automatic rollback 2023-08-30 16:05:37 +08:00
chn
5d21d29aac postgresql: use native package 2023-08-30 16:01:27 +08:00
chn
bb407addda nginx: increase proxy timeouts 2023-08-30 15:51:10 +08:00
chn
65232df9c7 postgresql: enable automatic backups 2023-08-30 15:46:04 +08:00
chn
72b566a4bf postgresql: disable autovacuum
synapse: fix
system: disable coredump
2023-08-30 15:42:14 +08:00
chn
6f6305df95 postgresql: increase shared_buffers and work_mem 2023-08-30 00:56:15 +08:00
chn
ea87dbff76 change default locale 2023-08-30 00:55:48 +08:00
chn
d5b355d4e7 synapse: try to workaround config merge bug 2023-08-29 23:11:49 +08:00
chn
3516842bd7 synapse: move email config to secrets 2023-08-29 22:45:41 +08:00
chn
9e2b761ffa Revert "synapse: try to fix yaml escaping"
This reverts commit 8fbab0285e.
2023-08-29 22:45:05 +08:00
chn
8fbab0285e synapse: try to fix yaml escaping 2023-08-29 22:40:42 +08:00
chn
76a237694c add synapse 2023-08-29 22:15:58 +08:00
chn
0a40f47aab enable coturn for vps6 2023-08-29 20:28:11 +08:00
chn
67f6ec0d7c xray: fix client dns 2023-08-29 17:25:30 +08:00
chn
d2b29999ff Revert "xray: fix client dns settings"
This reverts commit 0b966ab1da.
2023-08-29 17:06:15 +08:00
chn
0b966ab1da xray: fix client dns settings 2023-08-29 17:01:30 +08:00
chn
af1b40b0f6 packages: add nix-tree 2023-08-29 15:50:31 +08:00
chn
a6f2709e3a disable failed tests 2023-08-29 12:48:36 +08:00
chn
86a4f05bc1 packages: move python to server 2023-08-29 11:23:48 +08:00
chn
8a55ead16c packages: add some python packages 2023-08-29 11:11:57 +08:00
chn
793f2c9e0a misskey: increase statement_timeout 2023-08-29 10:32:09 +08:00
chn
f4916eed5d postgresql: enable autovacuum 2023-08-29 10:30:32 +08:00
chn
d5a64fa9d3 chromium: use stable version 2023-08-29 00:50:57 +08:00
chn
28a5a2d729 rsshub: update 2023-08-29 00:07:34 +08:00
chn
8f3125fec1 Merge branch 'vps7' 2023-08-28 17:42:57 +08:00
chn
303eef80d9 fix build 2023-08-28 14:56:30 +08:00
chn
fb8d4e4b89 meilisearch: increase max_indexing_memory 2023-08-28 11:07:22 +08:00
chn
fce5491d6b vps7: change ip 2023-08-28 10:28:59 +08:00
chn
be5961d156 kernel add broadwell support 2023-08-28 01:10:23 +08:00
chn
287abc8907 vps7 change to broadwell 2023-08-28 01:06:05 +08:00
chn
7a73b7d9c1 chn-PC: allow compile broadwell 2023-08-28 01:05:12 +08:00
chn
5cc4dda9b1 meilisearch: optimise for performance
system: set NIX_PATH
system: add substituters
2023-08-27 22:14:31 +08:00
chn
959a4d448c use native meilisearch 2023-08-27 20:27:15 +08:00
chn
d77c2fdd85 meilisearch: RUST_BACKTRACE = "full"
mk-meili-mgn: update to 20230827
2023-08-27 19:10:21 +08:00
chn
fab096a46c meilisearch: use musl generic 2023-08-27 18:00:13 +08:00
chn
c72665bbf6 meilisearch: use musl 2023-08-27 16:44:23 +08:00
chn
0ad8903f01 vps7 enable nodatacow 2023-08-27 11:36:21 +08:00
chn
b9b9d97c02 meilisearch: use 2GB of memory for indexing 2023-08-27 10:20:53 +08:00
chn
4e02b3aaa6 xray: 8.8.8.8 force proxy 2023-08-27 10:08:49 +08:00
chn
a622daaa40 分离 xray 的设置 2023-08-27 09:54:05 +08:00
chn
a50275f54a try to fix meilisearch 2023-08-27 02:04:00 +08:00
chn
440d01745c enable ssh compression 2023-08-27 01:06:41 +08:00
chn
49dec3a2b3 systemd auto clean journal 2023-08-27 00:59:22 +08:00
chn
98ff90f8ad fix nginx geoip2 log 2023-08-27 00:39:30 +08:00
chn
cc3842f450 disable misskey test 2023-08-27 00:38:09 +08:00
chn
01749a6e41 nginx enable reload 2023-08-27 00:35:43 +08:00
chn
cf98f233a3 fix meilisearch files permissions 2023-08-27 00:33:59 +08:00
chn
46eb62fdb6 完成misskey 2023-08-26 23:55:14 +08:00
chn
e1c84dad25 update meilisearch 2023-08-26 22:59:15 +08:00
chn
3c2285704b 准备部署 misskey 2023-08-26 18:00:01 +08:00
chn
6d09435a2c enable misskey 2023-08-26 15:05:15 +08:00
chn
9d78bf0470 misskey proxy allow multiple instances 2023-08-26 14:12:06 +08:00
chn
fd0c285a47 fix meilisearch 2023-08-26 13:47:45 +08:00
chn
dce8fe8cda misskey add meilisearch 2023-08-26 13:30:35 +08:00
chn
736f84b105 add meilisearch 2023-08-26 12:17:30 +08:00
chn
87fc499bfe add mk-meili-mgn 2023-08-26 12:03:01 +08:00
chn
23c5063307 update kernel 2023-08-26 11:08:09 +08:00
chn
0d0dc6ed29 Revert "Revert "update kernel""
This reverts commit 8c53e5a6ae.
2023-08-26 10:43:46 +08:00
chn
935d7ef64c fix nginx 2023-08-26 01:27:04 +08:00
chn
bef540c0cc fix nginx 2023-08-26 01:00:32 +08:00
chn
f5a2ecdb39 fix nginx 2023-08-26 00:32:10 +08:00
chn
773cfb5e99 fix nginx 2023-08-26 00:12:15 +08:00
chn
43c6ac6448 nginx add log 2023-08-25 23:54:04 +08:00
chn
2ef8957aab fix 2023-08-25 23:22:47 +08:00
chn
fa4caaa2e9 fix 2023-08-25 23:18:13 +08:00
chn
d60a991eac enable 铜锣湾实验室 2023-08-25 22:55:33 +08:00
chn
b7c890a206 misskey 增加代理,并准备部署到 vps7 2023-08-25 22:32:43 +08:00
chn
56998a5f6d move nginx to a separate file 2023-08-25 20:53:31 +08:00
chn
3af36c2219 完成misskey服务 2023-08-25 19:36:09 +08:00
chn
8c53e5a6ae Revert "update kernel"
This reverts commit e2e7d5d49c.
2023-08-25 18:47:26 +08:00
chn
f2d7260390 fix misskey services 2023-08-25 18:46:26 +08:00
chn
c92e834908 add misskey 2023-08-25 18:25:34 +08:00
chn
b339ffc1c7 fix 2023-08-25 08:42:22 +08:00
chn
e2e7d5d49c update kernel 2023-08-25 08:38:36 +08:00
chn
e16c8f70aa successfully packaged misskey 2023-08-25 07:13:55 +08:00
chn
a6e9f27c29 vscode add mathematica support 2023-08-24 20:57:14 +08:00
chn
43861e19b5 only workstation should build chromium 2023-08-23 20:30:36 +08:00
chn
39dbad2031 add nas xmupc1 to all system 2023-08-23 20:22:27 +08:00
chn
4ce21c55e2 fix rsshub 2023-08-23 17:38:47 +08:00
chn
43bd2adfcc fix rsshub 2023-08-23 17:32:13 +08:00
chn
ef32ce14bb try to fix rsshub services 2023-08-23 16:52:23 +08:00
chn
270e190408 fix rsshub environment file 2023-08-23 16:37:38 +08:00
chn
36221f3ed7 Revert "try to reuse pnpm store"
This reverts commit 2830032fa9.
2023-08-23 16:17:43 +08:00
chn
2830032fa9 try to reuse pnpm store 2023-08-23 16:16:46 +08:00
chn
561a65e758 update pnpm2nix-nzbr 2023-08-23 16:08:17 +08:00
chn
4809faf38c update firefoxpwa 2023-08-23 15:18:14 +08:00
chn
7dae66f6bb firefox enable pwa 2023-08-23 14:10:10 +08:00
chn
c6638965b2 finally finish rsshub 2023-08-23 13:34:58 +08:00
chn
6b2f088cad 完成打包 rsshub 2023-08-23 07:52:47 +08:00
chn
ebd222abe7 暂存打包结果 2023-08-23 07:22:53 +08:00
chn
ff056eee8b 整理rsshub(还不能用) 2023-08-22 21:10:53 +08:00
chn
fc69608ec0 add pe 2023-08-22 16:53:33 +08:00
chn
95de4be396 enabel chromium 2023-08-21 23:06:39 +08:00
chn
74790adf51 放弃misskey打包 2023-08-21 21:23:02 +08:00
chn
52682a88c8 偷来一个misskey的打包 2023-08-21 20:57:15 +08:00
chn
1a1860d214 整理系统配置 2023-08-21 19:53:39 +08:00
chn
606a5823e5 default build yoga 2023-08-21 19:25:45 +08:00
chn
44888d963b set vim 2023-08-21 16:23:28 +08:00
chn
d218a03517 add ssh config 2023-08-21 15:55:40 +08:00
chn
0e69a9d0c4 customize git 2023-08-21 15:26:18 +08:00
chn
26a41318fa disable ussh
enable yubicoAuth for all
fix u2f
2023-08-21 13:32:41 +08:00
chn
249b5983c9 fix yoga boot 2023-08-21 12:15:20 +08:00
chn
9fd73fa3fd fix yoga config 2023-08-21 11:44:20 +08:00
chn
35e7f25a14 setup yoga sops 2023-08-21 02:23:30 +08:00
chn
403742c4f7 enable gamemode 2023-08-21 01:38:14 +08:00
chn
4bae6952ba 补回deploy的配置 2023-08-21 01:20:53 +08:00
chn
84ba2e1c95 fix yoga config 2023-08-21 00:39:22 +08:00
chn
f7bd41ee94 整理输入 2023-08-20 23:49:18 +08:00
chn
cb0363c439 fix build 2023-08-20 23:44:15 +08:00
chn
5f6db7ee9b update system config 2023-08-20 23:12:12 +08:00
chn
3b00659257 test on different compress level: default is enough 2023-08-20 23:10:08 +08:00
chn
78dad12e2c add deploy-rs 2023-08-20 21:39:36 +08:00
chn
78ca1676d7 try deploy-rs 2023-08-20 20:53:35 +08:00
chn
e20dae7d8b add deploy-rs 2023-08-20 20:13:24 +08:00
chn
437fda515e btrfs zstd:8 2023-08-20 18:34:03 +08:00
chn
df2a5982eb add texstudio 2023-08-20 17:34:18 +08:00
chn
59ead7ad36 xray enable socks5 proxy 2023-08-20 13:55:54 +08:00
chn
d73d16df74 fix build 2023-08-20 12:48:05 +08:00
chn
299bcf5003 增加huginn(还没有写完) 2023-08-20 12:42:07 +08:00
chn
6769b0925b 移动 rootless docker 的定义位置 2023-08-20 12:29:50 +08:00
chn
b670b6bf4f add postgresql 2023-08-20 12:19:56 +08:00
chn
b93c3736bb Merge branch 'rootless-docker' 2023-08-20 11:21:14 +08:00
chn
a565d30ed2 update intput 2023-08-20 10:41:01 +08:00
chn
5743f4c858 add neofetch 2023-08-20 09:24:38 +08:00
chn
a267b2c0c9 disable test for silvermon 2023-08-19 20:18:53 +08:00
chn
8129993552 yoga bootstrap 2023-08-19 12:08:34 +08:00
chn
14e323a9c1 Merge branch 'new-machine' 2023-08-19 11:40:45 +08:00
chn
cbe8946066 use nixpkgs unstable 2023-08-19 11:40:04 +08:00
chn
a4f6c0ffb8 update vscode 2023-08-19 10:55:07 +08:00
chn
99f392a724 add etcher 2023-08-19 02:26:03 +08:00
chn
a2a65f715a Revert "将许多软件包移动到 workstatioin"
This reverts commit b595c6ed77.
2023-08-19 02:23:28 +08:00
chn
b595c6ed77 将许多软件包移动到 workstatioin 2023-08-19 02:17:05 +08:00
chn
c111152569 bootstrap for pe 2023-08-18 22:48:56 +08:00
chn
ebb8c11c62 add nya.one to proxy 2023-08-18 22:18:24 +08:00
chn
9ea13a5a63 disable failed test 2023-08-18 20:39:37 +08:00
chn
4544091766 add clang-git 2023-08-18 13:24:42 +08:00
chn
5a21f39ccd add yoga 2023-08-18 13:04:04 +08:00
chn
bfb95385f8 move fix of embree into bugs 2023-08-18 03:41:44 +08:00
chn
2c36999f22 disable failed test for znver3 2023-08-18 03:39:37 +08:00
chn
8734367d98 add some vscode extentions
add fprettify
2023-08-18 01:11:34 +08:00
chn
e84874e2c9 fix embree for znver3 2023-08-17 23:50:05 +08:00
chn
77f01f7f27 update nvidia driver 2023-08-17 23:15:47 +08:00
chn
4aafad2b4a disable failed test for znver3 2023-08-17 20:39:52 +08:00
chn
cb827cf987 Revert "update vscode and extensions"
This reverts commit a13d2959bc.
2023-08-17 19:24:29 +08:00
chn
a13d2959bc update vscode and extensions 2023-08-17 15:54:12 +08:00
chn
3a1b365112 disable firefox for xmupc1 2023-08-17 14:05:03 +08:00
chn
5e6ddd0c03 disable failed test for znver3 2023-08-17 11:22:09 +08:00
chn
24111b6adf vscode add ccls 2023-08-17 10:49:10 +08:00
chn
eea572e812 update clangd to 16 2023-08-17 04:40:23 +08:00
chn
590f5053a5 move v2ray-forwarder from touchix to local
add proxy_net
2023-08-17 03:34:37 +08:00
chn
6449223f2e disable failed test for znver3 2023-08-17 02:15:50 +08:00
chn
7427e5720c max-jobs set to 2 2023-08-17 00:37:14 +08:00
chn
2da2507edb disable failed test for znver3 2023-08-16 23:49:25 +08:00
chn
82f24ac02c Revert "zsrd compression level set to 8"
This reverts commit 1bf90af888.
2023-08-16 22:47:12 +08:00
chn
1bf90af888 zsrd compression level set to 8 2023-08-16 21:31:19 +08:00
chn
60ec759e7d 编译通过 2023-08-16 20:22:27 +08:00
chn
14ce29fd6c add rootless docker 2023-08-16 19:51:55 +08:00
chn
10f9b719f4 fix xmupc1 secret 2023-08-16 18:07:48 +08:00
chn
d3951a924b fix xmupc1 secrets 2023-08-16 17:08:15 +08:00
chn
d57f985d52 fix silvermont build 2023-08-16 02:36:05 +08:00
chn
642da4d9ea add nas and xmupc1 2023-08-16 02:34:22 +08:00
chn
9167fbfb04 init nas 2023-08-16 02:16:27 +08:00
chn
bb2dc2d8b0 add toplevel virtual package 2023-08-16 01:33:29 +08:00
chn
e298ffc41f fix xmupc1 build 2023-08-16 01:05:37 +08:00
chn
5366644661 xmupc1 init 2023-08-16 01:00:39 +08:00
chn
add7b0333d Revert "test"
This reverts commit d621a2230c.
2023-08-15 17:24:08 +08:00
chn
d621a2230c test 2023-08-15 17:16:16 +08:00
chn
e8f8818604 fix wallabag 2023-08-15 16:40:12 +08:00
chn
0282024b55 currently disable wallabag mailer 2023-08-15 16:26:46 +08:00
chn
1206baf90f fix wallabag 2023-08-15 16:22:06 +08:00
chn
8741456752 fix wallabag mail 2023-08-15 15:17:03 +08:00
chn
0cce2683d9 try to run oci without root 2023-08-15 02:50:03 +08:00
chn
43371859a8 fix wallabag init db 2023-08-15 01:34:13 +08:00
chn
eae709a7fb fix postgresql authentication 2023-08-15 01:29:12 +08:00
chn
85d4e22b65 enable wallabag to vps7 2023-08-15 01:10:28 +08:00
chn
4388d82d4d enable postgresql for vps7 2023-08-15 00:53:30 +08:00
chn
990c4f656b fix vps7 nginx 2023-08-15 00:02:54 +08:00
chn
8a91ce4405 rsshub should enable nginx 2023-08-14 23:55:43 +08:00
chn
f7f7680a68 docker shoud set firewall 2023-08-14 23:52:44 +08:00
chn
38db6aa28c fix docker nvidia 2023-08-14 23:21:23 +08:00
chn
661b45a02d oci need docker enable 2023-08-14 23:18:14 +08:00
chn
1c91496dc7 add nix-prefetch-docker 2023-08-14 22:29:12 +08:00
chn
e72c967cbf fix nginx ssl 2023-08-14 22:21:00 +08:00
chn
b5c8905b22 move rsshub to vps7 2023-08-14 22:11:57 +08:00
chn
c83385f63f add rsshub 2023-08-14 22:08:44 +08:00
chn
d5ad02aa23 add rsshub 2023-08-14 20:57:56 +08:00
chn
0d7e8654af add more _prebuildPackages 2023-08-14 20:19:12 +08:00
chn
348dd4df4f enable more insecure packages 2023-08-14 20:09:57 +08:00
chn
fff2ec5c38 set docker dns to 1.1.1.1 2023-08-14 18:49:22 +08:00
chn
ec51b4122c fix misskey (not working) 2023-08-14 18:31:50 +08:00
chn
06531833ea add misskey (not working) 2023-08-14 17:59:50 +08:00
chn
942347c4d3 enable postgresql 2023-08-14 17:07:57 +08:00
chn
9f13838c97 fix config for vps7 2023-08-14 15:57:42 +08:00
chn
495cb862bf acme use google dns 2023-08-14 14:36:21 +08:00
chn
3ccf8b4013 nix-store compress at local 2023-08-14 14:25:21 +08:00
chn
2703424f56 add nginx maxmind license 2023-08-14 14:01:05 +08:00
chn
bc351fec9a enable nginx for PC 2023-08-14 13:59:32 +08:00
chn
28c8cc8a77 max-jobs set to 4 2023-08-14 13:58:18 +08:00
chn
cb1cefcbf3 nix-serve enable nginx proxy 2023-08-14 13:57:37 +08:00
chn
a5b1afc357 xray server do not force enable nginx 2023-08-14 13:51:59 +08:00
chn
ee3e6b293c allow to only enable nginx without transparent proxy 2023-08-14 13:49:17 +08:00
chn
f301ab22e9 adjust nginx config 2023-08-14 02:30:36 +08:00
chn
fc1a18a3f3 remove fileshelter 2023-08-14 02:16:53 +08:00
chn
f203ba62cc adjust some nginx settings 2023-08-14 02:14:37 +08:00
chn
ea9ff4dd85 bootstrap for vps7 2023-08-14 00:54:46 +08:00
chn
ce55cf8477 fix fileshelter user 2023-08-14 00:34:43 +08:00
chn
b4f3550483 nginx use geoip2 2023-08-14 00:11:48 +08:00
chn
49e25ed3cd remove send, add fileshelter 2023-08-13 23:24:47 +08:00
chn
78ac8125bd nginx allow to disable http2 2023-08-13 22:43:34 +08:00
chn
2a8cd527e3 nginx fix websocket client_max_body_size 2023-08-13 22:20:03 +08:00
chn
0618320b1b change port 2023-08-13 21:58:14 +08:00
chn
0d1d7b4301 fix docker image 2023-08-13 21:56:39 +08:00
chn
23ffdd7ac5 fix docker env 2023-08-13 21:46:59 +08:00
chn
75dc69fd6d enable socket for redis 2023-08-13 21:39:46 +08:00
chn
f003ee374e fix env file 2023-08-13 21:31:16 +08:00
chn
605694369e oci use docker 2023-08-13 21:20:13 +08:00
chn
56d53876be 整理 nginx config 2023-08-13 21:15:10 +08:00
chn
589194cce8 fix nginx config 2023-08-13 21:11:48 +08:00
chn
327e294a14 fix nginx conf 2023-08-13 21:08:05 +08:00
chn
f53b8c3a20 fix nginx listen 2023-08-13 21:02:56 +08:00
chn
c3331ae425 enable send for vps6 2023-08-13 20:53:42 +08:00
chn
0ea315017e add send 2023-08-13 19:42:41 +08:00
chn
54c637dc30 add node2nix 2023-08-13 15:20:22 +08:00
chn
27a3c12256 xray add user 2023-08-13 13:47:11 +08:00
chn
601f65e905 bootstrap using znver3 2023-08-13 13:33:45 +08:00
chn
76c6f6636f modify nix-store config 2023-08-13 13:25:06 +08:00
chn
14ac2708d8 fix vps4 config 2023-08-13 13:21:54 +08:00
chn
8e956b31ce bootstrap for vps4 2023-08-13 13:12:45 +08:00
chn
6547b88dcb fix nginx geoip 2023-08-13 02:56:41 +08:00
chn
257839b75a fix nginx http proxy 2023-08-13 02:42:24 +08:00
chn
49572a9a68 修改xray dns 2023-08-13 02:38:16 +08:00
chn
41b1dee098 enable geoip 2023-08-13 02:30:44 +08:00
chn
e91ba3f34d use old zip 2023-08-13 02:02:09 +08:00
chn
962cd34d66 xray lower min version 2023-08-13 01:35:00 +08:00
chn
3bbb6fb8e1 fix nginx config 2023-08-13 00:18:47 +08:00
chn
593391a894 使用 xray reality 2023-08-12 23:58:18 +08:00
chn
ee079b4251 fix nginx stream listen 2023-08-12 22:21:11 +08:00
chn
2825b0a28b fix nginx log 2023-08-12 22:11:42 +08:00
chn
a1cbd3949e xray enable fingerprint filter 2023-08-12 20:00:59 +08:00
chn
bc2f78d2e7 enable patched nginx 2023-08-12 19:13:24 +08:00
chn
c87bc53a24 add nginx httpProxy 2023-08-12 11:58:01 +08:00
chn
77cff8e03f 增加xray用户数量 2023-08-12 01:12:13 +08:00
chn
54461b6898 switch to unstable branch 2023-08-12 01:03:55 +08:00
chn
9a01ebb8dd Merge branch 'next' 2023-08-12 01:03:25 +08:00
chn
f311d441b8 fix xray stat 2023-08-12 00:58:28 +08:00
chn
b6a2de9983 fix netease cloud music 2023-08-12 00:42:15 +08:00
chn
ca85199c55 fix xray-stat 2023-08-12 00:25:56 +08:00
chn
19ffbf964f move zellij 2023-08-11 18:24:43 +08:00
chn
a9a52df312 fix build 2023-08-11 16:35:53 +08:00
chn
fe62b6bd81 Merge branch 'main' into next 2023-08-11 16:22:45 +08:00
chn
682cf2766f correct secrets permissions 2023-08-11 15:34:57 +08:00
chn
647e9b4463 fix xray stat 2023-08-11 15:19:56 +08:00
chn
baf5c5c9e4 fix xray stat 2023-08-11 15:08:02 +08:00
chn
274aa913e8 fix xray traffic stats 2023-08-11 15:02:42 +08:00
chn
54c200539d fix xray stat 2023-08-11 14:52:39 +08:00
chn
1391870957 启用 xray stat 2023-08-11 14:45:38 +08:00
chn
9a1dbe801f xrayServer 启用统计 2023-08-11 12:52:20 +08:00
chn
97496005cc add cinny 2023-08-11 12:25:09 +08:00
chn
0a48e6ffae fix yubikey build 2023-08-11 09:38:18 +08:00
chn
a50ebef28a fix xray server 2023-08-11 02:34:52 +08:00
chn
528cb94b54 add initrd.vps6.chn.moe 2023-08-11 02:31:59 +08:00
chn
ab2361a222 try to fix roll rootfs 2023-08-11 02:20:42 +08:00
chn
b083924e84 xray server openai use local dns 2023-08-11 01:31:02 +08:00
chn
68859d4da4 disable failed test for alderlake 2023-08-10 23:21:59 +08:00
chn
2a8becd0ce Merge branch 'main' into next 2023-08-10 21:22:06 +08:00
chn
b490fa1bf9 remove special dns for openai.com 2023-08-10 21:04:16 +08:00
chn
d45404966f force openai.com use forign dns 2023-08-10 20:54:31 +08:00
chn
c086db4ae7 dnsmasq log query 2023-08-10 20:47:59 +08:00
chn
5bb0f1f60d fix xray routing 2023-08-10 20:43:10 +08:00
chn
f132d8b53b xray 使用明文服务器地址 2023-08-10 20:20:17 +08:00
chn
c30e1d5e4d fix nginx permission 2023-08-10 20:06:49 +08:00
chn
725adb574c fix xray server 2023-08-10 19:55:08 +08:00
chn
e72fe79441 enable xray server for vps6 2023-08-10 19:43:28 +08:00
chn
9962a562c2 fix nginx stream config 2023-08-10 17:53:48 +08:00
chn
72a1c5c489 enabel nginx transparent proxy for vps6 2023-08-10 17:50:08 +08:00
chn
413820c427 disable failed test for alderlake 2023-08-10 16:52:42 +08:00
chn
13d1cd8d2d enable smartd 2023-08-10 10:15:21 +08:00
chn
7bb359c4e0 bump crow translate 2023-08-10 03:21:32 +08:00
chn
534a9ad602 Revert "use last kernel"
This reverts commit 8bc6403905.
2023-08-10 02:29:09 +08:00
chn
b5b2e369ed fix kernel5.4-sof patch 2023-08-10 02:23:51 +08:00
chn
92c4780c91 fix some deprecated options 2023-08-09 22:05:51 +08:00
chn
68afba0e95 change some nix config 2023-08-09 21:26:30 +08:00
chn
8bc6403905 use last kernel 2023-08-09 20:06:58 +08:00
chn
e84d0b6965 fix openssl build 2023-08-09 19:43:36 +08:00
chn
6b877a1246 fix nur-xddxdd import 2023-08-09 16:03:10 +08:00
chn
92c2f311e2 update inputs 2023-08-09 15:52:08 +08:00
chn
95331cd955 make custom substituters after 2023-08-08 22:54:27 +08:00
chn
0369abbf2a frpc always restart 2023-08-08 22:52:38 +08:00
chn
df8b686036 ssh allow x11 forwarding 2023-08-08 16:36:34 +08:00
chn
fa5e6c1450 add waydroid hibernate bug 2023-08-08 16:35:59 +08:00
chn
1207fe8595 disable failed test for znver2 2023-08-08 01:00:16 +08:00
chn
8a13158854 remove some build tools 2023-08-07 22:06:50 +08:00
chn
7a490b13b8 remove wine64 root-docker 2023-08-07 22:00:59 +08:00
chn
9369877099 enable local substituters 2023-08-07 21:54:10 +08:00
chn
195242cbc6 enable nix-serve 2023-08-07 21:47:09 +08:00
chn
288a7ace2f fix frp tls cert 2023-08-07 21:35:23 +08:00
chn
f0be22d66a add frp 2023-08-07 21:16:49 +08:00
chn
6075bef406 disable failed test for znver3 2023-08-07 17:03:28 +08:00
chn
14feec291f disable failed test for znver3 2023-08-07 16:02:25 +08:00
chn
e39f9df7f5 fix kernel config 2023-08-07 11:16:31 +08:00
chn
05ea6124fd fix for znver2 and znver3 2023-08-07 10:21:24 +08:00
chn
a9f448279a add pdftk 2023-08-06 21:51:23 +08:00
chn
5d122cbf97 init for vps4 and vps7 2023-08-06 18:52:32 +08:00
chn
17a61b4862 use generic stdenv to compile embree on alderlake 2023-08-06 18:28:08 +08:00
chn
949e46453c bump embree 2023-08-06 18:14:54 +08:00
chn
3212a73b94 disable failed test for alderlake 2023-08-06 15:36:13 +08:00
chn
f56650b799 add blender 2023-08-06 14:08:57 +08:00
chn
c52c88c01d disable check for sandybridge 2023-08-06 13:58:08 +08:00
chn
0cbb54c263 add s-tui 2023-08-06 09:54:15 +08:00
chn
144cc383ed add powertop 2023-08-06 09:46:37 +08:00
chn
1b87ad7ab9 add bootstrap system 2023-08-05 21:44:50 +08:00
chn
0d93cef4da allow more march 2023-08-05 19:32:34 +08:00
chn
02dd4e4dc3 调整 gui/headless 要安装的包 2023-08-05 19:14:35 +08:00
chn
cfcdbed317 add netease-cloud-music-gtk 2023-08-05 13:44:07 +08:00
chn
b6f88592e1 add fedora 2023-08-05 11:50:18 +08:00
chn
a7ac984a70 vps6 use march 2023-08-05 09:40:10 +08:00
chn
2e1f763f4a add extraMarch 2023-08-05 09:35:17 +08:00
chn
8c6ee75ed8 add telegram no ads patch 2023-08-04 22:55:29 +08:00
chn
136e7916aa snapper allow all user to read info 2023-08-04 22:25:07 +08:00
chn
3c810be918 add wine64 2023-08-04 21:10:50 +08:00
chn
c8037eb6cd try to enable acme 2023-08-04 20:25:17 +08:00
chn
c8312f76f9 fix session variables 2023-08-04 19:53:42 +08:00
chn
4387ebae36 use kde wayland as default session 2023-08-04 19:20:58 +08:00
chn
407f5b5eb9 fix roll-rootfs run twice at startup 2023-08-04 19:10:57 +08:00
chn
d6862f47f9 do not persist /var{cache,empty,lock,run,tmp,lib/sddm} 2023-08-04 18:46:20 +08:00
chn
1f4d74132b enable autojump 2023-08-03 22:34:13 +08:00
chn
4b4ef558ad networkmanager force reconfigure interface after boot 2023-08-03 22:02:22 +08:00
chn
80af4cf322 update vps6 age key 2023-08-03 18:12:54 +08:00
chn
ceab637b8b add swap for vps6 2023-08-03 18:03:09 +08:00
chn
992dd8d800 fix vps6 config 2023-08-03 17:57:38 +08:00
chn
baf2cb60ad ssh add some options 2023-08-03 17:03:54 +08:00
chn
78f12f3d8a enable yubico auth 2023-08-03 16:48:27 +08:00
chn
f294d23ea4 fix yubico auth 2023-08-03 16:26:35 +08:00
chn
2ba5316e15 disable ussh 2023-08-02 19:38:37 +08:00
chn
d947f8add3 u2fAuth have been enable as default 2023-08-02 19:37:46 +08:00
chn
59160508b4 revert ca.pub change 2023-08-02 18:12:40 +08:00
chn
14ae4eb76f ssh config change 2023-08-02 18:10:22 +08:00
chn
dd094f2547 mod ca file 2023-08-02 17:51:16 +08:00
chn
6a38e0db02 remove authorizedKeys for chn 2023-08-02 17:42:14 +08:00
chn
c24a421287 try to fix ussh 2023-08-02 17:06:16 +08:00
chn
2d9c631d84 try to enable ussh auth 2023-08-02 16:49:43 +08:00
chn
3980253c56 enable pcscd 2023-08-02 15:53:53 +08:00
chn
a62d8c2677 enable u2f as default 2023-08-02 15:30:20 +08:00
chn
a133306e3f fix manual decrypt 2023-08-02 15:25:38 +08:00
chn
332fbc80c3 fix decrypt manual 2023-08-02 15:18:30 +08:00
chn
d45e93d400 Merge branch 'current' 2023-08-02 14:24:59 +08:00
chn
b20aecca1f fix manual decrypt 2023-08-02 14:24:25 +08:00
chn
2d07eb76a8 update aagl 2023-08-01 22:51:25 +08:00
chn
af1a9c5a0a 暂存 2023-08-01 22:40:09 +08:00
chn
f3694fb421 fix wait-manual-decrypt before 2023-08-01 21:18:51 +08:00
chn
db54e3ca4f make manual decrypt devices exist before cryptsetup.target reached 2023-08-01 16:34:08 +08:00
chn
1b694ea319 fix decrypt manual 2023-08-01 16:14:58 +08:00
chn
bf276b1d19 longer wait time for manually unlocked device 2023-08-01 16:09:26 +08:00
chn
0ab92b8ba2 add nix-serve 2023-08-01 14:52:18 +08:00
chn
4e9a2cf4ea remove auto decrypt 2023-08-01 14:50:24 +08:00
chn
7e84c10805 add usbip to initrd 2023-08-01 14:49:03 +08:00
chn
71ae275527 add usbip 2023-08-01 14:32:16 +08:00
chn
1aa4683545 fix network in initrd 2023-08-01 13:05:10 +08:00
chn
bbc9292dfc enable dhcp 2023-08-01 12:51:06 +08:00
chn
3887ba1454 add additional virtio drivers 2023-08-01 12:45:55 +08:00
chn
82712f50ae add virtio_net driver to initrd 2023-08-01 12:41:50 +08:00
chn
085972d7a8 fix ssh 2023-08-01 11:22:30 +08:00
chn
6cd2e708d4 add waydroid0 to firewall trustedInterfaces 2023-08-01 11:09:30 +08:00
chn
92dfc730f0 add cowsay 2023-08-01 11:00:07 +08:00
chn
a2f21bef76 尝试启用 initrd ssh 2023-08-01 02:05:48 +08:00
chn
80af75ed28 add dracut 2023-08-01 01:33:00 +08:00
chn
dc4d3150b6 roll-rootfs wantedby initrd-root-fs.target 2023-07-31 23:50:05 +08:00
chn
ab9dac4166 run roll-rootfs before sysroot.mount 2023-07-31 23:32:19 +08:00
chn
47d8d0a026 add vps6 2023-07-31 22:20:22 +08:00
chn
1bb777b80f add sops for vps6 2023-07-31 22:14:31 +08:00
chn
9299314a1b bootstrap do not keep output 2023-07-31 21:55:15 +08:00
chn
623db23bf7 改正 bootstrap 的挂载 2023-07-31 21:40:07 +08:00
chn
095e9a5f8b vps6 config to bootstrap 2023-07-31 21:11:17 +08:00
chn
5b463a5a36 try higher compress level 2023-07-31 15:54:02 +08:00
chn
73ef07def9 enable sshd for vps6 2023-07-31 14:56:45 +08:00
chn
5b6999b154 add cpupower 2023-07-31 07:48:19 +08:00
chn
5114df7588 add some rss reader 2023-07-31 00:22:14 +08:00
chn
d257929a51 add compsize 2023-07-30 12:05:52 +08:00
chn
a16009918e 调整一些软件包分类 2023-07-29 23:38:01 +08:00
chn
8eab8fc4f0 用户密码使用明文 hashedPassword 2023-07-29 23:24:15 +08:00
chn
b5e5136d12 disable p10k instant prompt 2023-07-29 13:29:36 +08:00
chn
2f1ee658d1 add gtk materia theme 2023-07-28 23:43:03 +08:00
chn
5f0de28be8 add some kde theme 2023-07-28 23:37:52 +08:00
chn
439e8b4bbf add xmake vscode extension 2023-07-28 22:48:21 +08:00
chn
f46b92c889 add meson vscode extension 2023-07-28 22:07:16 +08:00
chn
3dcf316310 修正一部分错误 2023-07-28 20:15:49 +08:00
chn
dca603a583 增加 vps6 的初始配置用于测试 2023-07-28 20:06:44 +08:00
chn
57ecd45680 zsh keep more history 2023-07-28 15:08:08 +08:00
chn
136d5eb3f8 add tela-circle-icon-theme 2023-07-28 14:55:34 +08:00
chn
8d7ecc3759 add fluent-reader 2023-07-28 14:53:33 +08:00
chn
06cc885f45 add orchis-theme 2023-07-28 14:34:53 +08:00
chn
cd99981b88 remove ANDROID_HOME 2023-07-28 13:59:07 +08:00
chn
699fc48236 add zoom 2023-07-28 09:49:40 +08:00
chn
98b6395c15 增加一些 xdg-ninja 的结果 2023-07-28 00:02:51 +08:00
chn
1e007dc182 dnsmasq use bind-dynamic 2023-07-27 23:41:04 +08:00
chn
7c6b497963 Revert "start dnsmasq after network-interfaces"
This reverts commit 3422a545f4.
2023-07-27 23:40:39 +08:00
chn
3422a545f4 start dnsmasq after network-interfaces 2023-07-27 23:36:30 +08:00
chn
3881a60265 add some env from xdg-ninja 2023-07-27 23:25:27 +08:00
chn
0833f288f7 add xmunet fix 2023-07-27 23:14:44 +08:00
chn
6540a7d980 全部整理完成了 2023-07-27 23:05:04 +08:00
chn
e3f5704afc fix 2023-07-27 22:53:29 +08:00
chn
b77cb6414d 暂存 2023-07-27 22:24:01 +08:00
chn
dc18f6e51d 所有模块都整理完成 2023-07-27 21:50:51 +08:00
chn
7f5105a07a fix 2023-07-27 21:28:57 +08:00
chn
89a6a41d29 暂存 2023-07-27 21:14:39 +08:00
chn
d0ef102996 整理很多东西 2023-07-27 20:12:20 +08:00
chn
b12e903ec3 暂存 2023-07-27 19:32:51 +08:00
chn
3d2624284f 暂存 2023-07-27 19:01:58 +08:00
chn
68f4374c91 整理很多内容 2023-07-27 11:05:14 +08:00
chn
6ba50d9906 move display-manager after to modules 2023-07-27 00:40:37 +08:00
chn
02fa0af289 set display-manager after network-online.target 2023-07-27 00:37:57 +08:00
chn
c139989344 do not work as kvm guest 2023-07-27 00:16:17 +08:00
chn
77c878894d fix 2023-07-27 00:07:20 +08:00
chn
2f22dbe27b add inkscape 2023-07-26 23:56:13 +08:00
chn
ba2b67e3dd 整理许多内容 2023-07-26 23:36:12 +08:00
chn
3430a00548 fix 2023-07-26 21:11:47 +08:00
chn
39eb683ee8 暂存 2023-07-26 21:05:46 +08:00
chn
c34c579835 fix 2023-07-26 17:13:00 +08:00
chn
2029099f45 整理一些服务 2023-07-26 17:08:32 +08:00
chn
eea2495e2f 整理字体设置 2023-07-26 17:03:09 +08:00
chn
05b4bdf491 remove unused extension 2023-07-26 14:20:48 +08:00
chn
2f9987cc78 remove unused extensions 2023-07-26 14:17:17 +08:00
chn
8a51d00bfa add missing vscode extension 2023-07-26 14:02:49 +08:00
chn
ae1df36fe6 add kmscon (does not enable) 2023-07-26 11:24:27 +08:00
chn
d69f6effd4 整理services 2023-07-25 23:33:37 +08:00
chn
a1f99f53bb 解决 xorg 下不能使用 kde 的问题 2023-07-25 21:49:32 +08:00
chn
bd8002c3f9 调整一些设置 2023-07-25 21:22:04 +08:00
chn
18b37db37a 修正一些设置 2023-07-25 20:24:03 +08:00
chn
139275964d 尝试修复 x0rg 2023-07-25 20:06:07 +08:00
chn
7a4c0c8292 将空格替换为tab 2023-07-25 18:06:24 +08:00
chn
5db90f5f62 整理所有软件包 2023-07-25 18:04:29 +08:00
chn
a9cad9369d remove playonlinux 2023-07-24 18:34:16 +08:00
chn
c1e32b2bcc fix samba settings 2023-07-24 14:02:03 +08:00
chn
619cbb0cc0 samba obey pam restrictions 2023-07-24 13:19:07 +08:00
chn
5d3852d6b7 fix 2023-07-24 12:52:49 +08:00
chn
a1e2d0a914 samba enable winbindd 2023-07-24 12:52:21 +08:00
chn
32ae92be3c 整理 gui 2023-07-24 12:52:00 +08:00
chn
c58284cb63 整理 nspawn 2023-07-24 12:41:38 +08:00
chn
ffa05cf7b2 add screen 2023-07-24 08:02:42 +08:00
chn
7dcbc06e9a add xdg variables 2023-07-23 21:00:09 +08:00
chn
02d4b71aef add clang-tools 2023-07-23 20:57:12 +08:00
chn
ef71d813bd add xdg-ninja 2023-07-23 20:54:26 +08:00
chn
0ef9462bda 整理一些软件包 2023-07-23 16:16:56 +08:00
chn
d4ac9b6e1a fix tldr 2023-07-23 13:17:02 +08:00
chn
8d8bbeed35 整理一些软件包 2023-07-23 12:14:32 +08:00
chn
4d6131b36f fix nixos.fileSystems.decrypt.auto.before error 2023-07-23 09:03:45 +08:00
chn
64194760d2 整理很多东西 2023-07-23 00:20:11 +08:00
chn
f3f3000fa9 fix docker dns 2023-07-22 19:41:54 +08:00
chn
dde7708616 docker enable buildkit 2023-07-22 19:22:34 +08:00
chn
db9ee70565 整理 steam wine 2023-07-22 18:30:40 +08:00
chn
a6a11d940c 整理 decrypt before 2023-07-22 18:25:26 +08:00
chn
0f9e579d5b 整理 kvm guest 2023-07-22 18:05:55 +08:00
chn
91e866b14d 整理 kvm host 2023-07-22 18:03:09 +08:00
chn
04e19884fe 整理 docker 和 waydroid 2023-07-22 15:05:18 +08:00
chn
9faeb54ebd 整理内核模块 2023-07-22 14:16:01 +08:00
chn
3bf9c52bab 整理内核模块 2023-07-22 14:06:41 +08:00
chn
efecba2b43 disable ccache for kernel 2023-07-22 12:57:27 +08:00
chn
2077cba56c 移动 preempt 补丁 2023-07-22 12:52:28 +08:00
chn
485d107a3b 整理 system.march 2023-07-22 12:45:26 +08:00
chn
6017698731 整理内核模块和设置 2023-07-22 12:30:37 +08:00
chn
e6849a3ee6 fix 2023-07-22 00:48:24 +08:00
chn
bfa14be863 always allow overcommit memory 2023-07-22 00:45:24 +08:00
chn
b9503264f9 整理一些设置 2023-07-22 00:37:12 +08:00
chn
2a0c282b98 remove redundant after 2023-07-22 00:26:02 +08:00
chn
bf2e03f640 调整 kernel 的顺序 2023-07-22 00:22:32 +08:00
chn
30ca432712 使用 stripeTabs 2023-07-22 00:15:28 +08:00
chn
1e2fd98bd0 整理 localLib 到一个文件中 2023-07-22 00:09:29 +08:00
chn
ec16041fb9 add stripeTabs 2023-07-22 00:05:44 +08:00
chn
4337485e5d 整理 hostname 2023-07-22 00:02:51 +08:00
chn
a18a913546 add mkConditional 2023-07-21 22:02:48 +08:00
chn
86987ab871 整理 local 2023-07-21 21:57:06 +08:00
chn
a3dc4f3b88 整理 grub 2023-07-21 21:46:24 +08:00
chn
bf916175b4 整理 filesyste 2023-07-21 13:53:41 +08:00
chn
a01a7e749c add pandoc 2023-07-21 09:37:44 +08:00
chn
38f805fbf9 nvidia enable power management 2023-07-21 08:15:23 +08:00
chn
d559d28991 add yarn 2023-07-21 01:51:49 +08:00
chn
47a4675a4d add deps for researchgpt 2023-07-21 01:39:58 +08:00
chn
f1d9dd4ed5 add standard notes 2023-07-20 23:45:30 +08:00
chn
bc870e624c add todo-txt-cli 2023-07-20 23:26:49 +08:00
chn
ec8393e1d8 fix 2023-07-20 10:35:56 +08:00
chn
79988db9b2 fix systemd depends 2023-07-20 10:30:39 +08:00
chn
46df23998e disable tmpfiles clean 2023-07-20 10:17:31 +08:00
chn
f355bcca37 roll rootfs after swap 2023-07-20 10:13:11 +08:00
chn
a235e1b0b2 add joplin 2023-07-19 23:51:25 +08:00
chn
c74955c7ce add oneapi 2023-07-19 23:24:35 +08:00
chn
53f3a01c38 fix oneapi 2023-07-19 22:59:54 +08:00
chn
421274f9a2 add ubuntu nspawn config 2023-07-19 18:40:46 +08:00
chn
cbdd5cb46e add appimage-run file 2023-07-19 17:13:20 +08:00
chn
a6857f5fbe fix oneapi 2023-07-19 17:12:51 +08:00
chn
372dbca9fd add appflowy 2023-07-19 14:55:44 +08:00
chn
377bda72f2 add notion 2023-07-19 14:53:53 +08:00
chn
3c1e72a5c1 整理 hardware 2023-07-19 11:49:09 +08:00
chn
e55d604798 force swap unencrypt in initrd 2023-07-19 11:40:15 +08:00
chn
7f53e95ed5 整理 sound 2023-07-19 00:25:16 +08:00
chn
f3f72805ac fix oneapi 2023-07-19 00:06:53 +08:00
chn
f368ed87b5 fix oneapi 2023-07-18 20:17:38 +08:00
chn
130cb67787 fix vesta 2023-07-18 18:39:40 +08:00
chn
649c48ce09 整理 printer 设置 2023-07-18 18:19:00 +08:00
chn
11e6287c26 整理一些packages 2023-07-18 13:55:24 +08:00
chn
9e52369fd0 add p7zip 2023-07-18 09:36:34 +08:00
chn
152ed30035 enable ccache for libreoffice tensorflow 2023-07-17 17:16:15 +08:00
chn
d19a11c913 p10k move context to left 2023-07-17 14:29:18 +08:00
chn
02491d1246 fix wireplump config 2023-07-17 13:53:46 +08:00
chn
353f601ba6 remove all usage of ccache (except kernel) 2023-07-17 10:39:07 +08:00
chn
1c4c48769d larger ccache size 2023-07-17 00:30:18 +08:00
chn
bc06e79c07 disable unified builds for webkitgtk 2023-07-16 23:43:30 +08:00
chn
ffeae744fa enable ccache for wxgtk 2023-07-16 16:37:36 +08:00
chn
d701554bd8 enable ccache for webkitgtk 2023-07-16 16:20:29 +08:00
chn
02218e66fe enable ccache for tensorflow 2023-07-16 16:13:42 +08:00
chn
4740713482 kernel use ccache 2023-07-16 14:37:55 +08:00
chn
023e599c0e revert kernel to 6.3 2023-07-16 14:29:26 +08:00
chn
cc55d58afb remove davinci-resolve 2023-07-16 14:23:48 +08:00
chn
42bc589838 modify oneapi 2023-07-16 14:07:59 +08:00
chn
fd41773428 add davinci-resolve 2023-07-15 23:55:00 +08:00
chn
66d03c89a9 move joystick 2023-07-15 22:48:24 +08:00
chn
ce23149fca move bluetooth 2023-07-15 22:45:35 +08:00
chn
d5b3506945 move kernel patches 2023-07-15 22:37:43 +08:00
chn
80c55c3a24 move modules to separate directory 2023-07-15 22:20:30 +08:00
chn
91c72f4e43 move kernelParams 2023-07-15 22:12:29 +08:00
chn
f8b9ba475b add oneapi 2023-07-15 22:02:40 +08:00
chn
a2aa9f6361 libreoffice enable ccache 2023-07-15 21:37:09 +08:00
chn
ad371e365b disable ccache libreoffice
enable nixd
2023-07-15 19:12:15 +08:00
chn
ba99ff5d13 enable ccache for libreoffice 2023-07-15 18:53:07 +08:00
chn
503d03d293 add ccache path to test ccache 2023-07-15 16:25:24 +08:00
chn
7e4fd5c342 use nixpkgs/nixos-unstable 2023-07-15 13:18:27 +08:00
chn
6fb841710f add 32bit opengl 2023-07-15 12:19:14 +08:00
chn
037333910c add playonlinux bottles 2023-07-15 12:04:59 +08:00
chn
7cd518be4a update aagl 2023-07-15 10:35:24 +08:00
chn
2ac987bfaa fix firefox 2023-07-15 10:12:53 +08:00
chn
c34a9d3d82 Revert "sddm use wayland"
This reverts commit 10fecc5ab9.
2023-07-15 09:37:13 +08:00
chn
10fecc5ab9 sddm use wayland 2023-07-15 09:30:18 +08:00
chn
cf09455fba p10k move git to left 2023-07-15 09:23:13 +08:00
chn
395b1ff3d2 fix roll-rootfs failed 2023-07-14 23:09:34 +08:00
chn
3141be3fc1 整理微码设置 2023-07-14 21:30:30 +08:00
chn
a36922f81d 整理完成 filesystem 2023-07-14 16:57:57 +08:00
chn
f1200943bb fix cjytty hash 2023-07-14 15:59:14 +08:00
chn
f813b81608 Merge branch 'main' into next 2023-07-14 15:57:14 +08:00
chn
dcd8bbdaf1 update and clean 2023-07-14 15:57:05 +08:00
chn
83b7fae8e9 整理休眠虚拟机的服务 2023-07-13 21:44:48 +08:00
chn
6c029b8f55 fix libobjc2 build failed 2023-07-13 16:36:34 +08:00
chn
e440a96dbf Revert "modify p10k settings"
This reverts commit 1ecc945c52.
2023-07-13 16:13:37 +08:00
chn
1ecc945c52 modify p10k settings 2023-07-13 15:04:33 +08:00
chn
38177d9bd8 modify p10k settings 2023-07-13 15:02:11 +08:00
chn
d742f3b899 global enable ccache 2023-07-13 14:55:23 +08:00
chn
026d35f8a9 add gimp 2023-07-13 10:39:47 +08:00
chn
3ff3b24e68 currently disable distcc 2023-07-13 00:06:35 +08:00
chn
d1f335ebae fix hibernate and resume 2023-07-12 23:59:32 +08:00
chn
2dfa1da476 disable failed test 2023-07-12 22:07:25 +08:00
chn
c8ad965540 remove wine-wechat 2023-07-12 15:37:27 +08:00
chn
2399294b22 fix ccache bug 2023-07-12 14:20:25 +08:00
chn
84058f46a4 enable ccache for webkitgtk 2023-07-12 13:48:57 +08:00
chn
3283e02450 enable ccache globally 2023-07-12 13:33:14 +08:00
chn
7d850971cc Merge branch 'main' into next 2023-07-12 13:32:37 +08:00
chn
613880d5e3 enable ccache 2023-07-12 13:30:43 +08:00
chn
45bdb145c7 hibernate -> shutdown 2023-07-12 10:09:42 +08:00
chn
c0e827d672 add baidupcs-go 2023-07-11 18:05:56 +08:00
chn
19bc1525a3 use native mono 2023-07-11 18:04:09 +08:00
chn
249782a9ca disable failed tests 2023-07-11 11:32:37 +08:00
chn
3d63af7a53 use next nixpkgs 2023-07-11 10:09:32 +08:00
chn
b8f6790898 整理 lock 2023-07-11 10:05:16 +08:00
chn
6e90faf009 remove registry 2023-07-11 10:02:12 +08:00
chn
04349e19c5 update registry lock file 2023-07-11 00:28:37 +08:00
chn
fc27adfd07 add nixpkgs-native 2023-07-11 00:27:46 +08:00
chn
dc34a98c7d enable nix-direnv 2023-07-10 20:11:17 +08:00
chn
28e882b39d add direnv 2023-07-10 19:59:41 +08:00
chn
8f5cbf727b add nixos-config registry
remove some nixPath
2023-07-10 19:29:32 +08:00
chn
dc707d3902 enable nil 2023-07-10 15:41:44 +08:00
chn
102370d6af add vscode extension nix-ide 2023-07-10 15:37:35 +08:00
chn
3d03780cf1 add vscode fortran-lang.linter-gfortran 2023-07-10 15:35:15 +08:00
chn
5495a14eb6 整理一些选项 2023-07-10 14:44:11 +08:00
chn
32086a6cd5 整理resume 2023-07-10 13:24:55 +08:00
chn
e8a24a5c8e disable plasma manager 2023-07-10 10:49:07 +08:00
chn
39269357f1 qq do not use firejail 2023-07-10 10:29:04 +08:00
chn
2377533a96 整理swap 2023-07-09 22:53:43 +08:00
chn
53c94c46ee enable br 2023-07-09 22:44:59 +08:00
chn
f2898ced51 add some tools 2023-07-09 22:29:22 +08:00
chn
4e2a01a90c 整理mdadm 2023-07-09 13:33:40 +08:00
chn
782f08d860 整理 luks auto 2023-07-09 13:27:01 +08:00
chn
189e67a4eb mounts -> mount 2023-07-09 12:50:30 +08:00
chn
090bfc5780 整理文件系统的配置 2023-07-09 12:45:47 +08:00
chn
60119d44f9 add zsh-nix-shell 2023-07-09 01:29:50 +08:00
chn
91cda376cd set system registry 2023-07-08 17:28:59 +08:00
chn
8db8a84644 do not link include 2023-07-08 16:56:36 +08:00
chn
119fa3572f 暂存 2023-07-08 16:26:12 +08:00
chn
ac8a3697fd remove nixos-test 2023-07-08 16:08:21 +08:00
chn
cd8db8775b deprecate 2 branch in mkModules 2023-07-08 15:56:39 +08:00
chn
4133a2af0c use optimized kwin 2023-07-07 00:01:44 +08:00
chn
2fb44b3bd7 use std:3 2023-07-07 00:01:23 +08:00
chn
cd6b77b29b modify some kernel settings 2023-07-07 00:00:38 +08:00
chn
bce9c26a91 modify some kernel config 2023-07-06 23:38:13 +08:00
chn
401f4210dc 休眠和睡眠时自动休眠虚拟机 2023-07-06 23:08:38 +08:00
chn
13b8869115 add wine-wechat 2023-07-06 16:02:49 +08:00
chn
1e7190ab2b format generic pkgs 2023-07-06 11:24:34 +08:00
chn
56baaf58ae use generic kwin 2023-07-06 10:23:47 +08:00
chn
9bcf54eb85 add some utils 2023-07-05 20:58:00 +08:00
chn
8dad0a5f87 add wl-mirror 2023-07-05 20:15:42 +08:00
chn
847bee8428 add gcc CPATH adn LIBRARY_PATH 2023-07-05 15:11:28 +08:00
chn
818a0d7603 add some packages 2023-07-05 14:14:58 +08:00
chn
03efa0b745 add some packages 2023-07-05 13:43:13 +08:00
chn
f2a73928be add tensorflow keras 2023-07-05 10:33:28 +08:00
chn
3289cb5fb4 add signal 2023-07-04 20:11:00 +08:00
chn
6760d72d21 Merge branch 'py' 2023-07-04 19:48:43 +08:00
chn
6cc866dfec add python-spectral 2023-07-04 19:48:27 +08:00
chn
a02b1bdf35 add some tools 2023-07-04 18:19:41 +08:00
chn
6d90b99fb2 enable firejail for qq(缺乏测试) 2023-07-04 12:36:44 +08:00
chn
48762a7b01 add virt-viewer 2023-07-03 12:43:13 +08:00
chn
e2c5ee512a add putty 2023-07-03 00:39:12 +08:00
chn
d256e57417 enable raid0 swap 2023-07-02 22:31:20 +08:00
chn
bf1a47f970 mv impermanece to persistent 2023-07-02 14:53:37 +08:00
chn
f2a387e3d2 add e2fsprogs 2023-07-02 13:37:59 +08:00
chn
da8d56c0fd add nomacs 2023-06-30 15:45:11 +08:00
chn
f7575db6fd fix typora 2023-06-30 15:44:52 +08:00
chn
e04379b332 add appflowy 2023-06-30 13:46:56 +08:00
chn
921342c419 qe use native flags 2023-06-30 09:55:46 +08:00
chn
ac15ce8f7b add qe 2023-06-30 09:53:12 +08:00
chn
a04320b0f1 add gfortran 2023-06-29 22:34:36 +08:00
chn
96b1f79720 明文存储u2f key 2023-06-29 22:26:09 +08:00
chn
4ff7edff0d add more u2f auth 2023-06-29 22:04:57 +08:00
chn
3ab06acd09 fix upho 2023-06-29 19:03:26 +08:00
chn
6df144384a fix upho 2023-06-29 18:30:20 +08:00
chn
8ea6aa36f6 fix upho error 2023-06-29 18:17:36 +08:00
chn
a569b91b63 kernel enable alderlake optimization 2023-06-29 12:34:16 +08:00
chn
2d4ac9672b add wine 2023-06-29 01:33:28 +08:00
chn
7af6d500e8 add cjktty 2023-06-29 00:12:16 +08:00
chn
68c4d1001c try to fix hdmi 2023-06-28 23:10:08 +08:00
chn
eb7d9cb98f add cling 2023-06-28 16:42:49 +08:00
chn
3687b48fbd clean up and packaging upho 2023-06-28 16:37:13 +08:00
chn
abc94915c7 add nix-template 2023-06-28 15:10:19 +08:00
chn
b4bcd135d7 fix vesta 2023-06-28 14:54:20 +08:00
chn
3508f7a9b2 try to add upho 2023-06-28 13:48:08 +08:00
chn
c9cd75f821 add archlinux container settings 2023-06-28 12:50:44 +08:00
chn
2e812f553d make docker use overlay2 2023-06-28 10:17:27 +08:00
chn
e6bcf5ac1c systemd tmpfiles do not create subvol 2023-06-28 10:08:29 +08:00
chn
43e0dcd33b fix hibernate 2023-06-28 09:48:14 +08:00
chn
d37a466445 使用按时间标号的rootfs 2023-06-28 01:22:07 +08:00
chn
037add7ab3 create current rootfs at boot 2023-06-28 00:53:05 +08:00
chn
318e185217 set root password in initrd 2023-06-27 23:22:57 +08:00
chn
91e77aab37 enable impermanence for etc 2023-06-27 22:50:40 +08:00
chn
1700e071c3 write u2f authfile 2023-06-27 17:29:58 +08:00
chn
d02457aa66 enable yubikey fido sudo and login 2023-06-27 13:15:17 +08:00
chn
d2dcaeb8fc add pam_u2f 2023-06-27 13:08:55 +08:00
chn
63b881ae0e try to use fido2 2023-06-27 12:54:08 +08:00
chn
d852f7fdf7 add some yubikey tools 2023-06-26 23:05:49 +08:00
chn
1aa8beead1 enable fwupd 2023-06-26 18:14:56 +08:00
chn
65cd23d50c add some tools 2023-06-26 18:11:38 +08:00
chn
9aabb0b718 add wayland utils 2023-06-26 18:07:23 +08:00
chn
237e28a451 add btop 2023-06-26 11:17:09 +08:00
chn
89e61f3d44 add intel-gpu-tools 2023-06-25 19:28:45 +08:00
chn
356c9a4bbf fix vesta 2023-06-25 13:38:09 +08:00
chn
121edd4062 add typora 2023-06-25 13:12:16 +08:00
chn
db01553c69 downgrade vesta 50 3.5.5 2023-06-25 11:45:15 +08:00
chn
d702cfc107 add vesta 2023-06-25 11:38:01 +08:00
chn
a9c4170fde add android studio 2023-06-25 00:50:10 +08:00
chn
fca559768b add clion 2023-06-25 00:45:23 +08:00
chn
1d01659555 adjust typo 2023-06-25 00:33:50 +08:00
chn
b2a2b61f89 merge boot and filesystem together 2023-06-24 23:27:10 +08:00
chn
f3a65d8cf4 use wrapper to call modules 2023-06-24 23:02:08 +08:00
chn
b57feb23b6 add a helper function 2023-06-24 22:00:28 +08:00
chn
84eebed2c0 rename inputs into topInputs 2023-06-24 21:26:41 +08:00
chn
7957fe4e38 Revert "revert aagl"
This reverts commit 041453525f.
2023-06-24 16:12:07 +08:00
chn
041453525f revert aagl 2023-06-24 15:07:32 +08:00
chn
486ec3b9e5 fix services 2023-06-24 14:20:38 +08:00
chn
e47cd6f4e2 add htop 2023-06-24 14:09:45 +08:00
chn
5aee535c96 set zstd compression ratio to 8 2023-06-24 13:46:04 +08:00
chn
dc03e242d0 switch to latest xanmod 2023-06-24 13:36:40 +08:00
chn
1ef0e6d89f switch to zstd:3 2023-06-24 13:30:29 +08:00
chn
72c2d2e85d switch back to zstd 2023-06-24 13:15:23 +08:00
chn
2c1eaaa77e switch to xanmod lts 2023-06-24 13:11:57 +08:00
chn
6e4be7150f switch to lzo 2023-06-24 09:55:11 +08:00
chn
eff5a4a9cd Revert "switch to zen kernel"
This reverts commit 54aec417ff.
2023-06-24 09:54:59 +08:00
chn
54aec417ff switch to zen kernel
adjust rtkit params
2023-06-24 08:45:05 +08:00
chn
aea174f406 fix nixos version 2023-06-23 19:35:36 +08:00
chn
f7631459d1 Merge branch 'native' 2023-06-23 18:57:10 +08:00
chn
a314f1f8ca add system version 2023-06-23 13:02:33 +08:00
chn
10f128dd69 disable reuse phases 2023-06-23 13:00:36 +08:00
chn
419b4c66d5 add system features 2023-06-21 23:43:14 +08:00
chn
820b24e1ef ignore result-man 2023-06-21 23:42:03 +08:00
chn
db7c6cc7aa update world 2023-06-21 21:18:25 +08:00
chn
12963649c3 Merge branch 'main' into native 2023-06-21 21:17:08 +08:00
chn
0b4e26b43c fix syntax 2023-06-21 20:57:30 +08:00
chn
1eaa392797 disable failed test 2023-06-21 20:56:18 +08:00
chn
89a708456c try to disable sound sleep 2023-06-21 20:47:24 +08:00
chn
ee58a95971 fix failed build 2023-06-21 20:46:19 +08:00
chn
1f26c98c95 switch to xanmod 2023-06-21 19:47:54 +08:00
chn
092e2c9ed8 update world 2023-06-21 19:39:34 +08:00
chn
080b43b0ff fix pipe/redirect in services 2023-06-21 18:31:57 +08:00
chn
589aefd59b add intel opengl drivers 2023-06-21 14:23:19 +08:00
chn
2e3ca82d70 btrfs lower thread to compress 2023-06-21 12:46:42 +08:00
chn
199036b90c add some sysctl configs 2023-06-21 11:51:47 +08:00
chn
b7adb35199 xray allow more open files 2023-06-21 11:02:31 +08:00
chn
9df9569b4a fix service error 2023-06-21 10:03:59 +08:00
chn
52491617da lid no wakeup 2023-06-21 09:55:18 +08:00
chn
75eaccbfbf suspend to freeze 2023-06-21 09:48:05 +08:00
chn
5728c32ede more log 2023-06-21 09:45:58 +08:00
chn
d403fed129 auto optimize store 2023-06-21 01:01:33 +08:00
chn
9f4676ddac only reset iwlwifi after hibernation 2023-06-20 23:21:35 +08:00
chn
3c27a68b0d enable kde connect 2023-06-20 21:05:42 +08:00
chn
867970d9c5 btrfs use more compression thread 2023-06-20 16:21:55 +08:00
chn
4fea7a92e0 fix samba config 2023-06-20 16:10:19 +08:00
chn
98f4e69b3c fix samba settings 2023-06-20 16:07:03 +08:00
chn
bcd11a9cf6 enable samba 2023-06-20 15:44:34 +08:00
chn
5cf5ecddad add kiofuse 2023-06-20 10:50:52 +08:00
chn
02c5569647 add sshfs 2023-06-20 10:48:19 +08:00
chn
6229ab33d5 reset iwlwifi after restore from hibernate
put salt in separate partition
2023-06-20 00:12:22 +08:00
chn
a71766f771 add smartmontools 2023-06-19 21:51:59 +08:00
chn
7236df354a add ~/bin to PATH 2023-06-19 21:35:31 +08:00
chn
86df08e89f enable docker0 proxy 2023-06-19 20:50:37 +08:00
chn
c9da955bae add wireshark 2023-06-19 20:46:08 +08:00
chn
e9c87b0a32 enable iftop iotop 2023-06-19 17:43:01 +08:00
chn
69bbc738e5 enable adb 2023-06-19 17:32:59 +08:00
chn
00efdd8090 enable docker 2023-06-19 17:31:34 +08:00
chn
da2014ddd6 enable dconf
enable opengl
2023-06-19 17:22:54 +08:00
chn
aa1e709e49 swith to dbus broker
higher compression
2023-06-19 16:56:49 +08:00
chn
f1bb29f7d9 switch to zen 2023-06-19 16:19:07 +08:00
chn
93ada28ac5 switch to xanmod stable 2023-06-19 16:14:17 +08:00
chn
9656256103 add aesni_intel and its dependencies to initrd 2023-06-19 15:53:33 +08:00
chn
72b87ed0ac adjust luks bypassWorkqueues 2023-06-19 15:49:08 +08:00
chn
e9eb38090a lower compression 2023-06-19 15:29:25 +08:00
chn
fadbeea8c3 adjust libvirt 2023-06-19 15:25:39 +08:00
chn
553c6d609d use bfq 2023-06-19 14:41:13 +08:00
chn
960b91828a 禁用os-prober,手动设置windows项 2023-06-19 13:37:36 +08:00
chn
be6e91e7ab enable swap 2023-06-19 12:02:45 +08:00
chn
65c4971a49 successfully switch to another disk 2023-06-19 11:20:20 +08:00
chn
fe4b15d152 switch to large disk and enable yubikey 2023-06-18 16:15:56 +08:00
chn
c485829814 disable failed test 2023-06-18 07:07:15 +08:00
chn
fded07ba39 disable failed test 2023-06-18 01:32:40 +08:00
chn
19889a7cad 修复虚拟机翻墙 2023-06-18 00:41:29 +08:00
chn
dbde3eb2d1 auto modprobe br_netfilter 2023-06-17 22:30:59 +08:00
chn
c4e496bec0 安装 virt-manager
用户可以不使用sops
2023-06-17 21:24:30 +08:00
chn
7616017832 add some package 2023-06-17 20:44:00 +08:00
chn
e7908e5362 disable failed test 2023-06-17 20:09:12 +08:00
chn
76ba9a829e use generic fwupd 2023-06-17 19:20:52 +08:00
chn
5c886a3b46 use generic pandoc 2023-06-17 19:06:03 +08:00
chn
06d94e2f7f enable snapper 2023-06-17 12:03:53 +08:00
chn
12be5857c2 add waydroid scripts 2023-06-17 11:35:26 +08:00
chn
4bb622e9cc add printer configs 2023-06-17 10:24:39 +08:00
chn
c262309bcd enable ntfs support 2023-06-17 06:03:06 +08:00
chn
4f20d41777 enlarge root 2023-06-17 05:49:07 +08:00
chn
359f6cfe26 use very high compression 2023-06-17 01:18:43 +08:00
chn
c056153b33 move nix cache to disk 2023-06-17 01:04:14 +08:00
chn
4179a8af50 remove unnecessary mount point 2023-06-17 01:01:41 +08:00
chn
c3c742bebc remove redundant compress-force 2023-06-17 00:35:14 +08:00
chn
bcb9671910 persist all etc 2023-06-17 00:31:44 +08:00
chn
9215cff1e2 add size limitation 2023-06-17 00:17:48 +08:00
chn
a3d2a6b0a4 move swap into nix 2023-06-17 00:10:21 +08:00
chn
de0e8d73a6 move impermanence under nix 2023-06-16 22:44:39 +08:00
chn
3be7a49962 update world 2023-06-16 21:55:50 +08:00
chn
e0f0eb4655 temporaly disable home impermanence 2023-06-16 20:23:08 +08:00
chn
55e4f98bad remove additional neededForBoot 2023-06-16 20:15:09 +08:00
chn
84c969619f remove .sys1log.conf 2023-06-16 20:09:10 +08:00
chn
129453cfd1 try to switch to impermanence 2023-06-16 15:57:47 +08:00
chn
78594e2cf1 try to enable plasma manager 2023-06-16 13:15:51 +08:00
chn
8dcbb11c13 使用rc2nix生成初始配置(未整理,未启用) 2023-06-15 19:30:44 +08:00
chn
945c875b42 install plasma manager 2023-06-15 19:12:25 +08:00
chn
a75904a0d8 update nixpkgs 2023-06-15 13:33:57 +08:00
chn
4973985312 清理代码 2023-06-15 13:25:34 +08:00
chn
6b0119cda8 update world 2023-06-15 11:15:34 +08:00
chn
1ed7ffcc58 disable failed test 2023-06-14 23:59:07 +08:00
chn
d2bd09c257 disable failed test 2023-06-14 22:29:15 +08:00
chn
7dc1c032fc disable failed test for debugpy 2023-06-14 20:45:00 +08:00
chn
713c220c84 revert 2023-06-14 20:13:14 +08:00
chn
8c4a9ad35a use generic debugpy 2023-06-14 20:05:24 +08:00
chn
eb5e1c82fe move generic-pkgs from gaming to hardware 2023-06-14 19:52:21 +08:00
chn
15b9c69a53 尝试只替换mono 2023-06-14 09:17:42 +08:00
chn
b21e5f8222 steam use generic package 2023-06-14 09:07:08 +08:00
chn
93dcbb1488 use nixpkgs with aiohttp and openexr patch 2023-06-14 00:50:34 +08:00
chn
fbc3dbeaf2 全局启用native,但排除个别包极其依赖 2023-06-14 00:44:26 +08:00
152 changed files with 8422 additions and 869 deletions

4
.gitignore vendored
View File

@@ -1 +1,3 @@
result
result
result-man
outputs

View File

@@ -1,15 +1,47 @@
keys:
keys: # cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
- &chn age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
- &chn-PC age1ffvr5pqd2lfj24e3fh53s92z6h76fda3du4y4k6r3yjumdwvpfgqzj033a
- &chn-nixos-test age1thf94z6z4835nxsx56upa3s32vfqq2s6d67rpg7weawj2lrk25asw8smhh
- &pc age1ffvr5pqd2lfj24e3fh53s92z6h76fda3du4y4k6r3yjumdwvpfgqzj033a
- &vps6 age164tyqklwhdm57tfm5u863mdt2xrzrrzac4py8a0j9y6kzqcjy9zsp073t6
- &vps7 age137x7csalutwvfygvvzpemlsywvdxj3j4z93a50z2sjx03w6zau8q3r5902
- &yoga age1qrea4twxdhd7fnvlq5v45528c90qy6hp2wa55kghsxzgut6n6fxs7w6u42
- &pe age1cahahn9hp265dkhduaec65vugk8fct2vt9ur6y54m4mgmyx4v4fq0etjhv
- &nas age19lhcwk37jmvn6z0v4dpdfh0k4u23f76twdjknc0p7atktf37rd7s4t4wj3
creation_rules:
- path_regex: secrets/chn-PC\.yaml$
- path_regex: secrets/pc\.yaml$
key_groups:
- age:
- *chn
- *chn-PC
- path_regex: secrets/chn-nixos-test\.yaml$
- *pc
- path_regex: secrets/vps6\.yaml$
key_groups:
- age:
- *chn
- *chn-nixos-test
- *vps6
- path_regex: secrets/vps4\.yaml$
key_groups:
- age:
- *chn
- path_regex: secrets/vps7\.yaml$
key_groups:
- age:
- *chn
- *vps7
- path_regex: secrets/nas\.yaml$
key_groups:
- age:
- *chn
- *nas
- path_regex: secrets/xmupc1\.yaml$
key_groups:
- age:
- *chn
- path_regex: secrets/yoga\.yaml$
key_groups:
- age:
- *chn
- *yoga
- path_regex: secrets/pe\.yaml$
key_groups:
- age:
- *chn
- *pe

1071
flake.lock generated

File diff suppressed because it is too large Load Diff

867
flake.nix
View File

@@ -1,153 +1,724 @@
{
description = "Chn's NixOS Flake";
description = "CNH's NixOS Flake";
inputs =
{
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
nvfetcher =
{
url = "github:berberman/nvfetcher";
inputs =
{
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
flake-compat.follows = "flake-compat";
};
};
home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix =
{
url = "github:Mic92/sops-nix";
inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs-stable"; };
};
touchix = { url = "github:CHN-beta/touchix"; inputs.nixpkgs.follows = "nixpkgs"; };
aagl =
{
url = "github:ezKEa/aagl-gtk-on-nix";
inputs = { nixpkgs.follows = "nixpkgs"; flake-compat.follows = "flake-compat"; };
};
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
nur.url = "github:nix-community/NUR";
nixos-cn =
{
url = "github:nixos-cn/flakes";
inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; };
};
nur-xddxdd =
{
url = "github:xddxdd/nur-packages";
inputs =
{
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs-stable";
};
};
nix-vscode-extensions =
{
url = "github:nix-community/nix-vscode-extensions";
inputs =
{
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
flake-compat.follows = "flake-compat";
};
};
nix-alien =
{
url = "github:thiagokokada/nix-alien";
inputs =
{
flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
nix-index-database.follows = "nix-index-database";
};
};
inputs =
{
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:CHN-beta/nixpkgs/nixos-unstable";
home-manager = { url = "github:nix-community/home-manager/release-23.05"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix =
{
url = "github:Mic92/sops-nix";
inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; };
};
touchix = { url = "github:CHN-beta/touchix"; inputs.nixpkgs.follows = "nixpkgs"; };
aagl = { url = "github:ezKEa/aagl-gtk-on-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
nur.url = "github:nix-community/NUR";
nixos-cn = { url = "github:nixos-cn/flakes"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-xddxdd = { url = "github:xddxdd/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-vscode-extensions =
{
url = "github:nix-community/nix-vscode-extensions?rev=50c4bce16b93e7ca8565d51fafabc05e9f0515da";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-alien = { url = "github:thiagokokada/nix-alien"; inputs.nix-index-database.follows = "nix-index-database"; };
impermanence.url = "github:nix-community/impermanence";
qchem = { url = "github:Nix-QChem/NixOS-QChem"; inputs.nixpkgs.follows = "nixpkgs"; };
nixd = { url = "github:nix-community/nixd"; inputs.nixpkgs.follows = "nixpkgs"; };
napalm = { url = "github:nix-community/napalm"; inputs.nixpkgs.follows = "nixpkgs"; };
nixpak = { url = "github:nixpak/nixpak"; inputs.nixpkgs.follows = "nixpkgs"; };
deploy-rs = { url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; };
pnpm2nix-nzbr = { url = "github:CHN-beta/pnpm2nix-nzbr"; inputs.nixpkgs.follows = "nixpkgs"; };
lmix = { url = "github:CHN-beta/lmix"; inputs.nixpkgs.follows = "nixpkgs"; };
dguibert-nur-packages = { url = "github:CHN-beta/dguibert-nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
};
outputs = inputs: { nixosConfigurations =
{
"chn-PC" = inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules =
[
inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops
inputs.touchix.nixosModules.v2ray-forwarder
inputs.aagl.nixosModules.default
inputs.nix-index-database.nixosModules.nix-index
inputs.nur.nixosModules.nur
({
config.nixpkgs.overlays =
[( final: prev:
{
touchix = inputs.touchix.packages."${prev.system}";
nix-vscode-extensions = inputs.nix-vscode-extensions.extensions."${prev.system}";
} )];
})
( import ./modules/basic.nix { hostName = "chn-PC"; })
./modules/fonts.nix
( import ./modules/i18n.nix { fcitx = true; } )
./modules/kde.nix
./modules/sops.nix
( import ./modules/boot/basic.nix { efi = true; timeout = 30; })
./modules/boot/chn-PC.nix
./modules/filesystem/chn-PC.nix
./modules/hardware/bluetooth.nix
./modules/hardware/joystick.nix
( import ./modules/hardware/nvidia-prime.nix { intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; } )
./modules/hardware/printer.nix
./modules/hardware/sound.nix
./modules/hardware/chn-PC.nix
./modules/networking/basic.nix
./modules/networking/ssh.nix
./modules/networking/wall_client.nix
./modules/networking/xmunet.nix
./modules/networking/chn-PC.nix
./modules/packages/terminal.nix
./modules/packages/gui.nix
./modules/packages/gaming.nix
./modules/packages/hpc.nix
./modules/users/root.nix
./modules/users/chn.nix
./modules/virtualisation/kvm_guest.nix
./modules/virtualisation/kvm_host.nix
./modules/virtualisation/waydroid.nix
./modules/home/root.nix
./modules/home/chn.nix
];
};
"chn-nixos-test" = inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules =
[
inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops
inputs.nix-index-database.nixosModules.nix-index
( import ./modules/basic.nix { hostName = "chn-nixos-test"; })
( import ./modules/i18n.nix { fcitx = false; } )
./modules/sops.nix
( import ./modules/boot/basic.nix { efi = true; timeout = 30; })
./modules/boot/chn-nixos-test.nix
./modules/filesystem/chn-nixos-test.nix
./modules/hardware/chn-nixos-test.nix
./modules/networking/basic.nix
./modules/networking/ssh.nix
./modules/packages/terminal.nix
./modules/users/root.nix
./modules/users/chn.nix
./modules/virtualisation/kvm_guest.nix
./modules/home/root.nix
./modules/home/chn.nix
];
};
}; };
outputs = inputs:
let
localLib = import ./local/lib inputs.nixpkgs.lib;
in
{
packages.x86_64-linux =
{
default = inputs.nixpkgs.legacyPackages.x86_64-linux.writeText "systems"
(builtins.concatStringsSep "\n" (builtins.map
(system: builtins.toString inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel)
[ "pc" "vps6" "vps7" "nas" "yoga" ]));
}
// (
builtins.listToAttrs (builtins.map
(system:
{
name = system;
value = inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel;
})
[ "pc" "vps6" "vps7" "nas" "yoga" ])
);
nixosConfigurations = builtins.listToAttrs (builtins.map
(system:
{
name = system.name;
value = inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
specialArgs = { topInputs = inputs; inherit localLib; };
modules = localLib.mkModules
(
[
(inputs: { config.nixpkgs.overlays = [(final: prev:
{ localPackages = (import ./local/pkgs { inherit (inputs) lib; pkgs = final; }); })]; })
./modules
]
++ system.value
);
};
})
(localLib.attrsToList
{
"pc" =
[
(inputs: { config.nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/3F57-0EBE" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/02e426ec-cfa2-4a18-b3a5-57ef04d66614"."/" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.auto =
{
"/dev/disk/by-uuid/55fdd19f-0f1d-4c37-bd4e-6df44fc31f26" = { mapper = "root"; ssd = true; };
"/dev/md/swap" = { mapper = "swap"; ssd = true; before = [ "root" ]; };
};
mdadm =
"ARRAY /dev/md/swap metadata=1.2 name=pc:swap UUID=2b546b8d:e38007c8:02990dd1:df9e23a4";
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = { device = "/dev/mapper/root"; path = "/nix/rootfs"; };
};
grub =
{
windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
installDevice = "efi";
};
nix =
{
marches =
[
"alderlake"
# CX16
"sandybridge"
# CX16 SAHF FXSR
"silvermont"
# RDSEED MWAITX SHA CLZERO CX16 SSE4A ABM CLFLUSHOPT WBNOINVD
"znver2" "znver3"
# CX16 SAHF FXSR HLE RDSEED
"broadwell"
];
keepOutputs = true;
};
nixpkgs = { march = "alderlake"; cudaSupport = true; };
gui = { enable = true; preferred = true; };
kernel =
{
useLts = true;
patches = [ "cjktty" "preempt" ];
modules.modprobeConfig = [ "options iwlmvm power_scheme=1" "options iwlwifi uapsd_disable=1" ];
};
impermanence.enable = true;
networking =
{ hostname = "pc"; nebula = { enable = true; lighthouse = "vps6.chn.moe"; useRelay = true; }; };
sops = { enable = true; keyPathPrefix = "/nix/persistent"; };
};
hardware =
{
cpus = [ "intel" ];
gpus = [ "intel" "nvidia" ];
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
sound.enable = true;
prime =
{ enable = true; mode = "offload"; busId = { intel = "PCI:0:2:0"; nvidia = "PCI:1:0:0"; };};
gamemode.drmDevice = 1;
};
packages =
{
packageSet = "workstation";
extraPrebuildPackages = with inputs.pkgs; [ llvmPackages_git.stdenv ];
extraPythonPackages = [(pythonPackages:
[ inputs.pkgs.localPackages.upho inputs.pkgs.localPackages.spectral ])];
};
virtualization =
{
waydroid.enable = true;
docker.enable = true;
kvmHost = { enable = true; gui = true; autoSuspend = [ "win10" "hardconnect" ]; };
# kvmGuest.enable = true;
nspawn = [ "arch" "ubuntu-22.04" "fedora" ];
};
services =
{
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
fontconfig.enable = true;
samba =
{
enable = true;
private = true;
hostsAllowed = "192.168. 127.";
shares =
{
media.path = "/run/media/chn";
home.path = "/home/chn";
mnt.path = "/mnt";
share.path = "/home/chn/share";
};
};
sshd.enable = true;
xrayClient =
{
enable = true;
serverAddress = "74.211.99.69";
serverName = "vps6.xserver.chn.moe";
dns =
{
extraInterfaces = [ "docker0" ];
hosts =
{
"mirism.one" = "216.24.188.24";
"beta.mirism.one" = "216.24.188.24";
"ng01.mirism.one" = "216.24.188.24";
"debug.mirism.one" = "127.0.0.1";
"initrd.vps6.chn.moe" = "74.211.99.69";
"nix-store.chn.moe" = "127.0.0.1";
"initrd.nas.chn.moe" = "192.168.1.185";
};
};
};
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
acme = { enable = true; certs = [ "debug.mirism.one" ]; };
frpClient =
{
enable = true;
serverName = "frp.chn.moe";
user = "pc";
tcp.store = { localPort = 443; remotePort = 7676; };
};
nix-serve = { enable = true; hostname = "nix-store.chn.moe"; };
smartd.enable = true;
nginx =
{
enable = true;
transparentProxy.externalIp = [ "192.168.82.3" ];
applications.misskey.instances."xn--qbtm095lrg0bfka60z.chn.moe" = {};
};
misskey.instances.misskey.hostname = "xn--qbtm095lrg0bfka60z.chn.moe";
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 2048; }; };
};
bugs =
[
"intel-hdmi" "suspend-hibernate-no-platform" "hibernate-iwlwifi" "suspend-lid-no-wakeup" "xmunet"
"suspend-hibernate-waydroid" "embree" "nvme"
];
};})
];
"vps6" =
[
(inputs: { config.nixos =
{
system =
{
fileSystems =
{
mount =
{
btrfs =
{
"/dev/disk/by-uuid/24577c0e-d56b-45ba-8b36-95a848228600"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.manual =
{
enable = true;
devices."/dev/disk/by-uuid/4f8aca22-9ec6-4fad-b21a-fd9d8d0514e8" = { mapper = "root"; ssd = true; };
delayedMount = [ "/" ];
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = { device = "/dev/mapper/root"; path = "/nix/rootfs"; };
};
grub.installDevice = "/dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0";
nixpkgs.march = "sandybridge";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd =
{
network.enable = true;
sshd = { enable = true; hostKeys = [ "/nix/persistent/etc/ssh/initrd_ssh_host_ed25519_key" ]; };
};
kernel.patches = [ "preempt" ];
impermanence.enable = true;
networking = { hostname = "vps6"; nebula.enable = true; };
sops = { enable = true; keyPathPrefix = "/nix/persistent"; };
};
packages.packageSet = "server";
services =
{
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
sshd.enable = true;
xrayServer = { enable = true; serverName = "vps6.xserver.chn.moe"; };
frpServer = { enable = true; serverName = "frp.chn.moe"; };
nginx =
{
enable = true;
transparentProxy =
{
externalIp = [ "74.211.99.69" "192.168.82.1" ];
map =
{
"ng01.mirism.one" = 7411;
"beta.mirism.one" = 9114;
};
};
streamProxy =
{
enable = true;
map =
{
"nix-store.chn.moe" = { upstream = "internal.pc.chn.moe:443"; rewriteHttps = true; };
"anchor.fm" = { upstream = "anchor.fm:443"; rewriteHttps = true; };
"podcasters.spotify.com" = { upstream = "podcasters.spotify.com:443"; rewriteHttps = true; };
"xlog.chn.moe" = { upstream = "cname.xlog.app:443"; rewriteHttps = true; };
};
};
applications =
{
misskey.instances =
{
"xn--qbtm095lrg0bfka60z.chn.moe".upstream.address = "internal.pc.chn.moe";
"xn--s8w913fdga.chn.moe".upstream.address = "internal.vps7.chn.moe";
"misskey.chn.moe".upstream = "internal.vps7.chn.moe:9727";
};
synapse.instances."synapse.chn.moe".upstream.address = "internal.vps7.chn.moe";
vaultwarden = { enable = true; upstream.address = "internal.vps7.chn.moe"; };
element.instances."element.chn.moe" = {};
photoprism.instances."photoprism.chn.moe".upstream.address = "internal.vps7.chn.moe";
nextcloud.proxy = { enable = true; upstream = "internal.vps7.chn.moe"; };
};
};
coturn.enable = true;
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 16; }; };
};
};})
];
"vps7" =
[
(inputs: { config.nixos =
{
system =
{
fileSystems =
{
mount =
{
btrfs =
{
"/dev/disk/by-uuid/e36287f7-7321-45fa-ba1e-d126717a65f0"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.manual =
{
enable = true;
devices."/dev/disk/by-uuid/db48c8de-bcf7-43ae-a977-60c4f390d5c4" = { mapper = "root"; ssd = true; };
delayedMount = [ "/" ];
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = { device = "/dev/mapper/root"; path = "/nix/rootfs"; };
};
grub.installDevice = "/dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0";
nixpkgs.march = "broadwell";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd =
{
network.enable = true;
sshd = { enable = true; hostKeys = [ "/nix/persistent/etc/ssh/initrd_ssh_host_ed25519_key" ]; };
};
kernel.patches = [ "preempt" ];
impermanence.enable = true;
networking = { hostname = "vps7"; nebula = { enable = true; lighthouse = "vps6.chn.moe"; }; };
sops = { enable = true; keyPathPrefix = "/nix/persistent"; };
gui.enable = true;
};
packages =
{
packageSet = "desktop";
};
services =
{
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
fontconfig.enable = true;
sshd.enable = true;
rsshub.enable = true;
nginx =
{
enable = true;
transparentProxy.externalIp = [ "95.111.228.40" "192.168.82.2" ];
applications =
{
misskey.instances =
{
"xn--s8w913fdga.chn.moe" = {};
"misskey.chn.moe".upstream.port = 9727;
};
synapse.instances."synapse.chn.moe" = {};
vaultwarden.enable = true;
photoprism.instances."photoprism.chn.moe" = {};
nextcloud.instance.enable = true;
};
};
wallabag.enable = true;
misskey.instances =
{
misskey.hostname = "xn--s8w913fdga.chn.moe";
misskey-old = { port = 9727; redis.port = 3546; meilisearch.enable = false; };
};
synapse.enable = true;
xrdp = { enable = true; hostname = "vps7.chn.moe"; };
vaultwarden.enable = true;
beesd = { enable = true; instances.root = { device = "/"; hashTableSizeMB = 1024; }; };
photoprism.enable = true;
nextcloud.enable = true;
};
};})
];
"nas" =
[
(inputs: { config.nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/13BC-F0C9" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/0e184f3b-af6c-4f5d-926a-2559f2dc3063"."/boot" = "/boot";
"/dev/mapper/nix"."/nix" = "/nix";
"/dev/mapper/root1" =
{
"/nix/rootfs" = "/nix/rootfs";
"/nix/persistent" = "/nix/persistent";
"/nix/nodatacow" = "/nix/nodatacow";
"/nix/rootfs/current" = "/";
};
};
};
decrypt.manual =
{
enable = true;
devices =
{
"/dev/disk/by-uuid/5cf1d19d-b4a5-4e67-8e10-f63f0d5bb649".mapper = "root1";
"/dev/disk/by-uuid/aa684baf-fd8a-459c-99ba-11eb7636cb0d".mapper = "root2";
"/dev/disk/by-uuid/a779198f-cce9-4c3d-a64a-9ec45f6f5495" = { mapper = "nix"; ssd = true; };
};
delayedMount = [ "/" "/nix" ];
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = { device = "/dev/mapper/root1"; path = "/nix/rootfs"; };
};
initrd =
{
network.enable = true;
sshd = { enable = true; hostKeys = [ "/nix/persistent/etc/ssh/initrd_ssh_host_ed25519_key" ]; };
};
grub.installDevice = "efi";
nixpkgs.march = "silvermont";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel.patches = [ "cjktty" "preempt" ];
impermanence.enable = true;
networking =
{ hostname = "nas"; nebula = { enable = true; lighthouse = "vps6.chn.moe"; useRelay = true; }; };
sops = { enable = true; keyPathPrefix = "/nix/persistent"; };
gui.enable = true;
};
hardware =
{
cpus = [ "intel" ];
gpus = [ "intel" ];
};
packages.packageSet = "desktop";
services =
{
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
fontconfig.enable = true;
samba =
{
enable = true;
hostsAllowed = "192.168. 127.";
shares =
{
home.path = "/home";
root.path = "/";
};
};
sshd = { enable = true; passwordAuthentication = true; };
xrayClient =
{
enable = true;
serverAddress = "74.211.99.69";
serverName = "vps6.xserver.chn.moe";
dns.extraInterfaces = [ "docker0" ];
};
xrdp = { enable = true; hostname = [ "nas.chn.moe" "office.chn.moe" ]; };
groupshare.enable = true;
smartd.enable = true;
beesd =
{
enable = true;
instances =
{
root = { device = "/"; hashTableSizeMB = 2048; };
nix = { device = "/nix"; hashTableSizeMB = 128; };
};
};
};
users.users = [ "root" "chn" "xll" "zem" "yjq" "yxy" ];
};})
];
"xmupc1" =
[
(inputs: { config.nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/3F57-0EBE" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/02e426ec-cfa2-4a18-b3a5-57ef04d66614"."/" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.auto =
{
"/dev/disk/by-uuid/55fdd19f-0f1d-4c37-bd4e-6df44fc31f26" = { mapper = "root"; ssd = true; };
"/dev/md/swap" = { mapper = "swap"; ssd = true; before = [ "root" ]; };
};
mdadm =
"ARRAY /dev/md/swap metadata=1.2 name=pc:swap UUID=2b546b8d:e38007c8:02990dd1:df9e23a4";
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = { device = "/dev/mapper/root"; path = "/nix/rootfs"; };
};
grub.installDevice = "efi";
nixpkgs = { march = "znver3"; cudaSupport = true; };
nix =
{
marches =
[
"znver3" "znver2"
# PREFETCHW RDRND XSAVE XSAVEOPT PTWRITE SGX GFNI-SSE MOVDIRI MOVDIR64B CLDEMOTE WAITPKG LZCNT
# PCONFIG SERIALIZE HRESET KL WIDEKL AVX-VNNI
"alderlake"
# SAHF FXSR XSAVE
"sandybridge"
# SAHF FXSR PREFETCHW RDRND
"silvermont"
];
substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
};
gui.enable = true;
kernel =
{
patches = [ "cjktty" "preempt" ];
modules.modprobeConfig = [ "options iwlmvm power_scheme=1" "options iwlwifi uapsd_disable=1" ];
};
impermanence.enable = true;
networking.hostname = "xmupc1";
sops = { enable = true; keyPathPrefix = "/nix/persistent"; };
};
hardware =
{
cpus = [ "intel" ];
gpus = [ "intel" "nvidia" ];
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
sound.enable = true;
prime =
{ enable = true; mode = "offload"; busId = { intel = "PCI:0:2:0"; nvidia = "PCI:1:0:0"; };};
};
packages.packageSet = "workstation";
virtualization =
{
docker.enable = true;
kvmHost = { enable = true; gui = true; };
};
services =
{
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
fontconfig.enable = true;
samba =
{
enable = true;
hostsAllowed = "192.168. 127.";
shares =
{
media.path = "/run/media/chn";
home.path = "/home/chn";
mnt.path = "/mnt";
share.path = "/home/chn/share";
};
};
sshd.enable = true;
xrayClient =
{
enable = true;
serverAddress = "74.211.99.69";
serverName = "vps6.xserver.chn.moe";
dns =
{
extraInterfaces = [ "docker0" ];
hosts =
{
"mirism.one" = "216.24.188.24";
"beta.mirism.one" = "216.24.188.24";
"ng01.mirism.one" = "216.24.188.24";
"debug.mirism.one" = "127.0.0.1";
"initrd.vps6.chn.moe" = "74.211.99.69";
"nix-store.chn.moe" = "127.0.0.1";
};
};
};
firewall.trustedInterfaces = [ "virbr0" ];
frpClient =
{
enable = true;
serverName = "frp.chn.moe";
user = "xmupc1";
tcp.store = { localPort = 443; remotePort = 7676; };
};
smartd.enable = true;
nginx = { enable = true; transparentProxy.enable = false; };
postgresql.enable = true;
};
bugs = [ "xmunet" "firefox" "embree" ];
};})
];
"yoga" =
[
(inputs: { config.nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/86B8-CF80" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/e252f81d-b4b3-479f-8664-380a9b73cf83"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.auto."/dev/disk/by-uuid/8186d34e-005c-4461-94c7-1003a5bd86c0" =
{ mapper = "root"; ssd = true; };
swap = [ "/nix/swap/swap" ];
rollingRootfs = { device = "/dev/mapper/root"; path = "/nix/rootfs"; };
};
nixpkgs.march = "silvermont";
gui.enable = true;
grub.installDevice = "efi";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel.patches = [ "cjktty" "preempt" ];
impermanence.enable = true;
networking.hostname = "yoga";
sops = { enable = true; keyPathPrefix = "/nix/persistent"; };
};
hardware =
{
cpus = [ "intel" ];
gpus = [ "intel" ];
bluetooth.enable = true;
joystick.enable = true;
printer.enable = true;
sound.enable = true;
halo-keyboard.enable = true;
};
packages.packageSet = "desktop";
virtualization.docker.enable = true;
services =
{
snapper = { enable = true; configs.persistent = "/nix/persistent"; };
fontconfig.enable = true;
sshd.enable = true;
xrayClient =
{
enable = true;
serverAddress = "74.211.99.69";
serverName = "vps6.xserver.chn.moe";
dns.extraInterfaces = [ "docker0" ];
};
firewall.trustedInterfaces = [ "virbr0" ];
};
bugs = [ "xmunet" "firmware-unstable" ];
};})
];
}));
# sudo HTTPS_PROXY=socks5://127.0.0.1:10884 nixos-install --flake .#bootstrap --option substituters http://127.0.0.1:5000 --option require-sigs false --option system-features gccarch-silvermont
# nix-serve -p 5000
# nix copy --substitute-on-destination --to ssh://server /run/current-system
# nix copy --to ssh://nixos@192.168.122.56 ./result
# sudo nixos-install --flake .#bootstrap
# --option substituters http://192.168.122.1:5000 --option require-sigs false
# sudo chattr -i var/empty
# nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
# sudo nixos-rebuild switch --flake .#vps6 --log-format internal-json -v |& nom --json
# boot.shell_on_fail systemd.setenv=SYSTEMD_SULOGIN_FORCE=1
# sudo usbipd
# ssh -R 3240:127.0.0.1:3240 root@192.168.122.57
# modprobe vhci-hcd
# sudo usbip bind -b 3-6
# usbip attach -r 127.0.0.1 -b 3-6
# systemd-cryptenroll --fido2-device=auto /dev/vda2
# systemd-cryptsetup attach root /dev/vda2
deploy =
{
sshUser = "root";
user = "root";
fastConnection = true;
autoRollback = false;
magicRollback = false;
nodes = builtins.listToAttrs (builtins.map
(node:
{
name = node;
value =
{
hostname = node;
profiles.system.path = inputs.self.nixosConfigurations.${node}.pkgs.deploy-rs.lib.activate.nixos
inputs.self.nixosConfigurations.${node};
};
})
[ "vps6" "vps7" "nas" "yoga" ]);
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib;
overlays.default = final: prev:
{ localPackages = (import ./local/pkgs { inherit (inputs) lib; pkgs = final; }); };
};
}

35
local/lib/default.nix Normal file
View File

@@ -0,0 +1,35 @@
lib:
{
attrsToList = Attrs: builtins.map ( name: { inherit name; value = Attrs.${name}; } ) ( builtins.attrNames Attrs );
mkConditional = condition: trueResult: falseResult: let inherit (lib) mkMerge mkIf; in
mkMerge [ ( mkIf condition trueResult ) ( mkIf (!condition) falseResult ) ];
# Behaviors of these two NixOS modules would be different:
# { pkgs, ... }@inputs: { environment.systemPackages = [ pkgs.hello ]; }
# inputs: { environment.systemPackages = [ pkgs.hello ]; }
# The second one would failed to evaluate because nixpkgs would not pass pkgs to it.
# So that we wrote a wrapper to make it always works like the first one.
mkModules = moduleList:
(builtins.map
(
let handle = module:
if ( builtins.typeOf module ) == "path" then (handle (import module))
else if ( builtins.typeOf module ) == "lambda" then ({ pkgs, utils, ... }@inputs: (module inputs))
else module;
in handle
)
moduleList);
# from: https://github.com/NixOS/nix/issues/3759
stripeTabs = text:
let
# Whether all lines start with a tab (or is empty)
shouldStripTab = lines: builtins.all (line: (line == "") || (lib.strings.hasPrefix " " line)) lines;
# Strip a leading tab from all lines
stripTab = lines: builtins.map (line: lib.strings.removePrefix " " line) lines;
# Strip tabs recursively until there are none
stripTabs = lines: if (shouldStripTab lines) then (stripTabs (stripTab lines)) else lines;
in
# Split into lines. Strip leading tabs. Concat back to string.
builtins.concatStringsSep "\n" (stripTabs (lib.strings.splitString "\n" text));
}

View File

@@ -0,0 +1,29 @@
{
lib, stdenv, fetchsvn, xorg, libdrm
}:
stdenv.mkDerivation rec
{
pname = "12to11";
version = "193";
src = fetchsvn
{
url = "svn://svn.code.sf.net/p/twelveto11/code";
rev = version;
sha256 = "12csy55f2xxj03c5b60dvip68mz8cggic6751y3hvj22ar4ncaaj";
};
postPatch =
''
for i in *.c
do
sed -i -e "s|#include <drm_fourcc.h>|#include <libdrm/drm_fourcc.h>|" $i
done
for i in tests/*.c
do
sed -i -e "s|#include <drm/drm_fourcc.h>|#include <libdrm/drm_fourcc.h>|" $i
done
'';
nativeBuildInputs = [ ];
buildInputs = [ xorg.imake libdrm.dev ];
}

View File

@@ -0,0 +1,17 @@
{
stdenv, fetchFromGitHub, cmake, pkg-config, ninja,
fmt, boost, magic-enum, libbacktrace, concurrencpp, tgbot-cpp, nameof, eigen, range-v3
}: stdenv.mkDerivation rec
{
name = "libbiu";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "biu";
rev = "8ed2e52968f98d3a6ddbd01e86e57604ba3a7f54";
sha256 = "OqQ+QkjjIbpve/xn/DJA7ONw/bBg5zGNr+VJjc3o+K8=";
};
nativeBuildInputs = [ cmake pkg-config ninja ];
buildInputs = [ fmt boost magic-enum libbacktrace concurrencpp tgbot-cpp nameof eigen range-v3 ];
propagatedBuildInputs = buildInputs;
}

View File

@@ -0,0 +1,18 @@
{ lib, stdenv, fetchFromGitHub, fetchurl, cmake }: stdenv.mkDerivation rec
{
pname = "chromiumos-touch-keyboard";
version = "1.4.1";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "chromiumos_touch_keyboard";
rev = "32b72240ccac751a1b983152f65aa5b19503ffcf";
sha256 = "eFesDSBS2VzTOVfepgXYGynWvkrCSdCV9C/gcG/Ocbg=";
};
cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-Wno-error=stringop-truncation" ];
nativeBuildInputs = [ cmake ];
postInstall =
''
cp $out/etc/touch_keyboard/layouts/YB1-X9x-pc105.csv $out/etc/touch_keyboard/layout.csv
'';
}

View File

@@ -0,0 +1,13 @@
{ stdenv, fetchFromGitHub, cmake }: stdenv.mkDerivation rec
{
pname = "concurrencpp";
version = "0.1.7";
src = fetchFromGitHub
{
owner = "David-Haim";
repo = "concurrencpp";
rev = "v.${version}";
sha256 = "4qT29YVjKEWcMrI5R5Ps8aD4grAAgz5VOxANjpp1oTo=";
};
nativeBuildInputs = [ cmake ];
}

41
local/pkgs/default.nix Normal file
View File

@@ -0,0 +1,41 @@
{ lib, pkgs }: with pkgs; rec
{
typora = callPackage ./typora {};
upho = python3Packages.callPackage ./upho {};
spectral = python3Packages.callPackage ./spectral {};
vesta = callPackage ./vesta {};
oneapi = callPackage ./oneapi {};
send = callPackage ./send {};
rsshub = callPackage ./rsshub {};
misskey = callPackage ./misskey { vips = unstablePackages.vips; };
mk-meili-mgn = callPackage ./mk-meili-mgn {};
phonon-unfolding = callPackage ./phonon-unfolding {};
# vasp = callPackage ./vasp
# {
# stdenv = pkgs.lmix-pkgs.intel21Stdenv;
# intel-mpi = pkgs.lmix-pkgs.intel-oneapi-mpi_2021_9_0;
# ifort = pkgs.lmix-pkgs.intel-oneapi-ifort_2021_9_0;
# };
vasp = callPackage ./vasp
{
openmp = llvmPackages.openmp;
openmpi = pkgs.openmpi.override { cudaSupport = false; };
};
vaspkit = callPackage ./vaspkit { attrsToList = (import ../lib lib).attrsToList; };
# "12to11" = callPackage ./12to11 {};
huginn = callPackage ./huginn {};
v_sim = callPackage ./v_sim {};
concurrencpp = callPackage ./concurrencpp { stdenv = gcc13Stdenv; };
eigengdb = python3Packages.callPackage ./eigengdb {};
nodesoup = callPackage ./nodesoup {};
matplotplusplus = callPackage ./matplotplusplus { inherit nodesoup glad; };
zpp-bits = callPackage ./zpp-bits {};
eigen = callPackage ./eigen {};
nameof = callPackage ./nameof {};
pslist = callPackage ./pslist {};
glad = callPackage ./glad {};
chromiumos-touch-keyboard = callPackage ./chromiumos-touch-keyboard {};
yoga-support = callPackage ./yoga-support {};
tgbot-cpp = callPackage ./tgbot-cpp {};
biu = callPackage ./biu { inherit concurrencpp tgbot-cpp nameof; stdenv = gcc13Stdenv; };
}

View File

@@ -0,0 +1,12 @@
{ lib, stdenv, fetchFromGitLab, cmake }: stdenv.mkDerivation rec
{
name = "eigen";
src = fetchFromGitLab
{
owner = "libeigen";
repo = name;
rev = "6d829e766ff1b1ab867d93631163cbc63ed5798f";
sha256 = "BXUnizcRPrOyiPpoyYJ4VVOjlG49aj80mgzPKmEYPKU=";
};
nativeBuildInputs = [ cmake ];
}

View File

@@ -0,0 +1,15 @@
{ lib, fetchFromGitHub, buildPythonPackage, numpy, gdb }: buildPythonPackage
{
name = "eigengdb";
src = fetchFromGitHub
{
owner = "dmillard";
repo = "eigengdb";
rev = "c741edef3f07f33429056eff48d79a62733ed494";
sha256 = "MTqOaWsKhWaPs3G5F/6bYZmQI5qS2hEGKGa3mwbgFaY=";
};
doCheck = false;
buildInputs = [ gdb ];
nativeBuildInputs = [ gdb ];
propagatedBuildInputs = [ numpy ];
}

View File

@@ -0,0 +1,14 @@
{ lib, stdenv, fetchFromGitHub, cmake, python3 }: stdenv.mkDerivation rec
{
pname = "glad";
version = "0.1.36";
src = fetchFromGitHub
{
owner = "Dav1dde";
repo = "glad";
rev = "v${version}";
sha256 = "FtkPz0xchwmqE+QgS+nSJVYaAfJSTUmZsObV/IPypVQ=";
};
cmakeFlags = [ "-DGLAD_REPRODUCIBLE=ON" "-DGLAD_INSTALL=ON" ];
nativeBuildInputs = [ cmake python3 ];
}

View File

@@ -0,0 +1,29 @@
{ lib, stdenv, bundlerEnv, fetchFromGitHub }:
let
pname = "huginn";
version = "20230723";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "huginn";
rev = "a02977ad420a01b6460634af19f714db4a8f8f36";
hash = "sha256-Ty2EDCIjbvcf3PzPupcV4s7ZfAFTuYEjSfy0m+Yt3j4=";
};
gems = bundlerEnv
{
name = "${pname}-${version}-gems";
gemdir = "${src}";
gemfile = "${src}/Gemfile";
lockfile = "${src}/Gemfile.lock";
gemset = "${src}/gemset.nix";
copyGemFiles = true;
};
in stdenv.mkDerivation
{
inherit pname version src;
buildInputs = [ gems gems.wrappedRuby ];
installPhase =
''
false
'';
}

View File

@@ -0,0 +1,25 @@
{
stdenv, fetchFromGitHub, cmake, pkg-config, substituteAll,
gnuplot, libjpeg, libtiff, zlib, libpng, lapack, blas, fftw, opencv, nodesoup, cimg, glfw, libGL, python3, glad
}: stdenv.mkDerivation
{
pname = "matplotplusplus";
version = "1.2.0";
src = fetchFromGitHub
{
owner = "alandefreitas";
repo = "matplotplusplus";
rev = "a40344efa9dc5ea0c312e6e9ef4eb7238d98dc12";
sha256 = "6/dH/Rl2aAb8b+Ji5LwzkC+GWPOCBnYCrjy0qk8u/+I=";
};
cmakeFlags =
[
"-DBUILD_SHARED_LIBS=ON" "-DMATPLOTPP_BUILD_SHARED_LIBS=ON" "-DMATPLOTPP_BUILD_EXAMPLES=OFF"
"-DMATPLOTPP_WITH_SYSTEM_NODESOUP=ON" "-DMATPLOTPP_WITH_SYSTEM_CIMG=ON"
"-DMATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON" "-DGLAD_REPRODUCIBLE=ON"
];
buildInputs = [ gnuplot libjpeg libtiff zlib libpng lapack blas fftw opencv nodesoup cimg glfw libGL glad ];
nativeBuildInputs = [ cmake pkg-config python3 ];
propagatedBuildInputs = [ libGL glad glfw ];
propagatedNativeBuildInputs = [ python3 ];
}

View File

@@ -0,0 +1,126 @@
{
lib, stdenv, mkPnpmPackage, fetchFromGitHub, fetchurl, nodejs_20, writeShellScript, buildFHSEnv,
bash, cypress, vips, pkg-config
}:
let
pname = "misskey";
version = "2023.10.2";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "misskey";
rev = "3f813d9808ebc1774457e02add8fe9c7a6937ff7";
sha256 = "63ZIil28jcMiL+c9FMj7m1OeCrLwsQZNHib+j8ar66s=";
fetchSubmodules = true;
};
originalPnpmPackage = mkPnpmPackage
{
inherit pname version src;
nodejs = nodejs_20;
copyPnpmStore = true;
};
startScript = writeShellScript "misskey"
''
export PATH=${lib.makeBinPath [ bash nodejs_20 nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress ]}:$PATH
export CYPRESS_RUN_BINARY="${cypress}/bin/Cypress"
export NODE_ENV=production
pnpm run migrateandstart
'';
re2 = stdenv.mkDerivation rec
{
pname = "re2";
version = "1.20.3";
srcs =
[
(fetchurl
{
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-115.br";
sha256 = "0g2k0bki0zm0vaqpz25ww119qcs1flv63h6s5ib3103arpnzmb6d";
})
(fetchurl
{
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-115.gz";
sha256 = "1dr9zzzm67jknzvla1l5178lzmj6cfh8i1vsp5r4gkwdwbfh3ip0";
})
(fetchurl
{
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-108.br";
sha256 = "0wby987byhshb20np1gglj6y9ji7m7jza5jwa4hyxfxs1pkkmg1n";
})
(fetchurl
{
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-108.gz";
sha256 = "0q3dyxm63d2x0wxx23gdwym7r2gmaw4ahvmd35dgrj179ik290pi";
})
(fetchurl
{
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-93.br";
sha256 = "1wjmdni24353ppwfiyrv1zl9ci4g2habk0g2nz6b0sijagcy7bv3";
})
(fetchurl
{
url = "https://github.com/uhop/node-re2/releases/download/1.20.3/linux-x64-93.gz";
sha256 = "0rgkryjh412g2m7rfrl2krsb9137prkk2y9ga8akn7qp1bqsbq1i";
})
];
phases = [ "installPhase" ];
installPhase =
''
mkdir -p $out/${version}
for i in $srcs
do
cp $i $out/${version}/''${i#*-}
done
'';
};
in
stdenv.mkDerivation rec
{
inherit version src pname;
buildInputs =
[
bash nodejs_20 nodejs_20.pkgs.typescript nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress vips pkg-config
];
nativeBuildInputs = buildInputs;
CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress";
NODE_ENV = "production";
RE2_DOWNLOAD_MIRROR = "${re2}";
RE2_DOWNLOAD_SKIP_PATH = "true";
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
export npm_config_nodedir=${nodejs_20}
runHook preConfigure
store=$(pnpm store path)
mkdir -p $(dirname $store)
cp -f ${originalPnpmPackage.passthru.patchedLockfileYaml} pnpm-lock.yaml
cp -RL ${originalPnpmPackage.passthru.pnpmStore} $store
chmod -R +w $store
pnpm install --frozen-lockfile --offline
runHook postConfigure
'';
buildPhase =
''
runHook preBuild
pnpm run build
runHook postBuild
'';
installPhase =
''
runHook preInstall
mkdir -p $out
mv * .* $out
mkdir -p $out/bin
cp ${startScript} $out/bin/misskey
mkdir -p $out/files
runHook postInstall
'';
passthru =
{
inherit originalPnpmPackage startScript re2;
};
}

View File

@@ -0,0 +1,16 @@
{ lib, fetchFromGitHub, rustPlatform, pkg-config, openssl }:
rustPlatform.buildRustPackage rec
{
pname = "mk-meili-mgn";
version = "20230827";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "mk-meili-mgn";
rev = "53e282c992293ec735c9bc964f097b5bdbc3e48a";
hash = "sha256-KBSoEGfWKDXZHSzSzak1v0nxtQQGI15DQTyNAPhsIB4=";
};
cargoHash = "sha256-wNdMPPl2H2iSrNYjoij0Qg/c2S5RjTHpOMV1RfHU27g=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ];
}

View File

@@ -0,0 +1,20 @@
{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec
{
pname = "nameof";
version = "0.10.3";
src = fetchFromGitHub
{
owner = "Neargye";
repo = pname;
rev = "v${version}";
sha256 = "eHG0Y/BQGbwTrBHjq9SeSiIXaVqWp7PxIq7vCIECYPk=";
};
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out
cp -r $src/include $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,13 @@
{ stdenv, fetchFromGitHub, cmake, pkg-config, cairo, pcre2, xorg }: stdenv.mkDerivation rec
{
name = "nodesoup";
src = fetchFromGitHub
{
owner = "olvb";
repo = "nodesoup";
rev = "3158ad082bb0cd1abee75418b12b35522dbca74f";
sha256 = "tFLq6QC3U3uvcuWsdRy2wnwcmAfH2MkI2oMcAiUBHSo=";
};
buildInputs = [ cairo pcre2.dev xorg.libXdmcp.dev ];
nativeBuildInputs = [ cmake pkg-config ];
}

View File

@@ -0,0 +1,28 @@
{
stdenv, fetchFromGitHub, gfortran, blas
}:
stdenv.mkDerivation
{
pname = "phonon-unfolding";
version = "0";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "phonon_unfolding";
rev = "ec363ef2bad0ee18a0839a1681ea9915c0b72e1d";
hash = "sha256-zDTbtYk5OXf//6eS4gEF7IvrpWcRAz18ue48IDZnfSk=";
};
buildInputs = [ blas ];
nativeBuildInputs = [ gfortran ];
buildPhase =
''
gfortran PhononUnfoldingModule.f90 -o PhononUnfoldingModule.mod -c
gfortran PhononUnfolding.f90 -c -o PhononUnfolding.mod
gfortran PhononUnfolding.mod PhononUnfoldingModule.mod -o PhononUnfolding -lblas
'';
installPhase =
''
mkdir -p $out/bin
cp PhononUnfolding $out/bin
'';
}

View File

@@ -0,0 +1,27 @@
# http://launchpadlibrarian.net/632309499/pslist_1.4.0-4_all.deb
# https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pslist/1.4.0-4/pslist_1.4.0.orig.tar.xz
{ lib, stdenv, fetchzip, perl, procps }: stdenv.mkDerivation
{
pname = "pslist";
version = "1.4.0";
src = fetchzip
{
url = "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/pslist/1.4.0-4/pslist_1.4.0.orig.tar.xz";
sha256 = "1sp1h7ccniz658ms331npffpa9iz8llig43d9mlysll420nb3xqv";
};
buildInstall = [ perl procps ];
installPhase =
''
mkdir -p $out/bin
cp $src/pslist $out/bin
ln -s pslist $out/bin/rkill
ln -s pslist $out/bin/rrenice
mkdir -p $out/share/man/man1
cp $src/pslist.1 $out/share/man/man1
ln -s pslist.1 $out/share/man/man1/rkill.1
ln -s pslist.1 $out/share/man/man1/rrenice.1
sed -i 's|/usr/bin/perl|${perl}/bin/perl|' $out/bin/pslist
sed -i 's|/bin/ps|${procps}/bin/ps|' $out/bin/pslist
'';
}

View File

@@ -0,0 +1,57 @@
{
lib, stdenv, mkPnpmPackage, fetchFromGitHub, nodejs, writeShellScript,
chromium, bash
}:
let
name = "rsshub";
src = fetchFromGitHub
{
owner = "DIYgod";
repo = "RSSHub";
rev = "67d4a7ed3f877a8ceac6caebe874c4ce5c210bd8";
sha256 = "baJQWGrr1RdZoI2uAGp2uJO9epbjAUjks76knJSwVdE=";
};
originalPnpmPackage = mkPnpmPackage { inherit name src nodejs; };
nodeModules = originalPnpmPackage.nodeModules.overrideAttrs { PUPPETEER_SKIP_DOWNLOAD = true; };
rsshub-unwrapped = stdenv.mkDerivation
{
inherit src;
name = "${name}-unwrapped";
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
export npm_config_nodedir=${nodejs}
runHook preConfigure
ln -s ${nodeModules}/. node_modules
runHook postConfigure
'';
installPhase =
''
runHook preInstall
mkdir -p $out
mv * .* $out
runHook postInstall
'';
};
startScript = writeShellScript "rsshub"
''
cd ${rsshub-unwrapped}
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm chromium ]}:$PATH
export CHROMIUM_EXECUTABLE_PATH=chromium
pnpm start
'';
in stdenv.mkDerivation
{
inherit name;
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out/bin
cp ${startScript} $out/bin/rsshub
runHook postInstall
'';
}

View File

@@ -0,0 +1,15 @@
{ buildNpmPackage, fetchFromGitHub, nodejs-16_x }:
buildNpmPackage.override { nodejs = nodejs-16_x; }
{
pname = "send";
version = "3.4.23";
src = fetchFromGitHub
{
owner = "timvisee";
repo = "send";
rev = "6ad2885a168148fb996d3983457bc39527c7c8e5";
hash = "sha256-/w9KhktDVSAmp6EVIRHFM63mppsIzYSm5F7CQQd/2+E=";
};
npmDepsHash = "sha256-r1iaurKuhpP0sevB5pFdtv9j1ikM1fKL7Jgakh4FzTI=";
makeCacheWritable = true;
}

View File

@@ -0,0 +1,15 @@
{
lib, fetchPypi, buildPythonPackage,
numpy, pillow, wxPython_4_2, matplotlib, ipython, pyopengl
}: buildPythonPackage rec
{
pname = "spectral";
version = "0.23.1";
src = fetchPypi
{
inherit pname version;
sha256 = "sha256-4YIic1Je81g7J6lmIm1Vr+CefSmnI2z82LwN+x+Wj8I=";
};
doCheck = false;
propagatedBuildInputs = [ numpy pillow wxPython_4_2 matplotlib ipython pyopengl ];
}

View File

@@ -0,0 +1,15 @@
{ stdenv, fetchFromGitHub, cmake, pkg-config, boost, openssl, zlib, curl }: stdenv.mkDerivation rec
{
pname = "tgbot-cpp";
version = "1.7.2";
src = fetchFromGitHub
{
owner = "reo7sp";
repo = "tgbot-cpp";
rev = "v${version}";
sha256 = "TKirSxEUqFB1WtzNEfU4EJK3p7V5xcFIvA2+QVX7TlA=";
};
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ boost openssl zlib curl.dev ];
propagatedBuildInputs = buildInputs;
}

View File

@@ -0,0 +1,42 @@
{ lib, stdenv, steam-run, fetchurl, writeShellScript }:
let
typora-dist = stdenv.mkDerivation rec
{
pname = "typora-dist";
version = "1.6.6";
src = fetchurl
{
url = "https://download.typora.io/linux/typora_${version}_amd64.deb";
sha256 = "sha256-77mCgmsROLhfuOmOOyl2C5Ug2NfqEvcD+kMA3aiAQtA=";
};
dontFixup = true;
unpackPhase =
''
ar x ${src}
tar xf data.tar.xz
'';
installPhase =
''
mkdir -p $out
mv usr/share $out
'';
};
in stdenv.mkDerivation rec
{
pname = "typora";
inherit (typora-dist) version;
BuildInputs = [ typora-dist steam-run ];
startScript = writeShellScript "typora" "${steam-run}/bin/steam-run ${typora-dist}/share/typora/Typora $@";
phases = [ "installPhase" ];
installPhase =
''
mkdir -p $out/bin $out/share/applications
ln -s ${startScript} $out/bin/typora
cp ${typora-dist}/share/applications/typora.desktop $out/share/applications
sed -i "s|Exec=.*|Exec=${startScript} %U|g" $out/share/applications/typora.desktop
sed -i "s|Icon=.*|Icon=${typora-dist}/share/icons/hicolor/256x256/apps/typora.png|g" \
$out/share/applications/typora.desktop
'';
}

View File

@@ -0,0 +1,14 @@
{ lib, fetchFromGitHub, buildPythonPackage, numpy, h5py, phonopy }: buildPythonPackage rec
{
pname = "upho";
version = "0.6.6";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "upho";
rev = "0f27ac6918e8972c70692816438e4ac37ec6b348";
sha256 = "sha256-NvoV+AUH9MmGT4ohrLAAvpLs8APP2DOKYlZVliHrVRM=";
};
doCheck = false;
propagatedBuildInputs = [ numpy h5py phonopy ];
}

View File

@@ -0,0 +1,28 @@
{
stdenv, lib, fetchFromGitLab,
wrapGAppsHook, autoreconfHook, autoconf, libtool, intltool, gettext, automake, gtk-doc, pkg-config, gfortran, libxslt,
glib, gtk3, epoxy, libyaml
}:
stdenv.mkDerivation
{
pname = "v_sim";
version = "3.8.0_p20230824";
src = fetchFromGitLab
{
owner = "l_sim";
repo = "v_sim";
rev = "8abc67b56795c19a8e2357d442b556c71d2441cb";
sha256 = "KQNd3BGvkZVsfIPVLEEMBptiFQYeCbWGR28ds2Y+w2Y=";
};
buildInputs = [ glib gtk3 epoxy libyaml ];
nativeBuildInputs =
[
autoreconfHook wrapGAppsHook autoconf libtool intltool gettext automake pkg-config
gtk-doc gfortran libxslt.bin
];
enableParallelBuilding = true;
postPatch =
''
./autogen.sh
'';
}

View File

@@ -0,0 +1,77 @@
# {
# stdenv, requireFile, config, rsync, intel-mpi, ifort,
# mkl
# }:
# stdenv.mkDerivation rec
# {
# pname = "vasp";
# version = "6.4.0";
# # nix-store --query --hash $(nix store add-path ./vasp-6.4.0)
# src = requireFile
# {
# name = "${pname}-${version}";
# sha256 = "189i1l5q33ynmps93p2mwqf5fx7p4l50sls1krqlv8ls14s3m71f";
# hashMode = "recursive";
# message = "Source file not found.";
# };
# VASP_TARGET_CPU = if config ? oneapiArch then "-x${config.oneapiArch}" else "";
# MKLROOT = mkl;
# makeFlags = "DEPS=1";
# enableParallelBuilding = true;
# buildInputs = [ mkl intel-mpi ifort ];
# nativeBuildInputs = [ rsync ];
# configurePhase =
# ''
# cp arch/makefile.include.intel makefile.include
# echo "CPP_OPTIONS += -Duse_shmem -Dshmem_bcast_buffer -Dshmem_rproj" >> makefile.include
# echo "OBJECTS_LIB += getshmem.o" >> makefile.include
# mkdir -p bin
# '';
# installPhase =
# ''
# mkdir -p $out/bin
# for i in std gam ncl; do
# cp bin/vasp_$i $out/bin/vasp-cpu-${version}-$i
# done
# '';
# doStrip = false;
# doFixup = false;
# }
{
stdenvNoCC, requireFile, rsync, blas, scalapack, openmpi, openmp, gfortran, gcc, fftwMpi
}:
stdenvNoCC.mkDerivation rec
{
pname = "vasp";
version = "6.4.0";
# nix-store --query --hash $(nix store add-path ./vasp-6.4.0)
src = requireFile
{
name = "${pname}-${version}";
sha256 = "189i1l5q33ynmps93p2mwqf5fx7p4l50sls1krqlv8ls14s3m71f";
hashMode = "recursive";
message = "Source file not found.";
};
# VASP_TARGET_CPU = if config ? oneapiArch then "-x${config.oneapiArch}" else "";
# MKLROOT = mkl;
makeFlags = "DEPS=1";
enableParallelBuilding = true;
buildInputs = [ blas scalapack openmpi openmp gfortran gfortran.cc gcc fftwMpi.dev fftwMpi ];
nativeBuildInputs = [ rsync ];
FFTW_ROOT = fftwMpi.dev;
configurePhase =
''
cp ${./makefile.include/${version}-gnu} makefile.include
chmod +w makefile.include
echo "CPP_OPTIONS += -Duse_shmem -Dshmem_bcast_buffer -Dshmem_rproj" >> makefile.include
echo "OBJECTS_LIB += getshmem.o" >> makefile.include
mkdir -p bin
'';
installPhase =
''
mkdir -p $out/bin
for i in std gam ncl; do
cp bin/vasp_$i $out/bin/vasp-gnu-${version}-$i
done
'';
}

View File

@@ -0,0 +1,94 @@
# Default precompiler options
CPP_OPTIONS = -DHOST=\"LinuxGNU\" \
-DMPI -DMPI_BLOCK=8000 -Duse_collective \
-DscaLAPACK \
-DCACHE_SIZE=4000 \
-Davoidalloc \
-Dvasp6 \
-Duse_bse_te \
-Dtbdyn \
-Dfock_dblbuf \
-D_OPENMP
CPP = gcc -E -C -w $*$(FUFFIX) >$*$(SUFFIX) $(CPP_OPTIONS)
FC = mpif90 -fopenmp
FCL = mpif90 -fopenmp
FREE = -ffree-form -ffree-line-length-none
FFLAGS = -w -ffpe-summary=none
OFLAG = -O3
OFLAG_IN = $(OFLAG)
DEBUG = -O0
OBJECTS = fftmpiw.o fftmpi_map.o fftw3d.o fft3dlib.o
OBJECTS_O1 += fftw3d.o fftmpi.o fftmpiw.o
OBJECTS_O2 += fft3dlib.o
# For what used to be vasp.5.lib
CPP_LIB = $(CPP)
FC_LIB = $(FC)
CC_LIB = gcc
CFLAGS_LIB = -O
FFLAGS_LIB = -O1
FREE_LIB = $(FREE)
OBJECTS_LIB = linpack_double.o
# For the parser library
CXX_PARS = g++
LLIBS = -lstdc++
##
## Customize as of this point! Of course you may change the preceding
## part of this file as well if you like, but it should rarely be
## necessary ...
##
# When compiling on the target machine itself, change this to the
# relevant target when cross-compiling for another architecture
# VASP_TARGET_CPU ?= -march=native
# FFLAGS += $(VASP_TARGET_CPU)
# For gcc-10 and higher (comment out for older versions)
FFLAGS += -fallow-argument-mismatch
# BLAS and LAPACK (mandatory)
# OPENBLAS_ROOT ?= /path/to/your/openblas/installation
# BLASPACK = -L$(OPENBLAS_ROOT)/lib -lopenblas
BLASPACK = -lblas
# scaLAPACK (mandatory)
# SCALAPACK_ROOT ?= /path/to/your/scalapack/installation
# SCALAPACK = -L$(SCALAPACK_ROOT)/lib -lscalapack
SCALAPACK = -lscalapack
LLIBS += $(SCALAPACK) $(BLASPACK)
# FFTW (mandatory)
# FFTW_ROOT ?= /path/to/your/fftw/installation
# LLIBS += -L$(FFTW_ROOT)/lib -lfftw3 -lfftw3_omp
LLIBS += -lfftw3 -lfftw3_omp
INCS += -I$(FFTW_ROOT)/include
# HDF5-support (optional but strongly recommended)
#CPP_OPTIONS+= -DVASP_HDF5
#HDF5_ROOT ?= /path/to/your/hdf5/installation
#LLIBS += -L$(HDF5_ROOT)/lib -lhdf5_fortran
#INCS += -I$(HDF5_ROOT)/include
# For the VASP-2-Wannier90 interface (optional)
#CPP_OPTIONS += -DVASP2WANNIER90
#WANNIER90_ROOT ?= /path/to/your/wannier90/installation
#LLIBS += -L$(WANNIER90_ROOT)/lib -lwannier
# For the fftlib library (recommended)
CPP_OPTIONS+= -Dsysv
FCL += fftlib.o
CXX_FFTLIB = g++ -fopenmp -std=c++11 -DFFTLIB_THREADSAFE
# INCS_FFTLIB = -I./include -I$(FFTW_ROOT)/include
INCS_FFTLIB = -I./include
LIBS += fftlib
LLIBS += -ldl

View File

@@ -0,0 +1,64 @@
{ stdenv, fetchurl, requireFile, autoPatchelfHook, makeWrapper, python3, attrsToList, gnused }:
let
potcar = requireFile
{
name = "POTCAR";
sha256 = "01adpp9amf27dd39m8svip3n6ax822vsyhdi6jn5agj13lis0ln3";
hashMode = "recursive";
message = "POTCAR not found.";
};
unwrapped = stdenv.mkDerivation
{
pname = "vaspkit-unwrapped";
version = "1.4.1";
buildInputs = [ autoPatchelfHook stdenv.cc.cc ];
src = fetchurl
{
url = "mirror://sourceforge/vaspkit/Binaries/vaspkit.1.4.1.linux.x64.tar.gz";
sha256 = "0i5m7nbvqk7hzxisyydjvs2l8lnvj9vsxa170783kv9zmp51lnvs";
};
installPhase =
''
runHook preInstall
mkdir -p $out
cp -r * $out
runHook postInstall
'';
};
python = python3.withPackages (pythonPackages: with pythonPackages; [ numpy scipy matplotlib ]);
envirmentVariables =
{
LDA_PATH = "${potcar}/PAW_LDA";
PBE_PATH = "${potcar}/PAW_PBE";
GGA_PATH = "${potcar}/PAW_PW91";
VASPKIT_UTILITIES_PATH = "${unwrapped}/utilities";
PYTHON_BIN = "${python}/bin/python";
AUTO_PLOT = ".TRUE.";
};
in
stdenv.mkDerivation rec
{
pname = "vaspkit";
inherit (unwrapped) version;
phases = [ "installPhase" ];
buildInputs = [ makeWrapper ];
nativeBuildInputs = [ gnused ];
replaceEnv = builtins.concatStringsSep "" (map
(variable: ''sed 's|\(${variable.name}\s*=\s*\)\(\S\+\)|\1${variable.value}|g' -i $out/.vaspkit'' + "\n")
(attrsToList envirmentVariables));
installPhase =
''
runHook preInstall
# setup ~/.vaspkit
mkdir -p $out
cp ${unwrapped}/how_to_set_environment_variables $out/.vaspkit
# setup wrapper
makeWrapper ${unwrapped}/bin/vaspkit $out/bin/vaspkit --set HOME $out;
''
+ replaceEnv
+ ''
runHook postInstall
'';
}

View File

@@ -0,0 +1,42 @@
{
lib, stdenv, fetchurl, autoPatchelfHook, wrapGAppsHook, makeWrapper,
glib, gtk2, xorg, libGLU, gtk3, writeShellScript, gsettings-desktop-schemas, xdg-utils
}:
stdenv.mkDerivation rec
{
pname = "vesta";
version = "3.5.5";
src = fetchurl
{
url = "https://jp-minerals.org/vesta/archives/${version}/VESTA-gtk3.tar.bz2";
sha256 = "sRzQNJA7+hsjLWmykqe6bH0p1/aGEB8hCuxCyPzxYHs=";
};
desktopFile = fetchurl
{
url = "https://aur.archlinux.org/cgit/aur.git/plain/VESTA.desktop?h=vesta&id=4fae08afc37ee0fd88d14328cf0d6b308fea04d1";
sha256 = "Tq4AzQgde2KIWKA1k6JlxvdphGG9JluHMZjVw0fBUeQ=";
};
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook makeWrapper ];
buildInputs = [ glib gtk2 xorg.libXxf86vm libGLU gtk3 xorg.libXtst ];
unpackPhase = "tar -xf ${src}";
installPhase =
''
echo $out
mkdir -p $out/share/applications
cp ${desktopFile} $out/share/applications/vesta.desktop
sed -i "s|Exec=.*|Exec=$out/bin/vesta|" $out/share/applications/vesta.desktop
sed -i "s|Icon=.*|Icon=$out/opt/VESTA-gtk3/img/logo.png|" $out/share/applications/vesta.desktop
mkdir -p $out/opt
cp -r VESTA-gtk3 $out/opt/VESTA-gtk3
mkdir -p $out/bin
makeWrapper $out/opt/VESTA-gtk3/VESTA $out/bin/vesta
patchelf --remove-needed libjawt.so $out/opt/VESTA-gtk3/PowderPlot/libswt-awt-gtk-3346.so
'';
}

View File

@@ -0,0 +1,24 @@
{ lib, stdenv, fetchFromGitHub, python3 }:
let
python = python3.withPackages (ps: with ps; [ evdev pyudev ]);
in stdenv.mkDerivation
{
name = "yogabook-support";
src = fetchFromGitHub
{
owner = "jekhor";
repo = "yogabook-support";
rev = "8ecf7861e469ba4094115fff0e81d537135e3f22";
sha256 = "4UtiQooCaeUDHc9YE9EQRJ2MNKvOqqCv85k0YyI2BO4=";
};
buildInputs = [ python ];
installPhase =
''
mkdir -p $out/bin
cp pen-key-handler yogabook-modes-handler $out/bin
mkdir -p $out/lib/udev/rules.d
cp 61-sensor-yogabook.rules $out/lib/udev/rules.d
mkdir -p $out/lib/udev/hwdb.d
cp 61-sensor-yogabook.hwdb $out/lib/udev/hwdb.d
'';
}

View File

@@ -0,0 +1,18 @@
{ stdenv, fetchFromGitHub }: stdenv.mkDerivation rec
{
pname = "zpp-bits";
version = "4.4.19";
src = fetchFromGitHub
{
owner = "eyalz800";
repo = "zpp_bits";
rev = "v${version}";
sha256 = "ejIwrvCFALuBQbQhTfzjBb11oMR/akKnboB60GWbjlQ=";
};
phases = [ "installPhase" ];
installPhase =
''
mkdir -p $out/include
cp $src/zpp_bits.h $out/include
'';
}

View File

@@ -1,30 +0,0 @@
{ hostName }: { pkgs, ... }@inputs:
{
config =
{
nixpkgs.hostPlatform = "x86_64-linux";
nix =
{
settings =
{
experimental-features = [ "nix-command" "flakes" ];
keep-outputs = true;
system-features = [ "big-parallel" ];
keep-failed = true;
};
daemonIOSchedClass = "idle";
daemonCPUSchedPolicy = "idle";
};
networking.hostName = hostName;
time.timeZone = "Asia/Shanghai";
system.stateVersion = "22.11";
nixpkgs.config.allowUnfree = true;
systemd =
{
extraConfig = "DefaultTimeoutStopSec=10s";
user.extraConfig = "DefaultTimeoutStopSec=10s";
services.nix-daemon.serviceConfig = { Slice = "-.slice"; Nice = "19"; };
};
programs.nix-ld.enable = true;
};
}

View File

@@ -1,17 +0,0 @@
{ efi, timeout ? 5 }: { pkgs, ... }@inputs:
{
config =
{
boot =
{
loader =
{
timeout = timeout;
systemd-boot.enable = true;
efi.canTouchEfiVariables = efi;
};
initrd.systemd.enable = true;
};
hardware.enableAllFirmware = true;
};
}

View File

@@ -1,33 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
boot =
{
# kernelPackages = ( inputs.inputs.nixpkgs.lib.nixosSystem
# {
# system = "x86_64-linux";
# modules =
# [{
# nixpkgs =
# {
# hostPlatform = { system = "x86_64-linux"; gcc = { arch = "alderlake"; tune = "alderlake"; }; };
# config.allowUnfree = true;
# };
# }];
# } ).pkgs.linuxPackages_zen;
# kernelPackages = inputs.pkgs.linuxPackages_zen;
kernelPackages = inputs.pkgs.linuxPackages_xanmod_latest;
initrd.availableKernelModules =
[
"ahci" "i915" "intel_cstate" "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" "nvme" "sr_mod"
"usb_storage" "virtio_blk" "virtio_pci" "xhci_pci"
];
kernelModules = [ "kvm-intel" ];
extraModprobeConfig = "options kvm_intel nested=1";
kernelParams = [ "delayacct" "acpi_osi=Linux" "resume_offset=19145984" ];
resumeDevice = "/dev/mapper/root";
};
hardware.cpu.intel.updateMicrocode = true;
};
}

View File

@@ -1,11 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
boot =
{
kernelPackages = inputs.pkgs.linuxPackages_xanmod_latest;
initrd.availableKernelModules = [ "ahci" "sr_mod" "usb_storage" "virtio_blk" "virtio_pci" "xhci_pci" ];
};
};
}

88
modules/bugs/default.nix Normal file
View File

@@ -0,0 +1,88 @@
inputs:
let
inherit (inputs.localLib) stripeTabs;
inherit (builtins) map attrNames;
inherit (inputs.lib) mkMerge mkIf mkOption types;
bugs =
{
# intel i915 hdmi
intel-hdmi.boot.kernelPatches = [{ name = "intel-hdmi"; patch = ./intel-hdmi.patch; }];
# suspend & hibernate do not use platform
suspend-hibernate-no-platform.systemd.sleep.extraConfig =
''
SuspendState=freeze
HibernateMode=shutdown
'';
# reload iwlwifi after resume from hibernate
hibernate-iwlwifi.systemd.services.reload-iwlwifi-after-hibernate =
{
description = "reload iwlwifi after resume from hibernate";
after = [ "systemd-hibernate.service" ];
serviceConfig.Type = "oneshot";
script = let modprobe = "${inputs.pkgs.kmod}/bin/modprobe"; in
''
${modprobe} -r iwlwifi
${modprobe} iwlwifi
echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
'';
wantedBy = [ "systemd-hibernate.service" ];
};
# disable wakeup on lid open
suspend-lid-no-wakeup.systemd.services.lid-no-wakeup =
{
description = "lid no wake up";
serviceConfig.Type = "oneshot";
script =
let
cat = "${inputs.pkgs.coreutils}/bin/cat";
grep = "${inputs.pkgs.gnugrep}/bin/grep";
in
''
if ${cat} /proc/acpi/wakeup | ${grep} LID0 | ${grep} -q enabled
then
echo LID0 > /proc/acpi/wakeup
fi
'';
wantedBy = [ "multi-user.target" ];
};
# xmunet use old encryption
xmunet.nixpkgs.config.packageOverrides = pkgs: { wpa_supplicant = pkgs.wpa_supplicant.overrideAttrs
(attrs: { patches = attrs.patches ++ [ ./xmunet.patch ];}); };
suspend-hibernate-waydroid.systemd.services =
let
systemctl = "${inputs.pkgs.systemd}/bin/systemctl";
in
{
"waydroid-hibernate" =
{
description = "waydroid hibernate";
wantedBy = [ "systemd-hibernate.service" "systemd-suspend.service" ];
before = [ "systemd-hibernate.service" "systemd-suspend.service" ];
serviceConfig.Type = "oneshot";
script = "${systemctl} stop waydroid-container";
};
"waydroid-resume" =
{
description = "waydroid resume";
wantedBy = [ "systemd-hibernate.service" "systemd-suspend.service" ];
after = [ "systemd-hibernate.service" "systemd-suspend.service" ];
serviceConfig.Type = "oneshot";
script = "${systemctl} start waydroid-container";
};
};
firefox.programs.firefox.enable = inputs.lib.mkForce false;
embree.nixpkgs.overlays =
[(final: prev: { embree = prev.embree.override { stdenv = final.genericPackages.stdenv; }; })];
nvme.boot.kernelParams = [ "nvme_core.default_ps_max_latency_us=0" "iommu=soft" "pcie_aspm=off" ];
firmware-unstable.nixpkgs.overlays =
[ (final: prev: { linux-firmware = final.unstablePackages.linux-firmware; }) ];
};
in
{
options.nixos.bugs = mkOption
{
type = types.listOf (types.enum (attrNames bugs));
default = [];
};
config = mkMerge (map (bug: mkIf (builtins.elem bug inputs.config.nixos.bugs) bugs.${bug}) (attrNames bugs));
}

View File

@@ -0,0 +1,14 @@
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 55544d484318..d6f257f8fd14 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -2708,7 +2708,7 @@ static void parse_ddi_port(struct intel_bios_encoder_data *devdata)
if (i915->display.vbt.ports[port]) {
drm_dbg_kms(&i915->drm,
"More than one child device for port %c in VBT, using the first.\n",
port_name(port));
- return;
+ // return;
}
sanitize_device_type(devdata, port);

View File

@@ -5,7 +5,7 @@
SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv2);
SSL_CTX_set_options(ssl, SSL_OP_NO_SSLv3);
-
+ SSL_CTX_set_options(ssl, SSL_OP_LEGACY_SERVER_CONNECT);
+ SSL_CTX_set_options(ssl, SSL_OP_LEGACY_SERVER_CONNECT);
SSL_CTX_set_mode(ssl, SSL_MODE_AUTO_RETRY);
#ifdef SSL_MODE_NO_AUTO_CHAIN

36
modules/default.nix Normal file
View File

@@ -0,0 +1,36 @@
inputs:
let
inherit (inputs) topInputs;
inherit (inputs.localLib) mkModules;
in
{
imports = mkModules
[
topInputs.home-manager.nixosModules.home-manager
topInputs.sops-nix.nixosModules.sops
topInputs.aagl.nixosModules.default
topInputs.nix-index-database.nixosModules.nix-index
topInputs.nur.nixosModules.nur
topInputs.nur-xddxdd.nixosModules.setupOverlay
topInputs.impermanence.nixosModules.impermanence
(inputs: { config.nixpkgs.overlays =
[
topInputs.qchem.overlays.default
topInputs.nixd.overlays.default
topInputs.nix-alien.overlays.default
topInputs.napalm.overlays.default
topInputs.pnpm2nix-nzbr.overlays.default
topInputs.lmix.overlays.default
(final: prev: topInputs.aagl.overlays.default {} final.unstablePackages)
(import "${topInputs.dguibert-nur-packages}/overlays/nvhpc-overlay")
(final: prev:
{
touchix = topInputs.touchix.packages."${prev.system}";
nix-vscode-extensions = topInputs.nix-vscode-extensions.extensions."${prev.system}";
nur-xddxdd = topInputs.nur-xddxdd.overlays.default final prev;
deploy-rs = { inherit (prev) deploy-rs; inherit ((topInputs.deploy-rs.overlay final prev).deploy-rs) lib; };
})
];})
./hardware ./packages ./system ./virtualization ./services ./bugs ./users
];
}

View File

@@ -1,31 +0,0 @@
{
config =
{
fileSystems =
{
"/" =
{
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=@root,compress-force=zstd:3" ];
};
"/swap" = {
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=@swap" ];
};
"/boot" =
{
device = "/dev/disk/by-uuid/50DE-B72A";
fsType = "vfat";
};
};
swapDevices = [ { device = "/swap/swap"; } ];
boot.initrd.luks.devices.root =
{
device = "/dev/disk/by-partuuid/49fe75e3-bd94-4c75-9b21-2c77a1f74c4e";
header = "/dev/disk/by-partuuid/c341ca23-bb14-4927-9b31-a9dcc959d0f5";
allowDiscards = true;
};
};
}

View File

@@ -1,25 +0,0 @@
{
config =
{
fileSystems =
{
"/" =
{
device = "/dev/mapper/root";
fsType = "btrfs";
options = [ "subvol=@root,compress-force=zstd:3" ];
};
"/boot" =
{
device = "/dev/disk/by-uuid/18C6-B1F4";
fsType = "vfat";
};
};
boot.initrd.luks.devices.root =
{
device = "/dev/disk/by-partuuid/4f419ebd-2b49-4959-aa5f-46cfdd0cfc3e";
header = "/dev/disk/by-partuuid/b0255c40-fd3c-4c95-9af7-4d64ad2e450f";
allowDiscards = true;
};
};
}

View File

@@ -1,16 +0,0 @@
{ pkgs, ... }@inputs:
{
config.fonts =
{
fontDir.enable = true;
fonts = with inputs.pkgs;
[ noto-fonts source-han-sans source-han-serif source-code-pro hack-font jetbrains-mono nerdfonts ];
fontconfig.defaultFonts =
{
emoji = [ "Noto Color Emoji" ];
monospace = [ "Noto Sans Mono CJK SC" "Sarasa Mono SC" "DejaVu Sans Mono"];
sansSerif = [ "Noto Sans CJK SC" "Source Han Sans SC" "DejaVu Sans" ];
serif = [ "Noto Serif CJK SC" "Source Han Serif SC" "DejaVu Serif" ];
};
};
}

View File

@@ -1 +0,0 @@
{ config.hardware.bluetooth.enable = true; }

View File

@@ -1 +0,0 @@
{ config.nix.settings.system-features = [ "gccarch-alderlake" ]; }

View File

@@ -1 +0,0 @@
{ config.nix.settings.system-features = [ "gccarch-alderlake" ]; }

View File

@@ -0,0 +1,193 @@
inputs:
{
options.nixos.hardware = let inherit (inputs.lib) mkOption types; in
{
bluetooth.enable = mkOption { type = types.bool; default = false; };
joystick.enable = mkOption { type = types.bool; default = false; };
printer.enable = mkOption { type = types.bool; default = false; };
sound.enable = mkOption { type = types.bool; default = false; };
cpus = mkOption { type = types.listOf (types.enum [ "intel" "amd" ]); default = []; };
gpus = mkOption { type = types.listOf (types.enum [ "intel" "nvidia" ]); default = []; };
prime =
{
enable = mkOption { type = types.bool; default = false; };
mode = mkOption { type = types.enum [ "offload" "sync" ]; default = "offload"; };
busId = mkOption { type = types.attrsOf types.str; default = {}; };
};
gamemode.drmDevice = mkOption { type = types.int; default = 0; };
halo-keyboard.enable = mkOption { type = types.bool; default = false; };
};
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (inputs.config.nixos) hardware;
inherit (builtins) listToAttrs map concatLists;
inherit (inputs.localLib) attrsToList;
in mkMerge
[
# bluetooth
(mkIf hardware.bluetooth.enable { hardware.bluetooth.enable = true; })
# joystick
(mkIf hardware.joystick.enable { hardware = { xone.enable = true; xpadneo.enable = true; }; })
# printer
(
mkIf hardware.printer.enable
{
services =
{
printing = { enable = true; drivers = [ inputs.pkgs.cnijfilter2 ]; };
avahi = { enable = true; nssmdns = true; openFirewall = true; };
};
}
)
# sound
(
mkIf hardware.sound.enable
{
hardware.pulseaudio.enable = false;
services.pipewire = { enable = true; alsa = { enable = true; support32Bit = true; }; pulse.enable = true; };
sound.enable = true;
security.rtkit.enable = true;
environment.etc."wireplumber/main.lua.d/50-alsa-config.lua".text =
let
content = builtins.readFile
(inputs.pkgs.wireplumber + "/share/wireplumber/main.lua.d/50-alsa-config.lua");
matched = builtins.match
".*\n([[:space:]]*)(--\\[\"session\\.suspend-timeout-seconds\"][^\n]*)[\n].*" content;
spaces = builtins.elemAt matched 0;
comment = builtins.elemAt matched 1;
config = ''["session.suspend-timeout-seconds"] = 0'';
in
builtins.replaceStrings [(spaces + comment)] [(spaces + config)] content;
}
)
# cpus
(
mkIf (hardware.cpus != [])
{
hardware.cpu = listToAttrs
(map (name: { inherit name; value = { updateMicrocode = true; }; }) hardware.cpus);
boot.initrd.availableKernelModules =
let
modules =
{
intel = [ "intel_cstate" "aesni_intel" ];
amd = [];
};
in
concatLists (map (cpu: modules.${cpu}) hardware.cpus);
}
)
# gpus
(
mkIf (hardware.gpus != [])
{
boot.initrd.availableKernelModules =
let
modules =
{
intel = [ "i915" ];
nvidia = [ "nvidia" "nvidia_drm" "nvidia_modeset" "nvidia_uvm" ];
};
in
concatLists (map (gpu: modules.${gpu}) hardware.gpus);
hardware =
{
opengl =
{
enable = true;
driSupport = true;
extraPackages =
with inputs.pkgs;
let
packages =
{
intel = [ intel-compute-runtime intel-media-driver libvdpau-va-gl ]; # intel-vaapi-driver
nvidia = [ vaapiVdpau ];
};
in
concatLists (map (gpu: packages.${gpu}) hardware.gpus);
driSupport32Bit = true;
};
nvidia.nvidiaSettings = builtins.elem "nvidia" hardware.gpus;
};
}
)
(mkIf (builtins.elem "intel" hardware.gpus) { services.xserver.deviceSection = ''Driver "modesetting"''; })
# prime
(
mkIf hardware.prime.enable
{
hardware.nvidia = mkMerge
[
(
mkIf (hardware.prime.mode == "offload")
{
prime.offload = { enable = true; enableOffloadCmd = true; };
powerManagement = { finegrained = true; enable = true; };
}
)
(
mkIf (hardware.prime.mode == "sync")
{
prime = { sync.enable = true; };
# prime.forceFullCompositionPipeline = true;
}
)
{
prime = listToAttrs
(map (gpu: { inherit (gpu) value; name = "${gpu.name}BusId"; }) (attrsToList hardware.prime.busId));
}
];
}
)
{ programs.gamemode.settings.gpu.gpu_device = "${toString hardware.gamemode.drmDevice}"; }
# halo-keyboard
(mkIf hardware.halo-keyboard.enable
(
let
keyboard = inputs.pkgs.localPackages.chromiumos-touch-keyboard;
support = inputs.pkgs.localPackages.yoga-support;
in
{
services.udev.packages = [ keyboard support ];
systemd.services =
{
touch-keyboard-handler.serviceConfig =
{
Type = "simple";
WorkingDirectory = "/etc/touch_keyboard";
# ExecStartPre = let sh = "${inputs.pkgs.bash}/bin/sh"; in
# [
# ''-${sh} -c "echo 0 > /sys/class/pwm/pwmchip1/export"''
# ''${sh} -c "echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable"''
# ''${sh} -c "echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable"''
# ];
ExecStart = "${keyboard}/bin/touch_keyboard_handler";
};
yogabook-modes-handler =
{
wantedBy = [ "default.target" ];
serviceConfig =
{
Type = "simple";
ExecStart = "${support}/bin/yogabook-modes-handler";
StandardOutput = "journal";
};
};
monitor-sensor =
{
wantedBy = [ "default.target" ];
serviceConfig =
{
Type = "simple";
ExecStart = "${inputs.pkgs.iio-sensor-proxy}/bin/monitor-sensor --hinge";
};
};
};
environment.etc."touch_keyboard".source = "${keyboard}/etc/touch_keyboard";
}
))
];
}

View File

@@ -1 +0,0 @@
{ config.hardware = { xone.enable = true; xpadneo.enable = true; }; }

View File

@@ -1,24 +0,0 @@
{ intelBusId, nvidiaBusId }: { pkgs, ... }@inputs:
{
config =
{
services.xserver.videoDrivers = inputs.lib.mkBefore [ "intel" "nvidia" ];
hardware.nvidia.prime =
{
offload.enable = true;
intelBusId = intelBusId;
nvidiaBusId = nvidiaBusId;
};
environment.systemPackages =
[(
inputs.pkgs.writeShellScriptBin "nvidia-offload"
''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
''
)];
};
}

View File

@@ -1 +0,0 @@
{ config.services.printing.enable = true; }

View File

@@ -1,22 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire =
{
enable = true;
alsa = { enable = true; support32Bit = true; };
pulse.enable = true;
};
systemd.user.services.pipewire.serviceConfig.Nice = -20;
systemd.user.services.pipewire-pulse.serviceConfig.Nice = -20;
systemd.services.rtkit-daemon.serviceConfig.ExecStart =
[
""
"${inputs.pkgs.rtkit.outPath}/libexec/rtkit-daemon --our-realtime-priority=90 --max-realtime-priority=89 --min-nice-level=-19 --scheduling-policy=RR --rttime-usec-max=2000000 --users-max=100 --processes-per-user-max=1000 --threads-per-user-max=10000 --actions-burst-sec=10 --actions-per-burst-max=1000 --canary-cheep-msec=30000 --canary-watchdog-msec=60000"
];
};
}

View File

@@ -1,7 +0,0 @@
{
config.home-manager.users.chn = { pkgs, ... }:
{
home.stateVersion = "22.11";
programs.zsh = import ./zsh.nix { inherit pkgs; };
};
}

View File

@@ -1,12 +0,0 @@
{
config.home-manager =
{
useGlobalPkgs = true;
useUserPackages = true;
users.root = { pkgs, ... }:
{
home.stateVersion = "22.11";
programs.zsh = import ./zsh.nix { inherit pkgs; };
};
};
}

View File

@@ -1,35 +0,0 @@
{ pkgs }:
{
enable = true;
initExtraBeforeCompInit =
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
'';
plugins =
[
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{
name = "zsh-exa";
src = pkgs.fetchFromGitHub
{
owner = "ptavares";
repo = "zsh-exa";
rev = "0.2.3";
sha256 = "0vn3iv9d3c1a4rigq2xm52x8zjaxlza1pd90bw9mbbkl9iq8766r";
};
}
];
}

View File

@@ -1,20 +0,0 @@
{ fcitx }: { pkgs, ... }@inputs:
{
config.i18n =
{
defaultLocale = "zh_CN.UTF-8";
supportedLocales = ["zh_CN.UTF-8/UTF-8" "en_US.UTF-8/UTF-8" "C.UTF-8/UTF-8"];
}
//
(
if fcitx then
{
inputMethod =
{
enabled = "fcitx5";
fcitx5.addons = with inputs.pkgs; [ fcitx5-rime fcitx5-chinese-addons fcitx5-mozc ];
};
}
else {}
);
}

View File

@@ -1,19 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
services.xserver =
{
enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
};
environment =
{
sessionVariables."GTK_USE_PORTAL" = "1";
systemPackages = [ inputs.pkgs.libsForQt5.qtstyleplugin-kvantum ];
};
xdg.portal.extraPortals = with inputs.pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
programs.xwayland.enable = true;
};
}

View File

@@ -1 +0,0 @@
{ config.networking.networkmanager.enable = true; }

View File

@@ -1,9 +0,0 @@
{
config.services.dnsmasq.settings.address =
[
"/mirism.one/216.24.188.24"
"/beta.mirism.one/216.24.188.24"
"/ng01.mirism.one/216.24.188.24"
"/debug.mirism.one/127.0.0.1"
];
}

View File

@@ -1 +0,0 @@
{ config.services.openssh.enable = true; }

View File

@@ -1,49 +0,0 @@
inputs:
{
config =
{
services =
{
dnsmasq =
{
enable = true;
settings =
{
no-poll = true;
server = [ "127.0.0.1#10853" ];
listen-address = "127.0.0.1";
bind-interfaces = true;
ipset =
[
"/developer.download.nvidia.com/noproxy_net"
"/yuanshen.com/noproxy_net"
"/zoom.us/noproxy_net"
];
};
};
xray = { enable = true; settingsFile = inputs.config.sops.secrets."xray.json".path; };
v2ray-forwarder = { enable = true; proxyPort = 10880; xmuPort = 10881; };
};
sops.secrets."xray.json" =
{ mode = "0440"; owner = "v2ray"; group = "v2ray"; restartUnits = [ "xray.service" ]; };
systemd.services.xray.serviceConfig =
{
DynamicUser = inputs.lib.mkForce false;
User = "v2ray";
Group = "v2ray";
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
};
users = { users.v2ray = { isSystemUser = true; group = "v2ray"; }; groups.v2ray = {}; };
boot.kernel.sysctl =
{
"net.ipv4.conf.all.route_localnet" = true;
"net.ipv4.conf.default.route_localnet" = true;
"net.ipv4.conf.all.accept_local" = true;
"net.ipv4.conf.default.accept_local" = true;
"net.ipv4.ip_forward" = true;
"net.ipv4.ip_nonlocal_bind" = true;
};
environment.etc."resolv.conf".text = "nameserver 127.0.0.1";
};
}

View File

@@ -1,7 +0,0 @@
{
config.nixpkgs.config.packageOverrides = pkgs:
{
wpa_supplicant = pkgs.wpa_supplicant.overrideAttrs ( attrs:
{ patches = attrs.patches ++ [ ./xmunet.patch ]; });
};
}

View File

@@ -0,0 +1,688 @@
inputs:
{
options.nixos.packages = let inherit (inputs.lib) mkOption types; in
{
packageSet = mkOption
{
type = types.enum
[
# no gui, only used for specific purpose
"server"
# gui, for daily use, but not install large programs such as matlab
"desktop"
# nearly everything
"workstation"
];
default = "server";
};
extraPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_packages = mkOption { type = types.listOf types.unspecified; default = []; };
_pythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
};
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (builtins) concatLists map listToAttrs;
inherit (inputs.localLib) attrsToList;
in mkMerge
[
# >= server
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# shell
ksh
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij neofetch ipfetch localPackages.pslist
unstablePackages.fastfetch
# lsxx
pciutils usbutils lshw util-linux lsof
# top
iotop iftop htop btop powertop s-tui
# editor
nano bat
# downloader
wget aria2 curl
# file manager
tree exa trash-cli lsd broot file xdg-ninja mlocate
# compress
pigz rar upx unzip zip lzip p7zip
# file system management
sshfs e2fsprogs adb-sync duperemove compsize
# disk management
smartmontools hdparm
# encryption and authentication
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
# networking
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils
# nix tools
nix-output-monitor nix-tree
# office
todo-txt-cli
# development
gdb unstablePackages.try
] ++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
inquirerpy requests python-telegram-bot tqdm fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 localPackages.eigengdb
])];
};
users.sharedModules = [(home-inputs:
{
config.programs =
{
zsh =
{
enable = true;
initExtraBeforeCompInit =
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
export PATH=~/bin:$PATH
function br
{
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}
alias todo="todo.sh"
'';
plugins =
[
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{
name = "zsh-lsd";
src = inputs.pkgs.fetchFromGitHub
{
owner = "z-shell";
repo = "zsh-lsd";
rev = "029a9cb0a9b39c9eb6c5b5100dd9182813332250";
sha256 = "sha256-oWjWnhiimlGBMaZlZB+OM47jd9hporKlPNwCx6524Rk=";
};
}
];
history =
{
path = "${home-inputs.config.xdg.dataHome}/zsh/zsh_history";
extended = true;
save = 100000000;
size = 100000000;
share = true;
};
};
direnv = { enable = true; nix-direnv.enable = true; };
git =
{
enable = true;
lfs.enable = true;
extraConfig =
{
core.editor = if inputs.config.nixos.system.gui.preferred then "code --wait" else "vim";
advice.detachedHead = false;
merge.conflictstyle = "diff3";
diff.colorMoved = "default";
};
package = inputs.pkgs.gitFull;
delta =
{
enable = true;
options =
{
side-by-side = true;
navigate = true;
syntax-theme = "GitHub";
light = true;
zero-style = "syntax white";
line-numbers-zero-style = "#ffffff";
};
};
};
ssh =
{
enable = true;
controlMaster = "auto";
controlPersist = "1m";
compression = true;
};
vim =
{
enable = true;
defaultEditor = true;
packageConfigurable = inputs.config.programs.vim.package;
settings =
{
number = true;
expandtab = false;
shiftwidth = 2;
tabstop = 2;
};
extraConfig =
''
set clipboard=unnamedplus
colorscheme evening
'';
};
};
})];
};
programs =
{
nix-index-database.comma.enable = true;
nix-index.enable = true;
zsh =
{
enable = true;
syntaxHighlighting.enable = true;
autosuggestions.enable = true;
enableCompletion = true;
ohMyZsh =
{
enable = true;
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
customPkgs = with inputs.pkgs; [ zsh-nix-shell ];
};
};
ccache.enable = true;
command-not-found.enable = false;
adb.enable = true;
gnupg.agent = { enable = true; enableSSHSupport = true; };
autojump.enable = true;
git =
{
enable = true;
package = inputs.pkgs.gitFull;
lfs.enable = true;
config =
{
init.defaultBranch = "main";
core = { quotepath = false; editor = "vim"; };
};
};
};
services =
{
fwupd.enable = true;
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
openssh.knownHosts =
let
servers =
{
vps6 =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO5ZcvyRyOnUCuRtqrM/Qf+AdUe3a5bhbnfyhw2FSLDZ";
hostnames = [ "vps6.chn.moe" "74.211.99.69" "192.168.82.1" ];
};
"initrd.vps6" =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB4DKB/zzUYco5ap6k9+UxeO04LL12eGvkmQstnYxgnS";
hostnames = [ "initrd.vps6.chn.moe" "74.211.99.69" ];
};
vps7 =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY";
hostnames = [ "vps7.chn.moe" "95.111.228.40" "192.168.82.2" ];
};
"initrd.vps7" =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGZyQpdQmEZw3nLERFmk2tS1gpSvXwW0Eish9UfhrRxC";
hostnames = [ "initrd.vps7.chn.moe" "95.111.228.40" ];
};
nas =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIktNbEcDMKlibXg54u7QOLt0755qB/P4vfjwca8xY6V";
hostnames = [ "[office.chn.moe]:5440" "192.168.82.4" ];
};
"initrd.nas" =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAoMu0HEaFQsnlJL0L6isnkNZdRq0OiDXyaX3+fl3NjT";
hostnames = [ "[office.chn.moe]:5440" ];
};
pc =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMSfREi19OSwQnhdsE8wiNwGSFFJwNGN0M5gN+sdrrLJ";
hostnames = [ "192.168.8.2.3" ];
};
hpc =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDVpsQW3kZt5alHC6mZhay3ZEe2fRGziG4YJWCv2nn/O";
hostnames = [ "hpc.xmu.edu.cn" ];
};
github =
{
ed25519 = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl";
hostnames = [ "github.com" ];
};
};
in listToAttrs (concatLists (map
(server:
(
if builtins.pathExists ./ssh/${server.name}_rsa.pub then
[{
name = "${server.name}-rsa";
value =
{
publicKey = builtins.readFile ./ssh/${server.name}_rsa.pub;
hostNames = server.value.hostnames;
};
}]
else []
)
++ (
if builtins.pathExists ./ssh/${server.name}_ecdsa.pub then
[{
name = "${server.name}-ecdsa";
value =
{
publicKey = builtins.readFile ./ssh/${server.name}_ecdsa.pub;
hostNames = server.value.hostnames;
};
}]
else []
)
++ (
if server.value ? ed25519 then
[{
name = "${server.name}-ed25519";
value =
{
publicKey = server.value.ed25519;
hostNames = server.value.hostnames;
};
}]
else []
))
(attrsToList servers)));
};
nix.settings.extra-sandbox-paths = [ inputs.config.programs.ccache.cacheDir ];
nixpkgs.config =
{
permittedInsecurePackages = with inputs.pkgs;
[
openssl_1_1.name electron_19.name nodejs-16_x.name python2.name electron_12.name
];
allowUnfree = true;
};
home-manager =
{
useGlobalPkgs = true;
useUserPackages = true;
};
}
# >= desktop
(
mkIf (builtins.elem inputs.config.nixos.packages.packageSet [ "desktop" "workstation" ] )
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# system management
gparted snapper-gui libsForQt5.qtstyleplugin-kvantum wl-clipboard-x11 kio-fuse wl-mirror
wayland-utils clinfo glxinfo vulkan-tools dracut etcher unstablePackages.btrfs-assistant
# nix tools
ssh-to-age deploy-rs.deploy-rs nixpkgs-fmt
# instant messager
element-desktop telegram-desktop discord inputs.config.nur.repos.linyinfeng.wemeet # native
cinny-desktop # nur-xddxdd.wine-wechat thunder
# browser
google-chrome
# networking
remmina putty mtr-gui
# password and key management
bitwarden yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui
# download
qbittorrent yt-dlp nur-xddxdd.baidupcs-go wgetpaste
# office
unstablePackages.crow-translate zotero pandoc ydict
# development
scrcpy
# media
spotify yesplaymusic mpv nomacs simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc
# text editor
localPackages.typora
# themes
orchis-theme tela-circle-icon-theme plasma-overdose-kde-theme materia-kde-theme graphite-kde-theme
arc-kde-theme materia-theme
# news
fluent-reader rssguard
# davinci-resolve playonlinux
weston cage openbox krita
genymotion hdfview electrum
(
vscode-with-extensions.override
{
vscodeExtensions = with nix-vscode-extensions.vscode-marketplace;
(with equinusocio; [ vsc-community-material-theme vsc-material-theme-icons ])
++ (with github; [ copilot copilot-chat copilot-labs github-vscode-theme ])
++ (with intellsmi; [ comment-translate deepl-translate ])
++ (with ms-python; [ isort python vscode-pylance ])
++ (with ms-toolsai;
[
jupyter jupyter-keymap jupyter-renderers vscode-jupyter-cell-tags vscode-jupyter-slideshow
])
++ (with ms-vscode;
[
cmake-tools cpptools cpptools-extension-pack cpptools-themes hexeditor remote-explorer
test-adapter-converter
])
++ (with ms-vscode-remote; [ remote-ssh remote-containers remote-ssh-edit ])
++ [
donjayamanne.githistory genieai.chatgpt-vscode fabiospampinato.vscode-diff cschlosser.doxdocgen
llvm-vs-code-extensions.vscode-clangd ms-ceintl.vscode-language-pack-zh-hans
oderwat.indent-rainbow
twxs.cmake guyutongxue.cpp-reference znck.grammarly thfriedrich.lammps leetcode.vscode-leetcode
james-yu.latex-workshop gimly81.matlab affenwiesel.matlab-formatter ckolkman.vscode-postgres
yzhang.markdown-all-in-one pkief.material-icon-theme bbenoist.nix ms-ossdata.vscode-postgresql
redhat.vscode-xml dotjoshjohnson.xml jnoortheen.nix-ide xdebug.php-debug
hbenl.vscode-test-explorer
jeff-hykin.better-cpp-syntax fredericbonnet.cmake-test-adapter mesonbuild.mesonbuild
hirse.vscode-ungit fortran-lang.linter-gfortran tboox.xmake-vscode ccls-project.ccls
feiskyer.chatgpt-copilot yukiuuh2936.vscode-modern-fortran-formatter wolframresearch.wolfram
njpipeorgan.wolfram-language-notebook brettm12345.nixfmt-vscode webfreak.debug
gruntfuggly.todo-tree
];
}
)
] ++ (with inputs.lib; filter isDerivation (attrValues plasma5Packages.kdeGear));
};
users.sharedModules =
[{
config =
{
programs =
{
chromium =
{
enable = true;
extensions =
[
{ id = "mpkodccbngfoacfalldjimigbofkhgjn"; } # Aria2 Explorer
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # Bitwarden
{ id = "kbfnbcaeplbcioakkpcpgfkobkghlhen"; } # Grammarly
{ id = "ihnfpdchjnmlehnoeffgcbakfmdjcckn"; } # Pixiv Fanbox Downloader
{ id = "cimiefiiaegbelhefglklhhakcgmhkai"; } # Plasma Integration
{ id = "dkndmhgdcmjdmkdonmbgjpijejdcilfh"; } # Powerful Pixiv Downloader
{ id = "padekgcemlokbadohgkifijomclgjgif"; } # Proxy SwitchyOmega
{ id = "kefjpfngnndepjbopdmoebkipbgkggaa"; } # RSSHub Radar
{ id = "abpdnfjocnmdomablahdcfnoggeeiedb"; } # Save All Resources
{ id = "nbokbjkabcmbfdlbddjidfmibcpneigj"; } # SmoothScroll
{ id = "onepmapfbjohnegdmfhndpefjkppbjkm"; } # SuperCopy 超级复制
{ id = "cjpalhdlnbpafiamejdnhcphjbkeiagm"; } # uBlock Origin
{ id = "gppongmhjkpfnbhagpmjfkannfbllamg"; } # Wappalyzer
{ id = "hkbdddpiemdeibjoknnofflfgbgnebcm"; } # YouTube™ 双字幕
{ id = "ekhagklcjbdpajgpjgmbionohlpdbjgc"; } # Zotero Connector
{ id = "ikhdkkncnoglghljlkmcimlnlhkeamad"; } # 划词翻译
{ id = "dhdgffkkebhmkfjojejmpbldmpobfkfo"; } # 篡改猴
{ id = "hipekcciheckooncpjeljhnekcoolahp"; } # Tabliss
{ id = "nkbihfbeogaeaoehlefnkodbefgpgknn"; } # MetaMask
];
};
obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins;
[ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
};
};
home.file.".config/baloofilerc".text =
''
[Basic Settings]
Indexing-Enabled=false
'';
};
}];
};
programs =
{
steam.enable = true;
kdeconnect.enable = true;
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
firefox =
{
enable = true;
languagePacks = [ "zh-CN" "en-US" ];
nativeMessagingHosts.firefoxpwa = true;
};
vim.package = inputs.pkgs.genericPackages.vim-full;
};
nixpkgs.config.packageOverrides = pkgs:
{
telegram-desktop = pkgs.telegram-desktop.overrideAttrs (attrs:
{
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./telegram.patch ];
});
};
services.pcscd.enable = true;
}
)
# >= workstation
(
mkIf (inputs.config.nixos.packages.packageSet == "workstation")
{
nixos.packages = with inputs.pkgs;
{
_packages =
[
# nix tools
nix-template appimage-run nil nixd nix-alien nix-serve node2nix nix-prefetch-github prefetch-npm-deps
nix-prefetch-docker pnpm-lock-export bundix
# instant messager
zoom-us signal-desktop qq nur-xddxdd.wechat-uos slack # jail
# office
libreoffice-qt texlive.combined.scheme-full texstudio poppler_utils pdftk gnuplot pdfchain
# development
jetbrains.clion android-studio dbeaver cling clang-tools_16 ccls fprettify
# media
nur-xddxdd.svp obs-studio waifu2x-converter-cpp inkscape blender
# virtualization
wineWowPackages.stagingFull virt-viewer bottles # wine64
# text editor
appflowy notion-app-enhanced joplin-desktop standardnotes
# math, physics and chemistry
mathematica octaveFull root ovito paraview localPackages.vesta qchem.quantum-espresso
localPackages.vasp localPackages.phonon-unfolding localPackages.vaspkit jmol localPackages.v_sim
# news
newsflash newsboat
];
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy tensorflow keras openai scipy scikit-learn jupyterlab
])];
_prebuildPackages =
[
httplib magic-enum xtensor boost cereal cxxopts ftxui yaml-cpp gfortran gcc10 python2
unstablePackages.gcc13Stdenv
];
};
programs =
{
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
nix-ld.enable = true;
gamemode =
{
enable = true;
settings =
{
general.renice = 10;
gpu =
{
apply_gpu_optimisations = "accept-responsibility";
nv_powermizer_mode = 1;
};
custom = let notify-send = "${inputs.pkgs.libnotify}/bin/notify-send"; in
{
start = "${notify-send} 'GameMode started'";
end = "${notify-send} 'GameMode ended'";
};
};
};
chromium =
{
enable = true;
extraOpts.PasswordManagerEnabled = false;
};
};
}
)
# apply package configs
{
environment.systemPackages = let inherit (inputs.lib.lists) subtractLists; in with inputs.config.nixos.packages;
(subtractLists excludePackages (_packages ++ extraPackages))
++ [
(inputs.pkgs.python3.withPackages (pythonPackages:
subtractLists
(builtins.concatLists (builtins.map (packageFunction: packageFunction pythonPackages)
excludePythonPackages))
(builtins.concatLists (builtins.map (packageFunction: packageFunction pythonPackages)
(_pythonPackages ++ extraPythonPackages)))))
(inputs.pkgs.callPackage ({ stdenv }: stdenv.mkDerivation
{
name = "prebuild-packages";
propagateBuildInputs = subtractLists excludePrebuildPackages (_prebuildPackages ++ extraPrebuildPackages);
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out
runHook postInstall
'';
}) {})
];
}
];
}
# programs.firejail =
# {
# enable = true;
# wrappedBinaries =
# {
# qq =
# {
# executable = "${inputs.pkgs.qq}/bin/qq";
# profile = "${inputs.pkgs.firejail}/etc/firejail/linuxqq.profile";
# };
# };
# };
# config.nixpkgs.config.replaceStdenv = { pkgs }: pkgs.ccacheStdenv;
# only replace stdenv for large and tested packages
# config.programs.ccache.packageNames = [ "webkitgtk" "libreoffice" "tensorflow" "linux" "chromium" ];
# config.nixpkgs.overlays = [(final: prev:
# {
# libreoffice-qt = prev.libreoffice-qt.override (prev: { unwrapped = prev.unwrapped.override
# (prev: { stdenv = final.ccacheStdenv.override { stdenv = prev.stdenv; }; }); });
# python3 = prev.python3.override { packageOverrides = python-final: python-prev:
# {
# tensorflow = python-prev.tensorflow.override
# { stdenv = final.ccacheStdenv.override { stdenv = python-prev.tensorflow.stdenv; }; };
# };};
# # webkitgtk = prev.webkitgtk.override (prev:
# # { stdenv = final.ccacheStdenv.override { stdenv = prev.stdenv; }; enableUnifiedBuilds = false; });
# wxGTK31 = prev.wxGTK31.override { stdenv = final.ccacheStdenv.override { stdenv = prev.wxGTK31.stdenv; }; };
# wxGTK32 = prev.wxGTK32.override { stdenv = final.ccacheStdenv.override { stdenv = prev.wxGTK32.stdenv; }; };
# # firefox-unwrapped = prev.firefox-unwrapped.override
# # { stdenv = final.ccacheStdenv.override { stdenv = prev.firefox-unwrapped.stdenv; }; };
# # chromium = prev.chromium.override
# # { stdenv = final.ccacheStdenv.override { stdenv = prev.chromium.stdenv; }; };
# # linuxPackages_xanmod_latest = prev.linuxPackages_xanmod_latest.override
# # {
# # kernel = prev.linuxPackages_xanmod_latest.kernel.override
# # {
# # stdenv = final.ccacheStdenv.override { stdenv = prev.linuxPackages_xanmod_latest.kernel.stdenv; };
# # buildPackages = prev.linuxPackages_xanmod_latest.kernel.buildPackages //
# # { stdenv = prev.linuxPackages_xanmod_latest.kernel.buildPackages.stdenv; };
# # };
# # };
# })];
# config.programs.ccache.packageNames = [ "libreoffice-unwrapped" ];
# cross-x86_64-pc-linux-musl/gcc
# dev-cpp/cpp-httplib ? how to use
# dev-cpp/cppcoro
# dev-cpp/date
# dev-cpp/nameof
# dev-cpp/scnlib
# dev-cpp/tgbot-cpp
# dev-libs/pocketfft
# dev-util/intel-hpckit
# dev-util/nvhpc
# kde-misc/wallpaper-engine-kde-plugin
# media-fonts/arphicfonts
# media-fonts/sarasa-gothic
# media-gfx/flameshot
# media-libs/libva-intel-driver
# media-libs/libva-intel-media-driver
# media-sound/netease-cloud-music
# net-vpn/frp
# net-wireless/bluez-tools
# sci-libs/mkl
# sci-libs/openblas
# sci-libs/pfft
# sci-libs/scalapack
# sci-libs/wannier90
# sci-mathematics/ginac
# sci-mathematics/mathematica
# sci-mathematics/octave
# sci-physics/lammps::touchfish-os
# sci-physics/vsim
# sci-visualization/scidavis
# sys-apps/flatpak
# sys-cluster/modules
# sys-devel/distcc
# sys-fs/btrfs-progs
# sys-fs/compsize
# sys-fs/dosfstools
# sys-fs/duperemove
# sys-fs/exfatprogs
# sys-fs/mdadm
# sys-fs/ntfs3g
# sys-kernel/dracut
# sys-kernel/linux-firmware
# sys-kernel/xanmod-sources
# sys-kernel/xanmod-sources:6.1.12
# sys-kernel/xanmod-sources::touchfish-os
# sys-libs/libbacktrace
# sys-libs/libselinux
# x11-apps/xinput
# x11-base/xorg-apps
# x11-base/xorg-fonts
# x11-base/xorg-server
# x11-misc/imwheel
# x11-misc/optimus-manager
# x11-misc/unclutter-xfixes
# ++ ( with inputs.pkgs.pkgsCross.mingwW64.buildPackages; [ gcc ] );

View File

@@ -1,13 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
environment.systemPackages = [ inputs.config.nur.repos.ataraxiasjel.proton-ge ];
programs =
{
anime-game-launcher.enable = true;
honkers-railway-launcher.enable = true;
steam.enable = true;
};
};
}

View File

@@ -1,87 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
environment.systemPackages = with inputs.pkgs;
[
( vscode-with-extensions.override
{
vscodeExtensions = (with vscode-extensions;
[
ms-vscode.cpptools
genieai.chatgpt-vscode
ms-ceintl.vscode-language-pack-zh-hans
llvm-vs-code-extensions.vscode-clangd
twxs.cmake
ms-vscode.cmake-tools
donjayamanne.githistory
github.copilot
github.github-vscode-theme
ms-vscode.hexeditor
oderwat.indent-rainbow
ms-toolsai.jupyter
ms-toolsai.vscode-jupyter-cell-tags
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-toolsai.vscode-jupyter-slideshow
james-yu.latex-workshop
yzhang.markdown-all-in-one
pkief.material-icon-theme
equinusocio.vsc-material-theme
bbenoist.nix
ms-python.vscode-pylance
ms-python.python
ms-vscode-remote.remote-ssh
redhat.vscode-xml
dotjoshjohnson.xml
])
++ (with nix-vscode-extensions.vscode-marketplace;
[
jeff-hykin.better-cpp-syntax
ms-vscode.cpptools-extension-pack
ms-vscode.cpptools-themes
josetr.cmake-language-support-vscode
fredericbonnet.cmake-test-adapter
equinusocio.vsc-community-material-theme
guyutongxue.cpp-reference
intellsmi.comment-translate
intellsmi.deepl-translate
ms-vscode-remote.remote-containers
fabiospampinato.vscode-diff
cschlosser.doxdocgen
znck.grammarly
ms-python.isort
thfriedrich.lammps
leetcode.vscode-leetcode
equinusocio.vsc-material-theme-icons
gimly81.matlab
affenwiesel.matlab-formatter
xdebug.php-debug
ckolkman.vscode-postgres
ms-ossdata.vscode-postgresql
ms-vscode-remote.remote-ssh-edit
ms-vscode.remote-explorer
ms-vscode.test-adapter-converter
hbenl.vscode-test-explorer
hirse.vscode-ungit
]);
} )
qbittorrent # tunder
gparted snapper-gui
firefox google-chrome
zotero texlive.combined.scheme-full libreoffice-qt
element-desktop tdesktop discord
# jail
qq inputs.config.nur.repos.xddxdd.wechat-uos inputs.config.nur.repos.linyinfeng.wemeet
remmina
bitwarden
spotify yesplaymusic
crow-translate
scrcpy
mpv inputs.config.nur.repos.xddxdd.svp
]
++ (with inputs.lib; filter isDerivation (attrValues pkgs.plasma5Packages.kdeGear));
programs.wireshark.enable = true;
nixpkgs.config.permittedInsecurePackages = [ "openssl-1.1.1u" "electron-19.0.7" ];
};
}

View File

@@ -1,9 +0,0 @@
{ pkgs, ... }@inputs:
{
config.environment.systemPackages = with inputs.pkgs;
[
ovito paraview # vsim vesta
(python3.withPackages (ps: with ps; [ phonopy ]))
mathematica octave root
];
}

View File

@@ -33,6 +33,7 @@
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
os_icon # os identifier
context # user@hostname
dir # current directory
vcs # git status
# =========================[ Line #2 ]=========================
@@ -82,7 +83,6 @@
azure # azure account name (https://docs.microsoft.com/en-us/cli/azure)
gcloud # google cloud cli account and project (https://cloud.google.com/)
google_app_cred # google application credentials (https://cloud.google.com/docs/authentication/production)
context # user@hostname
nordvpn # nordvpn connection status, linux only (https://nordvpn.com/)
ranger # ranger shell (https://github.com/ranger/ranger)
nnn # nnn shell (https://github.com/jarun/nnn)
@@ -1686,7 +1686,7 @@
# - verbose: Enable instant prompt and print a warning when detecting console output during
# zsh initialization. Choose this if you've never tried instant prompt, haven't
# seen the warning, or if you are unsure what this all means.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=verbose
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload

View File

@@ -0,0 +1 @@
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=

View File

@@ -0,0 +1 @@
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDkkl7A9kWWBoi4b5g6Vus70ja1KhPfcZZjeU1/QbYdN8PRRw/hsGklrhefslKRbym/TMFS0ko0g5WUi9G5vbGw=

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgs8MvV2nczjGMZ548tuAhgvCEd4uHu0VhLDSwQG7Nh/UR4Pgc5T9Nf7Vfwg96Lah/pwD5my4RaWis6bLMmlkYyDBKFBOsGYQUe5J5XfZdxk8pz+7L0Hq6gPfAZAdNlUiuFVKsvkE+NF42NgJyXSYQicPbu5LQiFwZGXlW20+LO8uBQ1y1xabKVpg8XGwordduL99VepwEzeLK/st+UVfW+mKgxkf9TuxvD2fuYIDZM7y2rXqcjf4/6OXA5kACsYK1MgZSFxgO/m6+1uCC1qBDseMTA3D+Tsjf9VtcqUE9dMd/dJ/uuILHJ0+oIqkykTCecPLgJY3Vh8rAtln/lbId

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC0+xafJMnOGCHv6OLljaq8iJ3ZBaIezv7AJ9rVWJXFg/QJRYBwct35c4zaVom7If8F+Ss+BTLMp33HZ8gLpoat6LkjARjy65Ycog3NOnEposX2JjZEYXDbovxEmcJkDXAIVmnaBUi3r22z4UI8OqsHPeRXj017O0yQrQQYEAw/IO/tSNQZt2k8JHxAX50UTqGFdgkriO1fYHBocq48m0nn3sXrMuM3yBe5zy3NngOHxMn7UxjECmAElsuu/nu1x083pRnv5NSa+JxDGJ+S6Zhj3nGGNwZesa51I4cJjsYLxgmO/NxL1J86bDp6HhK9C9799ruG60pGTw6HcvbKTgx7klUgn4936wsy7qukWqp53MvqrLSJkRb/HHU9zZqvzcjbwet+Iv1OAAok5QC88j7Jgenk3nbZw4BNFd2r/8rOZuXheDnMKOa61dXxnvoAO3Euk0RPdZqW1slT/DDyD/kB6TPY7yOywNURNnrwzfSsmravKi6bGA5t2Ehhpf2LETM=

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDOyU7VvusseL2tDp7JkIXKGxRGQNHpYWVAPraUj17Xls7Z9e7HO6+GBiGP+bB9tZbzsoTNGHdXg8VaJmf98QAhhg0FcUb6IvWmfmPWzQ0MC8L+USqdDpaH7s9SOZF/yveNYCR5GOMmFdSW4OPVYIOrjPltDIe5S1SN2nOXvjxbLmuoMjg+5U4F0ii0ZaCRuMVDskeift+Amxe7iRnSzeDbECd0rJhaUb8gf3shz0Hp9lRUMej7cJH8LLP3m0s3Vk+kasKntz18MpJ6/3n+fR2aK75qkcq9FZaFA4tSIabh9eKoxlRCy7g8Qj6nNStW+ys/a1UYBFgAoTyE7e47o3dpcxR5oMLbeDwhOstWL0YOjEH1K5Wyj3eEOT71C6kuQBPcCJQ9q9hknRpW0mWe9Q6qaAzTgE9LLssijr/yTfYQk7zKEyo0i4f6buOfmyYZfnzfnCB3LiJKa98TVEEzrKYHIO44LwIkNf/YHOMDknzjYpav6HfDy+AebRHZFYhGax1YP/tP0Ve/FSq5rh6Vwuqa/zyfFUPZmZVf+EYXK7DdyuBhEZhBEu6QrjY60NRMTMLpnUZMcZXRAz9byMpAGcCYQv6gjU99ps8AkRjZNkn+FpAtDGT+oJxixQwyZMSxZ+ZuzkZGyBMeMplZXMMLICGZ2LRAgT0bxXLZUxHJBLwwnw==

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDYiP+ELuG5KTmafVjBkY0ZSggJg+mDkvZpF8d7NljMst0YwKWV3IgHnkAGXdTd7jlRgm9HH6oc8rP2R6Q8EJmfr+xcL1IQIWKuYAoddHlpe2Ds4EE74xbgm5Elf7FpdYNHUH9XyVmMmIhVSpLw2N10jUhvYqw+h+xC2nObEKZuBOt/lqrTGbC/EMv3+sDv0ApBh8lKt2yfjt88pnAj1LKPANDgIYSyQOllHQWeUY/eD/5Qc9XWR3uWclslVaxriRmEA0sNZlOFCeRIyDbYpSzQBdcnojkwt7Z5kjhaqGlT9g00fdiqO0OMaeY/G8ki3QxqjONqTEDqK+DpEZFO6jyZARcY6ki0ANc0AO4qosEC3gEbAvVwyPwDFtyDggMTHlTzaw8iakMGSDEk10zKaUOgZYLzC2yCWYYQS5mae9wC1gkXIGD51/laeq2E7NpM+nha6kp9weLVyvwf0DLfwsiP+0qlCLrxBLTSRa0HQ+BnQMi4r16Ss7YJwLf/oXrbOVk=

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDFwb7qi9/DvhpMvu43LRlTEC+3kPAA0KNeyk4FT4HlpRE/yxMxN6tgrP9vcx2c6TMfkRwIJKDcBuVVtKOVx+SDZo+nQBxpSz73v1qSmqlsy8D4gCk0a7cLgStb3Cvh0UZjJ5nVnxjzqY2CFnpnKYGmxL+a3qTj1KYPuA2wSsxkYVcHUfDj/uTtEDdRPaNTACsUxe1a57T/Tsjp+321+zKldYreozaABEBsexf9Z34+3vZvyQcfDB3QuxlBRPJBLik80QllpNpE1bqol8swoGEPbl/Ac7tNy+GtlwTG9SH1povmoT9K+8tjJaG2pD+z+vvgZQtJQh+aczYmEBJRZp3ksw1JH4eGqTWG/SDat9Isnx2NDhJe12b9izniDciuBScNySAazIDPidsCMUYjc9kgWdSOiODOtodj5IB+KazFVJgfpmzPv97LHVdjvR74usrgbFw2mYCw2YEiL3xjDYpQGmXSNklsQLwJiBe59oyS4QNpNYQzYD9StjgRIdvtmiM=

View File

@@ -0,0 +1,13 @@
diff --git a/Telegram/SourceFiles/data/data_sponsored_messages.cpp b/Telegram/SourceFiles/data/data_sponsored_messages.cpp
index fa21af4..211f3bf 100644
--- a/Telegram/SourceFiles/data/data_sponsored_messages.cpp
+++ b/Telegram/SourceFiles/data/data_sponsored_messages.cpp
@@ -175,7 +175,7 @@ void SponsoredMessages::inject(
}
bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
- return history->peer->isChannel();
+ return false;
}
void SponsoredMessages::request(not_null<History*> history, Fn<void()> done) {

View File

@@ -1,41 +0,0 @@
{ pkgs, ... }@inputs:
{
config =
{
environment.systemPackages = with inputs.pkgs;
[
beep neofetch screen dos2unix tldr gnugrep
pciutils usbutils lshw powertop
ksh
vim nano
wget aria2 curl yt-dlp
tree git autojump exa
nix-output-monitor inputs.inputs.nix-alien.packages.x86_64-linux.nix-alien
apacheHttpd certbot-full
pigz rar unrar upx unzip zip
util-linux snapper
ocrmypdf pdfgrep
openssl ssh-to-age gnupg age sops
ipset iptables iproute2 dig nettools
gcc clang-tools
];
programs =
{
nix-index-database.comma.enable = true;
nix-index.enable = true;
command-not-found.enable = false;
zsh =
{
enable = true;
syntaxHighlighting.enable = true;
autosuggestions.enable = true;
enableCompletion = true;
ohMyZsh =
{
enable = true;
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
};
};
};
};
}

39
modules/services/acme.nix Normal file
View File

@@ -0,0 +1,39 @@
inputs:
{
options.nixos.services.acme = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
certs = mkOption
{
type = types.listOf (types.oneOf [ types.nonEmptyStr (types.listOf types.nonEmptyStr) ]);
default = [];
};
};
config =
let
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos.services) acme;
inherit (builtins) map listToAttrs;
in mkIf acme.enable
{
security.acme =
{
acceptTerms = true;
defaults.email = "chn@chn.moe";
certs = listToAttrs (map
(cert:
{
name = if builtins.typeOf cert == "string" then cert else builtins.elemAt cert 0;
value =
{
dnsResolver = "8.8.8.8";
dnsProvider = "cloudflare";
credentialsFile = inputs.config.sops.secrets."acme/cloudflare.ini".path;
extraDomainNames = if builtins.typeOf cert == "string" then [] else builtins.tail cert;
};
})
acme.certs);
};
sops.secrets."acme/cloudflare.ini" = {};
};
}

View File

@@ -0,0 +1,50 @@
inputs:
{
options.nixos.services.beesd = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
instances = mkOption
{
type = types.attrsOf (types.oneOf
[
types.nonEmptyStr
(types.submodule { options =
{
device = mkOption { type = types.nonEmptyStr; };
hashTableSizeMB = mkOption { type = types.int; };
};})
]);
default = {};
};
};
config =
let
inherit (inputs.config.nixos.services) beesd;
inherit (inputs.lib) mkIf;
inherit (builtins) map listToAttrs;
inherit (inputs.localLib) attrsToList;
in mkIf beesd.enable
{
services.beesd.filesystems = listToAttrs (map
(instance:
{
inherit (instance) name;
value =
{
spec = instance.value.device or instance.value;
hashTableSizeMB = instance.value.hashTableSizeMB or 1024;
extraOptions = [ "--thread-count" "1" "--scan-mode" "3" ];
};
})
(attrsToList beesd.instances));
systemd.slices.system-beesd.sliceConfig =
{
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
IOSchedulingPriority = 4;
IOAccounting = true;
IOWeight = 1;
Nice = 19;
};
};
}

View File

@@ -0,0 +1,37 @@
inputs:
{
options.nixos.services.coturn = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
hostname = mkOption { type = types.str; default = "coturn.chn.moe"; };
};
config =
let
inherit (inputs.config.nixos.services) coturn;
inherit (inputs.lib) mkIf;
in mkIf coturn.enable
{
services.coturn =
let
keydir = inputs.config.security.acme.certs.${coturn.hostname}.directory;
in
{
enable = true;
use-auth-secret = true;
static-auth-secret-file = inputs.config.sops.secrets."coturn/auth-secret".path;
realm = coturn.hostname;
cert = "${keydir}/full.pem";
pkey = "${keydir}/key.pem";
no-cli = true;
};
sops.secrets."coturn/auth-secret".owner = inputs.config.systemd.services.coturn.serviceConfig.User;
nixos.services.acme = { enable = true; certs = [ coturn.hostname ]; };
security.acme.certs.${coturn.hostname}.group = inputs.config.systemd.services.coturn.serviceConfig.Group;
networking.firewall = with inputs.config.services.coturn;
{
allowedUDPPorts = [ listening-port tls-listening-port ];
allowedTCPPorts = [ listening-port tls-listening-port ];
allowedUDPPortRanges = [ { from = min-port; to = max-port; } ];
};
};
}

View File

@@ -0,0 +1,194 @@
inputs:
{
imports = inputs.localLib.mkModules
[
./postgresql.nix
./redis.nix
./rsshub.nix
./misskey.nix
./nginx
./meilisearch.nix
./xray.nix
./coturn.nix
./synapse.nix
./phpfpm.nix
./xrdp.nix
./groupshare.nix
./acme.nix
./samba.nix
./sshd.nix
./vaultwarden.nix
./frp.nix
./beesd.nix
./snapper.nix
./mariadb.nix
./photoprism.nix
./nextcloud.nix
./freshrss.nix
];
options.nixos.services = let inherit (inputs.lib) mkOption types; in
{
kmscon.enable = mkOption { type = types.bool; default = false; };
fontconfig.enable = mkOption { type = types.bool; default = false; };
firewall.trustedInterfaces = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
nix-serve =
{
enable = mkOption { type = types.bool; default = false; };
hostname = mkOption { type = types.nonEmptyStr; };
};
smartd.enable = mkOption { type = types.bool; default = false; };
fileshelter.enable = mkOption { type = types.bool; default = false; };
wallabag.enable = mkOption { type = types.bool; default = false; };
};
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (inputs.localLib) stripeTabs attrsToList;
inherit (inputs.config.nixos) services;
inherit (builtins) map listToAttrs toString;
in mkMerge
[
(
mkIf services.kmscon.enable
{
services.kmscon =
{
enable = true;
fonts = [{ name = "FiraCode Nerd Font Mono"; package = inputs.pkgs.nerdfonts; }];
};
}
)
(
mkIf services.fontconfig.enable
{
fonts =
{
fontDir.enable = true;
fonts = with inputs.pkgs;
[ noto-fonts source-han-sans source-han-serif source-code-pro hack-font jetbrains-mono nerdfonts ];
fontconfig.defaultFonts =
{
emoji = [ "Noto Color Emoji" ];
monospace = [ "Noto Sans Mono CJK SC" "Sarasa Mono SC" "DejaVu Sans Mono"];
sansSerif = [ "Noto Sans CJK SC" "Source Han Sans SC" "DejaVu Sans" ];
serif = [ "Noto Serif CJK SC" "Source Han Serif SC" "DejaVu Serif" ];
};
};
}
)
{ networking.firewall.trustedInterfaces = services.firewall.trustedInterfaces; }
(
mkIf services.nix-serve.enable
{
services.nix-serve =
{
enable = true;
openFirewall = true;
secretKeyFile = inputs.config.sops.secrets."store/signingKey".path;
};
sops.secrets."store/signingKey" = {};
nixos.services.nginx.http.${services.nix-serve.hostname} =
{ rewriteHttps = true; locations."/".proxy.upstream = "http://127.0.0.1:5000"; };
}
)
(mkIf services.smartd.enable { services.smartd.enable = true; })
(
mkIf services.wallabag.enable
{
virtualisation.oci-containers.containers.wallabag =
{
image = "wallabag/wallabag:2.6.2";
imageFile = inputs.pkgs.dockerTools.pullImage
{
imageName = "wallabag/wallabag";
imageDigest = "sha256:241e5c71f674ee3f383f428e8a10525cbd226d04af58a40ce9363ed47e0f1de9";
sha256 = "0zflrhgg502w3np7kqmxij8v44y491ar2qbk7qw981fysia5ix09";
finalImageName = "wallabag/wallabag";
finalImageTag = "2.6.2";
};
ports = [ "127.0.0.1:4398:80/tcp" ];
extraOptions = [ "--add-host=host.docker.internal:host-gateway" ];
environmentFiles = [ inputs.config.sops.templates."wallabag/env".path ];
};
# systemd.services.docker-wallabag.serviceConfig =
# {
# User = "wallabag";
# Group = "wallabag";
# };
sops =
{
templates."wallabag/env".content =
let
placeholder = inputs.config.sops.placeholder;
in
''
SYMFONY__ENV__DATABASE_DRIVER=pdo_pgsql
SYMFONY__ENV__DATABASE_HOST=host.docker.internal
SYMFONY__ENV__DATABASE_PORT=5432
SYMFONY__ENV__DATABASE_NAME=wallabag
SYMFONY__ENV__DATABASE_USER=wallabag
SYMFONY__ENV__DATABASE_PASSWORD=${placeholder."postgresql/wallabag"}
SYMFONY__ENV__REDIS_HOST=host.docker.internal
SYMFONY__ENV__REDIS_PORT=8790
SYMFONY__ENV__REDIS_PASSWORD=${placeholder."redis/wallabag"}
SYMFONY__ENV__SERVER_NAME=wallabag.chn.moe
SYMFONY__ENV__DOMAIN_NAME=https://wallabag.chn.moe
SYMFONY__ENV__TWOFACTOR_AUTH=false
'';
# SYMFONY__ENV__MAILER_DSN=smtp://bot%%40chn.moe@${placeholder."mail/bot-encoded"}:mail.chn.moe
# SYMFONY__ENV__FROM_EMAIL=bot@chn.moe
# SYMFONY__ENV__TWOFACTOR_SENDER=bot@chn.moe
secrets =
{
"redis/wallabag".owner = inputs.config.users.users.redis-wallabag.name;
"postgresql/wallabag" = {};
"mail/bot-encoded" = {};
};
};
services =
{
redis.servers.wallabag =
{
enable = true;
bind = null;
port = 8790;
requirePassFile = inputs.config.sops.secrets."redis/wallabag".path;
};
postgresql =
{
ensureDatabases = [ "wallabag" ];
ensureUsers =
[{
name = "wallabag";
ensurePermissions."DATABASE \"wallabag\"" = "ALL PRIVILEGES";
}];
# ALTER DATABASE db_name OWNER TO new_owner_name
# sudo docker exec -t wallabag /var/www/wallabag/bin/console wallabag:install --env=prod --no-interaction
};
};
nixos =
{
services =
{
nginx =
{
enable = true;
http."wallabag.chn.moe" =
{
rewriteHttps = true;
locations."/".proxy = { upstream = "http://127.0.0.1:4398"; setHeaders.Host = "wallabag.chn.moe"; };
};
};
postgresql.enable = true;
};
virtualization.docker.enable = true;
};
# users =
# {
# users.wallabag = { isSystemUser = true; group = "wallabag"; autoSubUidGidRange = true; };
# groups.wallabag = {};
# };
}
)
];
}

View File

@@ -0,0 +1,37 @@
inputs:
{
options.nixos.services.freshrss = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
hostname = mkOption { type = types.str; default = "freshrss.chn.moe"; };
};
config =
let
inherit (inputs.config.nixos.services) freshrss;
inherit (inputs.lib) mkIf;
in mkIf freshrss.enable
{
services.freshrss =
{
enable = true;
baseUrl = "https://${freshrss.hostname}";
defaultUser = "chn";
passwordFile = inputs.config.sops.secrets."freshrss/chn".path;
database =
{
type = "mysql";
passFile = inputs.config.sops.secrets."freshrss/mysql".path;
};
};
sops.secrets =
{
"freshrss/chn".owner = inputs.config.users.users.freshrss.name;
"freshrss/db" =
{
owner = inputs.config.users.users.freshrss.name;
key = "mariadb/freshrss";
};
};
nixos.mariadb = { enable = true; instances.freshrss = {}; };
};
}

154
modules/services/frp.nix Normal file
View File

@@ -0,0 +1,154 @@
inputs:
{
options.nixos.services = let inherit (inputs.lib) mkOption types; in
{
frpClient =
{
enable = mkOption { type = types.bool; default = false; };
serverName = mkOption { type = types.nonEmptyStr; };
user = mkOption { type = types.nonEmptyStr; };
tcp = mkOption
{
type = types.attrsOf (types.submodule (inputs:
{
options =
{
localIp = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
localPort = mkOption { type = types.ints.unsigned; };
remoteIp = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
remotePort = mkOption { type = types.ints.unsigned; default = inputs.config.localPort; };
};
}));
default = {};
};
};
frpServer =
{
enable = mkOption { type = types.bool; default = false; };
serverName = mkOption { type = types.nonEmptyStr; };
};
};
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (inputs.localLib) attrsToList;
inherit (inputs.config.nixos.services) frpClient frpServer;
inherit (builtins) map listToAttrs;
in mkMerge
[
(
mkIf frpClient.enable
{
systemd.services.frpc =
let
frpc = "${inputs.pkgs.frp}/bin/frpc";
config = inputs.config.sops.templates."frpc.ini";
in
{
description = "Frp Client Service";
after = [ "network.target" ];
serviceConfig =
{
Type = "simple";
User = "frp";
Restart = "always";
RestartSec = "5s";
ExecStart = "${frpc} -c ${config.path}";
LimitNOFILE = 1048576;
};
wantedBy= [ "multi-user.target" ];
restartTriggers = [ config.file ];
};
sops =
{
templates."frpc.ini" =
{
owner = inputs.config.users.users.frp.name;
group = inputs.config.users.users.frp.group;
content = inputs.lib.generators.toINI {}
(
{
common =
{
server_addr = frpClient.serverName;
server_port = 7000;
token = inputs.config.sops.placeholder."frp/token";
user = frpClient.user;
tls_enable = true;
};
}
// (listToAttrs (map
(tcp:
{
name = tcp.name;
value =
{
type = "tcp";
local_ip = tcp.value.localIp;
local_port = tcp.value.localPort;
remote_port = tcp.value.remotePort;
use_compression = true;
};
})
(attrsToList frpClient.tcp))
)
);
};
secrets."frp/token" = {};
};
users = { users.frp = { isSystemUser = true; group = "frp"; }; groups.frp = {}; };
}
)
(
mkIf frpServer.enable
{
systemd.services.frps =
let
frps = "${inputs.pkgs.frp}/bin/frps";
config = inputs.config.sops.templates."frps.ini";
in
{
description = "Frp Server Service";
after = [ "network.target" ];
serviceConfig =
{
Type = "simple";
User = "frp";
Restart = "on-failure";
RestartSec = "5s";
ExecStart = "${frps} -c ${config.path}";
LimitNOFILE = 1048576;
};
wantedBy= [ "multi-user.target" ];
restartTriggers = [ config.file ];
};
sops =
{
templates."frps.ini" =
{
owner = inputs.config.users.users.frp.name;
group = inputs.config.users.users.frp.group;
content = inputs.lib.generators.toINI {}
{
common = let cert = inputs.config.security.acme.certs.${frpServer.serverName}.directory; in
{
bind_port = 7000;
bind_udp_port = 7000;
token = inputs.config.sops.placeholder."frp/token";
tls_cert_file = "${cert}/full.pem";
tls_key_file = "${cert}/key.pem";
tls_only = true;
user_conn_timeout = 30;
};
};
};
secrets."frp/token" = {};
};
nixos.services.acme = { enable = true; certs = [ frpServer.serverName ]; };
security.acme.certs.${frpServer.serverName}.group = "frp";
users = { users.frp = { isSystemUser = true; group = "frp"; }; groups.frp = {}; };
networking.firewall.allowedTCPPorts = [ 7000 ];
}
)
];
}

View File

@@ -0,0 +1,37 @@
inputs:
{
options.nixos.services.groupshare = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
# hard to read value from inputs.config.users.users.xxx.home, causing infinite recursion
mountPoints = mkOption { type = types.listOf types.str; default = []; };
};
config =
let
inherit (inputs.lib) mkIf;
inherit (builtins) listToAttrs map concatLists;
inherit (inputs.config.nixos.services) groupshare;
users = inputs.config.users.groups.groupshare.members;
in mkIf groupshare.enable
{
users.groups.groupshare = {};
systemd.tmpfiles.rules = [ "d /var/lib/groupshare" ]
++ (concatLists (map
(user:
[
"d /var/lib/groupshare/${user} 2750 ${user} groupshare"
# systemd 253 does not support 'X' bit, it should be manually set
# sudo setfacl -m 'xxx' dir
# ("a /var/lib/groupshare/${user} - - - - "
# + "d:u:${user}:rwX,u:${user}:rwX,d:g:groupshare:r-X,g:groupshare:r-X,d:o::---,o::---,d:m::r-x,m::r-x")
])
users));
fileSystems = listToAttrs (map
(mountPoint:
{
name = mountPoint;
value = { device = "/var/lib/groupshare"; options = [ "bind" ]; depends = [ "/home" "/var/lib" ]; };
})
groupshare.mountPoints);
};
}

View File

@@ -0,0 +1,62 @@
inputs:
{
options.nixos.services.mariadb = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
instances = mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
database = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
user = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
passwordFile = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
};}));
default = {};
};
};
config =
let
inherit (inputs.config.nixos.services) mariadb;
inherit (inputs.lib) mkAfter mkIf;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs concatStringsSep filter;
in mkIf mariadb.enable
{
services =
{
mysql =
{
enable = true;
package = inputs.pkgs.mariadb;
ensureDatabases = map (db: db.value.database) (attrsToList mariadb.instances);
ensureUsers = map
(db:
{
name = db.value.user;
ensurePermissions."${db.value.database}.*" = "ALL PRIVILEGES";
})
(attrsToList mariadb.instances);
};
mysqlBackup =
{
enable = true;
databases = map (db: db.value.database) (attrsToList mariadb.instances);
};
};
systemd.services.mysql.postStart = mkAfter (concatStringsSep "\n" (map
(db:
let
passwordFile =
if db.value.passwordFile or null != null then db.value.passwordFile
else inputs.config.sops.secrets."mariadb/${db.value.user}".path;
mysql = "${inputs.config.services.mysql.package}/bin/mysql";
in
# set user password
''echo "ALTER USER '${db.value.user}'@'localhost' IDENTIFIED VIA unix_socket OR mysql_native_password ''
+ ''USING PASSWORD('$(cat ${passwordFile})');" | ${mysql} -N'')
(attrsToList mariadb.instances)));
sops.secrets = listToAttrs (map
(db: { name = "mariadb/${db.value.user}"; value.owner = inputs.config.users.users.mysql.name; })
(filter (db: db.value.passwordFile == null) (attrsToList mariadb.instances)));
};
}

View File

@@ -0,0 +1,113 @@
inputs:
{
options.nixos.services.meilisearch = let inherit (inputs.lib) mkOption types; in
{
instances = mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
user = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
port = mkOption { type = types.ints.unsigned; };
};}));
default = {};
};
ioLimitDevice = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
};
config =
let
inherit (inputs.config.nixos.services) meilisearch;
inherit (inputs.localLib) stripeTabs attrsToList;
inherit (builtins) map listToAttrs;
in
{
systemd =
{
services = listToAttrs (map
(instance:
{
name = "meilisearch-${instance.name}";
value =
{
description = "meiliSearch ${instance.name}";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
# environment.RUST_BACKTRACE = "full";
serviceConfig =
{
User = instance.value.user;
Group = inputs.config.users.users.${instance.value.user}.group;
ExecStart =
let
meilisearch = inputs.pkgs.unstablePackages.meilisearch.overrideAttrs (prev:
{
RUSTFLAGS = prev.RUSTFLAGS or [] ++ [ "-Clto=true" "-Cpanic=abort" "-Cembed-bitcode=yes"]
++ (
let inherit (inputs.config.nixos.system.nixpkgs) march;
in (if march != null then [ "-Ctarget-cpu=${march}" ] else [])
);
});
config = inputs.config.sops.templates."meilisearch-${instance.name}.toml".path;
in
"${meilisearch}/bin/meilisearch --config-file-path ${config}";
Restart = "always";
StartLimitBurst = 3;
LimitNOFILE = "infinity";
LimitNPROC = "infinity";
LimitCORE = "infinity";
CPUSchedulingPolicy = "idle";
IOSchedulingClass = "idle";
IOSchedulingPriority = 4;
IOAccounting = true;
IOWeight = 1;
Nice = 19;
Slice = "-.slice";
}
// (if meilisearch.ioLimitDevice != null then
{
IOReadBandwidthMax = "${meilisearch.ioLimitDevice} 20M";
IOWriteBandwidthMax = "${meilisearch.ioLimitDevice} 20M";
# iostat -dx 1
IOReadIOPSMax = "${meilisearch.ioLimitDevice} 100";
IOWriteIOPSMax = "${meilisearch.ioLimitDevice} 100";
} else {});
};
})
(attrsToList meilisearch.instances));
tmpfiles.rules = map
(instance:
let
user = instance.value.user;
group = inputs.config.users.users.${instance.value.user}.group;
in
"d /var/lib/meilisearch/${instance.name} 0700 ${user} ${group}")
(attrsToList meilisearch.instances);
};
sops =
{
templates = listToAttrs (map
(instance:
{
name = "meilisearch-${instance.name}.toml";
value =
{
content =
''
db_path = "/var/lib/meilisearch/${instance.name}"
http_addr = "0.0.0.0:${toString instance.value.port}"
master_key = "${inputs.config.sops.placeholder."meilisearch/${instance.name}"}"
env = "production"
dump_dir = "/var/lib/meilisearch/${instance.name}/dumps"
log_level = "INFO"
max_indexing_memory = "16Gb"
max_indexing_threads = 1
'';
owner = instance.value.user;
};
})
(attrsToList meilisearch.instances));
secrets = listToAttrs (map
(instance: { name = "meilisearch/${instance.name}"; value = {}; })
(attrsToList meilisearch.instances));
};
};
}

View File

@@ -0,0 +1,165 @@
inputs:
{
options.nixos.services.misskey.instances = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.attrsOf (types.submodule { options =
{
autoStart = mkOption { type = types.bool; default = true; };
port = mkOption { type = types.ints.unsigned; default = 9726; };
redis.port = mkOption { type = types.ints.unsigned; default = 3545; };
hostname = mkOption { type = types.str; default = "misskey.chn.moe"; };
meilisearch =
{
enable = mkOption { type = types.bool; default = true; };
port = mkOption { type = types.ints.unsigned; default = 7700; };
};
};});
default = {};
};
config =
let
inherit (inputs.config.nixos.services) misskey;
inherit (inputs.localLib) attrsToList;
inherit (inputs.lib) mkMerge mkIf;
inherit (builtins) map listToAttrs toString replaceStrings filter;
in
{
systemd = mkMerge (map
(instance:
{
services."misskey-${instance.name}" = rec
{
enable = instance.value.autoStart;
description = "misskey ${instance.name}";
after = [ "network.target" "redis-misskey-${instance.name}.service" "postgresql.service" ]
++ (if instance.value.meilisearch.enable then [ "meilisearch-misskey-${instance.name}.service" ]
else []);
requires = after;
wantedBy = [ "multi-user.target" ];
environment.MISSKEY_CONFIG_YML = inputs.config.sops.templates."misskey/${instance.name}.yml".path;
serviceConfig = rec
{
User = inputs.config.users.users."misskey-${instance.name}".name;
Group = inputs.config.users.users."misskey-${instance.name}".group;
WorkingDirectory = "/var/lib/misskey/${instance.name}/work";
ExecStart = "${WorkingDirectory}/bin/misskey";
CapabilityBoundingSet = [ "CAP_NET_BIND_SERVICE" ];
AmbientCapabilities = [ "CAP_NET_BIND_SERVICE" ];
Restart = "always";
};
};
tmpfiles.rules =
[ "d /var/lib/misskey/${instance.name}/files 0700 misskey-${instance.name} misskey-${instance.name}" ];
})
(attrsToList misskey.instances));
fileSystems = mkMerge (map
(instance:
{
"/var/lib/misskey/${instance.name}/work" =
{
device = "${inputs.pkgs.localPackages.misskey}";
options = [ "bind" "private" "x-gvfs-hide" ];
};
"/var/lib/misskey/${instance.name}/work/files" =
{
device = "/var/lib/misskey/${instance.name}/files";
options = [ "bind" "private" "x-gvfs-hide" ];
};
})
(attrsToList misskey.instances));
sops.templates = listToAttrs (map
(instance:
{
name = "misskey/${instance.name}.yml";
value =
{
content =
let
placeholder = inputs.config.sops.placeholder;
redis = inputs.config.nixos.services.redis.instances."misskey-${instance.name}";
meilisearch = inputs.config.nixos.services.meilisearch.instances."misskey-${instance.name}";
in
''
url: https://${instance.value.hostname}/
port: ${toString instance.value.port}
db:
host: 127.0.0.1
port: 5432
db: misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}
user: misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}
pass: ${placeholder."postgresql/misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}"}
extra:
statement_timeout: 60000
dbReplications: false
redis:
host: 127.0.0.1
port: ${toString redis.port}
pass: ${placeholder."redis/misskey-${instance.name}"}
id: 'aid'
proxyBypassHosts:
- api.deepl.com
- api-free.deepl.com
- www.recaptcha.net
- hcaptcha.com
- challenges.cloudflare.com
proxyRemoteFiles: true
signToActivityPubGet: true
maxFileSize: 1073741824
''
+ (if instance.value.meilisearch.enable then
''
meilisearch:
host: 127.0.0.1
port: ${toString meilisearch.port}
apiKey: ${placeholder."meilisearch/misskey-${instance.name}"}
ssl: false
index: misskey
scope: globa
'' else "");
owner = inputs.config.users.users."misskey-${instance.name}".name;
};
})
(attrsToList misskey.instances));
users = mkMerge (map
(instance:
{
users."misskey-${instance.name}" =
{
isSystemUser = true;
group = "misskey-${instance.name}";
home = "/var/lib/misskey/${instance.name}";
createHome = true;
};
groups."misskey-${instance.name}" = {};
})
(attrsToList misskey.instances));
nixos.services =
{
redis.instances = listToAttrs (map
(instance:
{
name = "misskey-${instance.name}";
value.port = instance.value.redis.port;
})
(attrsToList misskey.instances));
postgresql =
{
enable = mkIf (misskey.instances != {}) true;
instances = listToAttrs (map
(instance: { name = "misskey_${replaceStrings [ "-" ] [ "_" ] instance.name}"; value = {}; })
(attrsToList misskey.instances));
};
meilisearch.instances = listToAttrs (map
(instance:
{
name = "misskey-${instance.name}";
value =
{
user = inputs.config.users.users."misskey-${instance.name}".name;
port = instance.value.meilisearch.port;
};
})
(filter (instance: instance.value.meilisearch.enable) (attrsToList misskey.instances)));
};
};
}

View File

@@ -0,0 +1,89 @@
inputs:
{
options.nixos.services.nextcloud = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
hostname = mkOption { type = types.str; default = "nextcloud.chn.moe"; };
};
config =
let
inherit (inputs.config.nixos.services) nextcloud;
inherit (inputs.localLib) attrsToList;
inherit (inputs.lib) mkIf mkMerge;
inherit (builtins) map listToAttrs toString replaceStrings filter toJSON;
in mkIf nextcloud.enable
{
services.nextcloud =
{
enable = true;
hostName = nextcloud.hostname;
appstoreEnable = false;
https = true;
package = inputs.pkgs.nextcloud27;
maxUploadSize = "10G";
config =
{
dbtype = "pgsql";
dbpassFile = inputs.config.sops.secrets."nextcloud/postgresql".path;
dbport = 5432;
adminuser = "admin";
adminpassFile = inputs.config.sops.secrets."nextcloud/admin".path;
overwriteProtocol = "https";
defaultPhoneRegion = "CN";
};
configureRedis = true;
extraOptions =
{
mail_domain = "chn.moe";
mail_from_address = "bot";
mail_smtphost = "mail.chn.moe";
mail_smtpport = 465;
mail_smtpsecure = "ssl";
mail_smtpauth = true;
mail_smtpname = "bot@chn.moe";
updatechecker = false;
};
secretFile = inputs.config.sops.templates."nextcloud/secret".path;
extraApps =
{
maps = inputs.pkgs.fetchNextcloudApp
{
url = "https://github.com/nextcloud/maps/releases/download/v1.1.1/maps-1.1.1.tar.gz";
sha256 = "1rcmqnm5364h5gaq1yy6b6d7k17napgn0yc9ymrnn75bps9s71v9";
};
phonetrack = inputs.pkgs.fetchNextcloudApp
{
url = "https://github.com/julien-nc/phonetrack/releases/download/v0.7.6/phonetrack-0.7.6.tar.gz";
sha256 = "1p15vw7c5c1h08czyxi1r6svjd5hjmnc0i6is4vl3xq2kfjmcyyx";
};
twofactor_webauthn = inputs.pkgs.fetchNextcloudApp
{
url = "https://github.com/nextcloud-releases/twofactor_webauthn/releases/download/v1.2.0/twofactor_webauthn-v1.2.0.tar.gz";
sha256 = "1lqcw74rsnl8c4sirw9208ra3c8zl8zp93scs7y8fv2n4n60l465";
};
};
};
nixos.services =
{
postgresql = { enable = true; instances.nextcloud = {}; };
redis.instances.nextcloud.port = 3499;
};
sops =
{
templates."nextcloud/secret" =
{
content = toJSON
{
redis.password = inputs.config.sops.placeholder."redis/nextcloud";
mail_smtppassword = inputs.config.sops.placeholder."mail/bot";
};
owner = inputs.config.users.users.nextcloud.name;
};
secrets =
{
"nextcloud/postgresql" = { key = "postgresql/nextcloud"; owner = inputs.config.users.users.nextcloud.name; };
"nextcloud/admin".owner = inputs.config.users.users.nextcloud.name;
};
};
};
}

View File

@@ -0,0 +1,12 @@
inputs:
{
imports = inputs.localLib.mkModules
[
./misskey.nix
./synapse.nix
./vaultwarden.nix
./element.nix
./photoprism.nix
./nextcloud.nix
];
}

View File

@@ -0,0 +1,41 @@
inputs:
{
options.nixos.services.nginx.applications.element.instances = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
defaultServer = mkOption { type = types.nullOr types.nonEmptyStr; default = "element.chn.moe"; };
};}));
default = {};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications.element) instances;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs toString;
in
{
nixos.services.nginx.http = listToAttrs (map
(instance: with instance.value;
{
name = hostname;
value =
{
rewriteHttps = true;
locations."/".static.root =
if defaultServer == null then toString inputs.pkgs.element-web
else toString (inputs.pkgs.element-web.override { conf =
{
default_server_config."m.homeserver" =
{
base_url = "https://${defaultServer}";
server_name = defaultServer;
};
disable_guests = false;
};});
};
})
(attrsToList instances));
};
}

View File

@@ -0,0 +1,45 @@
inputs:
{
options.nixos.services.nginx.applications.misskey.instances = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
upstream = mkOption
{
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
{
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
port = mkOption { type = types.ints.unsigned; default = 9726; };
};})];
default = "127.0.0.1:9726";
};
};}));
default = {};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications.misskey) instances;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs toString;
in
{
nixos.services.nginx.http = listToAttrs (map
(proxy: with proxy.value;
{
name = hostname;
value =
{
rewriteHttps = true;
locations."/".proxy =
{
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
else "http://${upstream.address}:${toString upstream.port}";
websocket = true;
setHeaders.Host = hostname;
};
};
})
(attrsToList instances));
};
}

View File

@@ -0,0 +1,48 @@
inputs:
{
options.nixos.services.nginx.applications.nextcloud = let inherit (inputs.lib) mkOption types; in
{
instance.enable = mkOption
{
type = types.addCheck types.bool (value: value -> inputs.config.nixos.services.nextcloud.enable);
default = false;
};
proxy =
{
enable = mkOption
{
type = types.addCheck types.bool
(value: value -> !inputs.config.nixos.services.nginx.applications.nextcloud.instance.enable);
default = false;
};
upstream = mkOption { type = types.nonEmptyStr; };
};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications) nextcloud;
inherit (inputs.lib) mkIf mkMerge;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs;
in mkMerge
[
(mkIf (nextcloud.instance.enable)
{
nixos.services.nginx.http.${inputs.config.nixos.services.nextcloud.hostname}.rewriteHttps = true;
services.nginx.virtualHosts.${inputs.config.nixos.services.nextcloud.hostname} = mkMerge
[
(inputs.config.services.nextcloud.nginx.recommendedConfig { upstream = "127.0.0.1"; })
{ listen = [ { addr = "0.0.0.0"; port = 8417; ssl = true; extraParameters = [ "proxy_protocol" ]; } ]; }
];
})
(mkIf (nextcloud.proxy.enable)
{
nixos.services.nginx.streamProxy.map.${inputs.config.nixos.services.nextcloud.hostname} =
{
upstream = "${nextcloud.proxy.upstream}:8417";
rewriteHttps = true;
proxyProtocol = true;
};
})
];
}

View File

@@ -0,0 +1,45 @@
inputs:
{
options.nixos.services.nginx.applications.photoprism.instances = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
upstream = mkOption
{
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
{
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
port = mkOption { type = types.ints.unsigned; default = 2342; };
};})];
default = "127.0.0.1:2342";
};
};}));
default = {};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications.photoprism) instances;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs toString;
in
{
nixos.services.nginx.http = listToAttrs (map
(proxy: with proxy.value;
{
name = hostname;
value =
{
rewriteHttps = true;
locations."/".proxy =
{
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
else "http://${upstream.address}:${toString upstream.port}";
websocket = true;
setHeaders.Host = hostname;
};
};
})
(attrsToList instances));
};
}

View File

@@ -0,0 +1,46 @@
inputs:
{
options.nixos.services.nginx.applications.synapse.instances = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
upstream = mkOption
{
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
{
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
port = mkOption { type = types.ints.unsigned; default = 8008; };
};})];
default = "127.0.0.1:8008";
};
};}));
default = {};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications.synapse) instances;
inherit (inputs.localLib) attrsToList;
inherit (inputs.lib) mkIf mkMerge;
inherit (builtins) map listToAttrs;
in
{
nixos.services.nginx.http = listToAttrs (map
(proxy: with proxy.value;
{
name = hostname;
value =
{
rewriteHttps = true;
locations."/".proxy =
{
upstream = if builtins.typeOf upstream == "string" then "http://${upstream}"
else "http://${upstream.address}:${toString upstream.port}";
websocket = true;
setHeaders.Host = hostname;
};
};
})
(attrsToList instances));
};
}

View File

@@ -0,0 +1,44 @@
inputs:
{
options.nixos.services.nginx.applications.vaultwarden = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
hostname = mkOption { type = types.nonEmptyStr; default = "vaultwarden.chn.moe"; };
upstream = mkOption
{
type = types.oneOf [ types.nonEmptyStr (types.submodule { options =
{
address = mkOption { type = types.nonEmptyStr; default = "127.0.0.1"; };
port = mkOption { type = types.ints.unsigned; default = 8000; };
websocketPort = mkOption { type = types.ints.unsigned; default = 3012; };
};})];
default = {};
};
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications) vaultwarden;
inherit (builtins) listToAttrs;
inherit (inputs.lib) mkIf;
in mkIf vaultwarden.enable
{
nixos.services.nginx.http."${vaultwarden.hostname}" =
{
rewriteHttps = true;
locations = let upstream = vaultwarden.upstream; in (listToAttrs (map
(location: { name = location; value.proxy =
{
upstream = "http://${upstream.address or upstream}:${builtins.toString upstream.port or 8000}";
setHeaders = { Host = vaultwarden.hostname; Connection = ""; };
};})
[ "/" "/notifications/hub/negotiate" ]))
// { "/notifications/hub".proxy =
{
upstream =
"http://${upstream.address or upstream}:${builtins.toString upstream.websocketPort or 3012}";
websocket = true;
setHeaders.Host = vaultwarden.hostname;
};};
};
};
}

View File

@@ -0,0 +1,387 @@
inputs:
{
imports = inputs.localLib.mkModules
[
./applications
];
options.nixos.services.nginx = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
transparentProxy =
{
enable = mkOption { type = types.bool; default = true; };
externalIp = mkOption { type = types.listOf types.nonEmptyStr; };
map = mkOption { type = types.attrsOf types.ints.unsigned; default = {};};
};
http = mkOption
{
type = types.attrsOf (types.submodule { options =
{
rewriteHttps = mkOption { type = types.bool; default = false; };
http2 = mkOption { type = types.bool; default = true; };
addAuth = mkOption { type = types.bool; default = false; };
detectAuth = mkOption { type = types.bool; default = false; };
locations = mkOption
{
type = types.attrsOf (types.addCheck
(types.submodule { options =
{
proxy = mkOption
{
type = types.nullOr (types.submodule { options =
{
upstream = mkOption { type = types.nonEmptyStr; };
websocket = mkOption { type = types.bool; default = false; };
setHeaders = mkOption { type = types.attrsOf types.str; default = {}; };
};});
default = null;
};
static = mkOption
{
type = types.nullOr (types.submodule { options =
{
root = mkOption { type = types.nonEmptyStr; };
index = mkOption { type = types.nonEmptyStr; default = "index.html"; };
};});
default = null;
};
};})
(value: (inputs.lib.count (value: value != null) (builtins.attrValues value)) == 1));
default = {};
};
};});
default = {};
};
streamProxy =
{
enable = mkOption { type = types.bool; default = false; };
port = mkOption { type = types.ints.unsigned; default = 5575; };
portWithProxyProtocol = mkOption { type = types.ints.unsigned; default = 5576; };
map = mkOption
{
type = types.attrsOf (types.oneOf
[
types.nonEmptyStr
(types.submodule { options =
{
upstream = mkOption { type = types.nonEmptyStr; };
rewriteHttps = mkOption { type = types.bool; default = false; };
proxyProtocol = mkOption { type = types.bool; default = false; };
};})
]);
default = {};
};
};
};
config =
let
inherit (inputs.lib) mkMerge mkIf;
inherit (inputs.localLib) stripeTabs attrsToList;
inherit (inputs.config.nixos.services) nginx;
inherit (builtins) map listToAttrs concatStringsSep toString filter attrValues;
in mkMerge
[
(mkIf nginx.enable
{
services =
{
nginx =
{
enable = true;
enableReload = true;
eventsConfig =
''
worker_connections 524288;
use epoll;
'';
commonHttpConfig =
''
geoip2 ${inputs.config.services.geoipupdate.settings.DatabaseDirectory}/GeoLite2-Country.mmdb {
$geoip2_data_country_code country iso_code;
}
log_format http '[$time_local] $remote_addr-$geoip2_data_country_code "$host"'
' $request_length $bytes_sent $status "$request" referer: "$http_referer" ua: "$http_user_agent"';
access_log syslog:server=unix:/dev/log http;
proxy_ssl_server_name on;
proxy_ssl_session_reuse off;
send_timeout 10m;
'';
proxyTimeout = "10m";
virtualHosts = listToAttrs (map
(site:
{
inherit (site) name;
value =
{
serverName = site.name;
listen = [ { addr = "127.0.0.1"; port = (if site.value.http2 then 443 else 3065); ssl = true; } ]
++ (if site.value.rewriteHttps then [ { addr = "0.0.0.0"; port = 80; } ] else []);
useACMEHost = site.name;
locations = listToAttrs (map
(location:
{
inherit (location) name;
value =
if (location.value.proxy != null) then
{
proxyPass = location.value.proxy.upstream;
proxyWebsockets = location.value.proxy.websocket;
recommendedProxySettings = false;
recommendedProxySettingsNoHost = true;
extraConfig = concatStringsSep "\n"
(
(map
(header: ''proxy_set_header ${header.name} "${header.value}";'')
(attrsToList location.value.proxy.setHeaders))
++ (if site.value.detectAuth then ["proxy_hide_header Authorization;"] else [])
++ (
if site.value.addAuth then
["include ${inputs.config.sops.templates."nginx/addAuth/${site.name}-template".path};"]
else [])
);
}
else if (location.value.static != null) then
{
root = location.value.static.root;
index = location.value.static.index;
}
else {};
})
(attrsToList site.value.locations));
forceSSL = site.value.rewriteHttps;
http2 = site.value.http2;
basicAuthFile =
if site.value.detectAuth then inputs.config.sops.secrets."nginx/detectAuth/${site.name}".path
else null;
};
})
(attrsToList nginx.http));
recommendedZstdSettings = true;
recommendedTlsSettings = true;
recommendedProxySettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedBrotliSettings = true;
clientMaxBodySize = "0";
package =
let
nginx-geoip2 =
{
name = "ngx_http_geoip2_module";
src = inputs.pkgs.fetchFromGitHub
{
owner = "leev";
repo = "ngx_http_geoip2_module";
rev = "a607a41a8115fecfc05b5c283c81532a3d605425";
hash = "sha256-CkmaeEa1iEAabJEDu3FhBUR7QF38koGYlyx+pyKZV9Y=";
};
meta.license = [];
};
in
(inputs.pkgs.nginxMainline.override (prev: { modules = prev.modules ++ [ nginx-geoip2 ]; }))
.overrideAttrs (prev: { buildInputs = prev.buildInputs ++ [ inputs.pkgs.libmaxminddb ]; });
streamConfig =
''
geoip2 ${inputs.config.services.geoipupdate.settings.DatabaseDirectory}/GeoLite2-Country.mmdb
{
$geoip2_data_country_code country iso_code;
}
resolver 8.8.8.8;
'';
# todo: use host dns
resolver.addresses = [ "8.8.8.8" ];
};
geoipupdate =
{
enable = true;
settings =
{
AccountID = 901296;
LicenseKey = inputs.config.sops.secrets."nginx/maxmind-license".path;
EditionIDs = [ "GeoLite2-ASN" "GeoLite2-City" "GeoLite2-Country" ];
};
};
};
sops =
{
templates = listToAttrs (map
(site:
{
name = "nginx/addAuth/${site.name}-template";
value =
{
content =
let placeholder = inputs.config.sops.placeholder."nginx/addAuth/${site.name}";
in ''proxy_set_header Authorization "Basic ${placeholder}";'';
owner = inputs.config.users.users.nginx.name;
};
})
(filter (site: site.value.addAuth) (attrsToList nginx.http)));
secrets = { "nginx/maxmind-license".owner = inputs.config.users.users.nginx.name; }
// (listToAttrs (map
(site: { name = "nginx/detectAuth/${site.name}"; value.owner = inputs.config.users.users.nginx.name; })
(filter (site: site.value.detectAuth) (attrsToList nginx.http))))
// (listToAttrs (map
(site: { name = "nginx/addAuth/${site.name}"; value = {}; })
(filter (site: site.value.addAuth) (attrsToList nginx.http))));
};
systemd.services.nginx.serviceConfig =
{
CapabilityBoundingSet = [ "CAP_NET_ADMIN" ];
AmbientCapabilities = [ "CAP_NET_ADMIN" ];
LimitNPROC = 65536;
LimitNOFILE = 524288;
};
nixos.services.acme =
{
enable = true;
certs = map (cert: cert.name) (attrsToList nginx.http);
};
security.acme.certs = listToAttrs (map
(cert: { inherit (cert) name; value.group = inputs.config.services.nginx.group; })
(attrsToList nginx.http));
})
(mkIf nginx.transparentProxy.enable
{
services.nginx.streamConfig =
''
log_format transparent_proxy '[$time_local] $remote_addr-$geoip2_data_country_code '
'"$ssl_preread_server_name"->$transparent_proxy_backend $bytes_sent $bytes_received';
map $ssl_preread_server_name $transparent_proxy_backend
{
${concatStringsSep "\n" (map
(x: '' "${x.name}" 127.0.0.1:${toString x.value};'')
(
(attrsToList nginx.transparentProxy.map)
++ (map
(site: { name = site.name; value = (if site.value.http2 then 443 else 3065); })
(attrsToList nginx.http)
)
))}
default 127.0.0.1:443;
}
server
{
${concatStringsSep "\n " (map (ip: "listen ${ip}:443;") nginx.transparentProxy.externalIp)}
ssl_preread on;
proxy_bind $remote_addr transparent;
proxy_pass $transparent_proxy_backend;
proxy_connect_timeout 1s;
proxy_socket_keepalive on;
proxy_buffer_size 128k;
access_log syslog:server=unix:/dev/log transparent_proxy;
}
'';
networking.firewall.allowedTCPPorts = [ 80 443 ];
systemd.services.nginx-proxy =
let
ipset = "${inputs.pkgs.ipset}/bin/ipset";
iptables = "${inputs.pkgs.iptables}/bin/iptables";
ip = "${inputs.pkgs.iproute}/bin/ip";
start = inputs.pkgs.writeShellScript "nginx-proxy.start"
(
''
${ipset} create nginx_proxy_port bitmap:port range 0-65535
${iptables} -t mangle -N nginx_proxy_mark
${iptables} -t mangle -A OUTPUT -j nginx_proxy_mark
${iptables} -t mangle -A nginx_proxy_mark -s 127.0.0.1 -p tcp \
-m set --match-set nginx_proxy_port src -j MARK --set-mark 2/2
${iptables} -t mangle -N nginx_proxy
${iptables} -t mangle -A PREROUTING -j nginx_proxy
${iptables} -t mangle -A nginx_proxy -s 127.0.0.1 -p tcp \
-m set --match-set nginx_proxy_port src -j MARK --set-mark 2/2
${ip} rule add fwmark 2/2 table 200
${ip} route add local 0.0.0.0/0 dev lo table 200
''
+ concatStringsSep "\n" (map
(port: ''${ipset} add nginx_proxy_port ${toString port}'')
(inputs.lib.unique ((attrValues nginx.transparentProxy.map) ++ [ 443 3065 ])))
);
stop = inputs.pkgs.writeShellScript "nginx-proxy.stop"
''
${iptables} -t mangle -F nginx_proxy_mark
${iptables} -t mangle -D OUTPUT -j nginx_proxy_mark
${iptables} -t mangle -X nginx_proxy_mark
${iptables} -t mangle -F nginx_proxy
${iptables} -t mangle -D PREROUTING -j nginx_proxy
${iptables} -t mangle -X nginx_proxy
${ip} rule del fwmark 2/2 table 200
${ip} route del local 0.0.0.0/0 dev lo table 200
${ipset} destroy nginx_proxy_port
'';
in
{
description = "nginx transparent proxy";
after = [ "network.target" ];
serviceConfig =
{
Type = "simple";
RemainAfterExit = true;
ExecStart = start;
ExecStop = stop;
};
wants = [ "network.target" ];
wantedBy= [ "multi-user.target" ];
};
})
(mkIf nginx.streamProxy.enable
{
services.nginx =
{
streamConfig =
''
log_format stream_proxy '[$time_local] $remote_addr-$geoip2_data_country_code '
'"$ssl_preread_server_name"->$stream_proxy_backend $bytes_sent $bytes_received';
map $ssl_preread_server_name $stream_proxy_backend
{
${concatStringsSep "\n" (map
(x: '' "${x.name}" "${x.value.upstream or x.value}";'')
(attrsToList nginx.streamProxy.map))}
}
server
{
listen 127.0.0.1:${toString nginx.streamProxy.port};
ssl_preread on;
proxy_pass $stream_proxy_backend;
proxy_connect_timeout 10s;
proxy_socket_keepalive on;
proxy_buffer_size 128k;
access_log syslog:server=unix:/dev/log stream_proxy;
}
server
{
listen 127.0.0.1:${toString nginx.streamProxy.portWithProxyProtocol};
proxy_protocol on;
ssl_preread on;
proxy_pass $stream_proxy_backend;
proxy_connect_timeout 10s;
proxy_socket_keepalive on;
proxy_buffer_size 128k;
access_log syslog:server=unix:/dev/log stream_proxy;
}
'';
virtualHosts = listToAttrs (map
(site:
{
inherit (site) name;
value =
{
serverName = site.name;
listen = [ { addr = "0.0.0.0"; port = 80; } ];
locations."/".return = "301 https://${site.name}$request_uri";
};
})
(filter (site: site.value.rewriteHttps or false) (attrsToList nginx.streamProxy.map)));
};
nixos.services.nginx.transparentProxy.map = listToAttrs
(
(map
(site: { name = site.name; value = nginx.streamProxy.port; })
(filter (site: !(site.value.proxyProtocol or false)) (attrsToList nginx.streamProxy.map)))
++ (map
(site: { name = site.name; value = nginx.streamProxy.portWithProxyProtocol; })
(filter (site: site.value.proxyProtocol or false) (attrsToList nginx.streamProxy.map)))
);
})
];
}

View File

@@ -0,0 +1,47 @@
inputs:
{
options.nixos.services.photoprism = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
hostname = mkOption { type = types.str; default = "photoprism.chn.moe"; };
port = mkOption { type = types.ints.unsigned; default = 2342; };
};
config =
let
inherit (inputs.lib) mkIf;
inherit (inputs.config.nixos.services) photoprism;
in mkIf photoprism.enable
{
services.photoprism =
{
enable = true;
originalsPath = inputs.config.services.photoprism.storagePath + "/originals";
settings =
{
PHOTOPRISM_SITE_URL = "https://${photoprism.hostname}";
PHOTOPRISM_HTTP_PORT = "${toString photoprism.port}";
PHOTOPRISM_DISABLE_TLS = "true";
PHOTOPRISM_DETECT_NSFW = "true";
PHOTOPRISM_UPLOAD_NSFW = "true";
PHOTOPRISM_DATABASE_DRIVER = "mysql";
PHOTOPRISM_DATABASE_SERVER = "127.0.0.1:3306";
};
};
systemd.services.photoprism =
{
after = [ "mariadb.service" ];
requires = [ "mariadb.service" ];
serviceConfig.EnvironmentFile = inputs.config.sops.templates."photoprism/env".path;
};
sops =
{
templates."photoprism/env".content = let placeholder = inputs.config.sops.placeholder; in
''
PHOTOPRISM_ADMIN_PASSWORD=${placeholder."photoprism/adminPassword"}
PHOTOPRISM_DATABASE_PASSWORD=${placeholder."mariadb/photoprism"}
'';
secrets."photoprism/adminPassword" = {};
};
nixos.services.mariadb = { enable = true; instances.photoprism = {}; };
};
}

View File

@@ -0,0 +1,60 @@
inputs:
{
options.nixos.services.phpfpm = let inherit (inputs.lib) mkOption types; in
{
instances = mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
user = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
group = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
package = mkOption { type = types.nullOr types.package; default = null; };
};}));
default = {};
};
};
config =
let
inherit (builtins) map listToAttrs filter;
inherit (inputs.localLib) attrsToList;
inherit (inputs.config.nixos.services) phpfpm;
in
{
services.phpfpm.pools = listToAttrs (map
(pool:
{
inherit (pool) name;
value = rec
{
user = if pool.value.user == null then pool.name else pool.value.user;
group = if pool.value.group == null then inputs.config.users.users.${user}.group else pool.value.group;
phpPackage = if pool.value.package == null then inputs.pkgs.php else pool.value.package;
settings =
{
"pm" = "ondemand";
"pm.max_children" = 4;
"pm.process_idle_timeout" = "60s";
"pm.max_requests" = 128;
};
};
})
(attrsToList phpfpm.instances));
users =
{
users = listToAttrs (map
(pool:
{
inherit (pool) name;
value = { isSystemUser = true; group = pool.name; };
})
(filter (pool: pool.value.user == null) (attrsToList phpfpm.instances)));
groups = listToAttrs (map
(pool:
{
inherit (pool) name;
value = {};
})
(filter (pool: pool.value.user == null) (attrsToList phpfpm.instances)));
};
};
}

View File

@@ -0,0 +1,91 @@
inputs:
{
options.nixos.services.postgresql = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
instances = mkOption
{
type = types.attrsOf (types.submodule (submoduleInputs: { options =
{
database = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
user = mkOption { type = types.nonEmptyStr; default = submoduleInputs.config._module.args.name; };
passwordFile = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
};}));
default = {};
};
};
config =
let
inherit (inputs.config.nixos.services) postgresql;
inherit (inputs.lib) mkAfter concatStringsSep mkIf;
inherit (inputs.localLib) attrsToList;
inherit (builtins) map listToAttrs filter;
in mkIf postgresql.enable
{
services =
{
postgresql =
{
enable = true;
package = inputs.pkgs.postgresql_15;
enableTCPIP = true;
authentication = "host all all 0.0.0.0/0 md5";
settings =
{
unix_socket_permissions = "0700";
shared_buffers = "8192MB";
work_mem = "512MB";
autovacuum = "on";
};
# log_timezone = 'Asia/Shanghai'
# datestyle = 'iso, mdy'
# timezone = 'Asia/Shanghai'
# lc_messages = 'en_US.utf8'
# lc_monetary = 'en_US.utf8'
# lc_numeric = 'en_US.utf8'
# lc_time = 'en_US.utf8'
# default_text_search_config = 'pg_catalog.english'
# plperl.on_init = 'use utf8; use re; package utf8; require "utf8_heavy.pl";'
# mv /path/to/dir /path/to/dir_old
# mkdir /path/to/dir
# chattr +C /path/to/dir
# cp -a --reflink=never /path/to/dir_old/. /path/to/dir
# rm -rf /path/to/dir_old
ensureDatabases = map (db: db.value.database) (attrsToList postgresql.instances);
ensureUsers = map (db: { name = db.value.user; }) (attrsToList postgresql.instances);
};
postgresqlBackup =
{
enable = true;
pgdumpOptions = "-Fc";
compression = "none";
databases = map (db: db.value.database) (attrsToList postgresql.instances);
};
};
systemd.services.postgresql.postStart = mkAfter (concatStringsSep "\n" (map
(db:
let
passwordFile =
if db.value.passwordFile or null != null then db.value.passwordFile
else inputs.config.sops.secrets."postgresql/${db.value.user}".path;
in
# set user password
"$PSQL -tAc \"ALTER USER ${db.value.user} with encrypted password '$(cat ${passwordFile})'\""
# set db owner
+ "\n"
+ "$PSQL -tAc \"select pg_catalog.pg_get_userbyid(d.datdba) FROM pg_catalog.pg_database d"
+ " WHERE d.datname = '${db.value.database}' ORDER BY 1\""
+ " | grep -E '^${db.value.user}$' -q"
+ " || $PSQL -tAc \"ALTER DATABASE ${db.value.database} OWNER TO ${db.value.user}\"")
(attrsToList postgresql.instances)));
sops.secrets = listToAttrs (map
(db: { name = "postgresql/${db.value.user}"; value.owner = inputs.config.users.users.postgres.name; })
(filter (db: db.value.passwordFile == null) (attrsToList postgresql.instances)));
};
}
# sops.secrets.drone-agent = {
# owner = config.systemd.services.drone-agent.serviceConfig.User;
# key = "drone";
# };
# 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

Some files were not shown because too many files have changed in this diff Show More