Compare commits

...

1049 Commits
docker ... xray

Author SHA1 Message Date
chn
f7e2d0d52c services.xray.dae: use default package 2024-04-10 20:15:16 +08:00
chn
473279d295 Revert "move devices into modules"
This reverts commit cfb1e3e727.
2024-04-09 20:52:26 +08:00
chn
cfb1e3e727 move devices into modules 2024-04-09 20:51:25 +08:00
chn
bab71d6f90 user.chn.plasma.wallpaper: update surface wallpaper 2024-04-09 20:47:14 +08:00
chn
abe81f230c Revert "devices.pc: switch to nvidia"
This reverts commit 7fb18889e0.
2024-04-09 19:24:01 +08:00
chn
7fb18889e0 devices.pc: switch to nvidia 2024-04-09 19:06:14 +08:00
chn
d45e033314 services.misskey: remove meilisearch support 2024-04-08 21:31:11 +08:00
chn
8232e3c794 devices.surface: add suspend-hibernate-no-platform bug 2024-04-08 21:30:18 +08:00
chn
d12e234e71 user.chn.plasma.wallpaper: add wallpaper 2024-04-08 00:46:30 +08:00
chn
6ab9fe88ca users.chn.plasma.wallpaper: set different wallpapers 2024-04-07 23:51:36 +08:00
chn
dff2d50f26 add wallpaper 2024-04-07 20:51:48 +08:00
chn
55bf66957c services.chatgpt: init 2024-04-06 22:38:03 +08:00
chn
0cf1c8f7d2 add note 2024-04-06 19:19:19 +08:00
chn
4d28aa50c7 add build, .vscode, .cache to .gitignore 2024-04-03 19:48:46 +08:00
chn
bca081020b Revert "localPackages.vasp: remove additionalCommands"
This reverts commit 4de795bd59.
2024-04-03 19:47:52 +08:00
chn
379dcd7ba9 localPackages.biu: fix 2024-04-03 19:47:29 +08:00
chn
c7aa418408 devices.pcarm: init 2024-04-03 13:50:08 +08:00
chn
ce8086a800 localPackages.biu: add some conversion 2024-04-03 12:17:02 +08:00
chn
4de795bd59 localPackages.vasp: remove additionalCommands 2024-04-03 11:42:21 +08:00
chn
4e7ae53b3d localPackages.biu: merge repo 2024-04-02 11:08:47 +08:00
chn
3087681a19 packages: remove compiler & library 2024-04-02 10:40:03 +08:00
chn
2bdc5b94bc packages.server: add biu 2024-04-01 19:07:36 +08:00
chn
562e51a866 fix overlay 2024-04-01 18:55:33 +08:00
chn
30c7efb426 packages.server: add concurrencpp 2024-04-01 17:27:55 +08:00
chn
aa278b51a8 devices.pc: add suspend-hibernate-no-platform 2024-03-31 19:49:05 +08:00
chn
392433de5a services.sshd: add groupBanner 2024-03-31 15:29:07 +08:00
chn
bc368617b9 packages.server: add lolcat 2024-03-31 12:21:07 +08:00
chn
986dee8d7a packages.server: add toilet 2024-03-31 12:05:41 +08:00
chn
83af1576f1 localPackages.kylin-virtual-keyboard: init 2024-03-31 12:04:10 +08:00
chn
6940dbaf85 Revert "update aagl"
This reverts commit 9f921d8735.
2024-03-29 18:52:33 +08:00
chn
9f921d8735 update aagl 2024-03-29 18:40:27 +08:00
chn
4893999021 packages: add eigen 2024-03-29 18:24:17 +08:00
chn
016b1e179a packages: add highfive 2024-03-29 13:40:18 +08:00
chn
d51cae120d fix 2024-03-28 21:51:11 +08:00
chn
bb9225f236 devices.pi3b: fix 2024-03-28 21:40:16 +08:00
chn
5e7867a76c devices.vps6: add pi3b to wireguard peers 2024-03-28 21:38:26 +08:00
chn
400fc0ae03 devices.pi3b: regenerate secrets 2024-03-28 21:32:24 +08:00
chn
1d8366517a devices.pi3b: use default kernel 2024-03-28 20:53:17 +08:00
chn
db812b2ab7 devices.pi3b: enable ssh and wireguard 2024-03-28 18:35:45 +08:00
chn
bb6b65c4d2 services.xray: explicitly set wanInterface 2024-03-28 10:46:05 +08:00
chn
ff6d0d4af7 packages: add matplotplusplus 2024-03-27 19:59:05 +08:00
chn
b04b1375d0 system.sysctl: 整理 2024-03-27 18:47:56 +08:00
chn
53a2a6ff0c system.systemd: 整理 2024-03-27 18:46:45 +08:00
chn
bf3eee7931 system.sops: move default secret file 2024-03-27 18:43:09 +08:00
chn
56d93beb06 devices.vps6: add xray user 2024-03-27 18:31:29 +08:00
chn
707d068b18 packages: add some libraries 2024-03-26 18:18:54 +08:00
chn
b5fdd69ebd virtualization: fix 2024-03-26 13:49:33 +08:00
chn
f05e34c864 virtualization: fix aarch efi 2024-03-25 19:58:34 +08:00
chn
781da3b465 devices.pi3b: finalize 2024-03-25 18:03:27 +08:00
chn
615d2a4867 devices.rpi3: fix 2024-03-25 17:49:35 +08:00
chn
e69dd36cc3 packages: fix build for aarch64 2024-03-25 17:12:58 +08:00
chn
e7a5fe6190 hardware: fix for aarch64 2024-03-25 17:09:29 +08:00
chn
b8c4e79183 devices.pi3b: fix build 2024-03-25 17:07:54 +08:00
chn
9b1ec2d09c devices.pi3b: init 2024-03-25 16:55:13 +08:00
chn
b2666d1fdf system: only enable envfs and nix-ld on workstation 2024-03-25 14:59:37 +08:00
chn
b3f264a4b6 localPackages.vasp: fix 2024-03-25 14:19:58 +08:00
chn
21614c3b07 devices.pc: enable snapper 2024-03-25 12:57:25 +08:00
chn
6ccdafbdc4 system.nix-ld: init 2024-03-25 12:06:55 +08:00
chn
b8b93e2b85 devices.xmupc2: 整理 2024-03-25 11:44:04 +08:00
chn
5e648574fb hardware.legion: fix 2024-03-25 11:40:13 +08:00
chn
3d08a3b498 hardware: 整理 2024-03-25 11:37:21 +08:00
chn
ff4bbd4b48 localLib.findModules: include mkModules 2024-03-25 11:30:50 +08:00
chn
24d167cb3f system.envfs: 整理 2024-03-25 11:26:53 +08:00
chn
dda3eb369f update envfs 2024-03-25 11:17:28 +08:00
chn
60d7cddcb7 devices.xmupc*: switch gpu 2024-03-24 22:14:21 +08:00
chn
6bb54b042c devices.xmupc2: set frequency 2024-03-24 21:04:44 +08:00
chn
32a38afebb system.user: automatically create directories 2024-03-24 20:41:41 +08:00
chn
22c31b4511 system.networking: move impermanence config 2024-03-24 20:27:08 +08:00
chn
dba0ed975b services.fail2ban: 整理 2024-03-24 18:23:50 +08:00
chn
beca8ed39c services.beesd: 整理 2024-03-24 18:19:58 +08:00
chn
489a6d8866 localPackages.vasp: fix 2024-03-24 17:53:45 +08:00
chn
2d8dc72c52 devices.xmupc2: set cpu governor 2024-03-24 17:45:10 +08:00
chn
8bfde16836 add note 2024-03-24 15:53:02 +08:00
chn
a2702a8690 localPackages.vasp: fix 2024-03-24 14:39:07 +08:00
chn
72541d6f77 localPackages.vasp: fix 2024-03-24 14:01:51 +08:00
chn
52459243ed devices.vps6: fix 2024-03-24 13:59:41 +08:00
chn
398f4de618 services.acme: fix 2024-03-24 13:55:47 +08:00
chn
17051ccd12 devices.pc: fix 2024-03-24 13:55:06 +08:00
chn
4c037193cd localPackages.vasp: fix 2024-03-24 13:53:39 +08:00
chn
2331cdc8d3 localPackages.vasp: fix 2024-03-24 13:53:39 +08:00
chn
234f9116f5 localPackages.vasp: fix 2024-03-24 13:53:39 +08:00
chn
eb5e634125 services.httpua: 整理 2024-03-24 10:23:24 +08:00
chn
06763b5920 services.fz-new-order: 整理 2024-03-24 10:23:24 +08:00
chn
50b79be223 整理coturn acme 2024-03-24 10:23:24 +08:00
chn
2356bbb83b packages: disable nix-ld 2024-03-23 15:51:26 +08:00
chn
8efdd284a5 devices.pc: migrate to new partition 2024-03-23 14:37:29 +08:00
chn
6cbe29b4f6 localPackages.vasp: enable fftlib for some builds 2024-03-22 20:43:10 +08:00
chn
59b7fab8bc services.slurm: set DefCpuPerGPU to 1 2024-03-22 20:32:46 +08:00
chn
e636d78fb7 system.security.pam: fix 2024-03-22 20:21:25 +08:00
chn
8854f3f775 users: fix 2024-03-22 19:58:39 +08:00
chn
a345125b7c system.networking: fix 2024-03-22 09:59:02 +08:00
chn
73c8197355 services.beesd: fix 2024-03-22 09:58:42 +08:00
chn
1a5b81a317 system.networking: rewrite 2024-03-21 21:49:29 +08:00
chn
d97a5a4ada services.dae: disable wait for network 2024-03-21 16:37:32 +08:00
chn
48528c3115 devices.pc: fix dns 2024-03-21 16:02:05 +08:00
chn
82b13e7574 devices.vps7: switch to networkd 2024-03-21 15:43:19 +08:00
chn
f8cb743b60 devices.vps6: switch to networkd 2024-03-21 15:42:14 +08:00
chn
2042904cca system.impermanence: only persistent networkmanager connections if enabled 2024-03-21 15:37:21 +08:00
chn
dce1220b24 devices.nas: switch to networkd 2024-03-21 15:30:33 +08:00
chn
28f3976a48 system.networking: fix 2024-03-21 15:12:44 +08:00
chn
8da6495ab7 system.networking: add networkd support 2024-03-21 14:34:11 +08:00
chn
5c280cb15b user: 整理 2024-03-20 20:36:09 +08:00
chn
4a4d89a9ce packages.vscode: add plugin 2024-03-20 11:32:38 +08:00
chn
a5f91fea97 user: 整理 2024-03-20 09:44:41 +08:00
chn
6380195afe user: 整理 2024-03-20 09:08:20 +08:00
chn
d804019b54 user: remove unused subuid 2024-03-19 22:07:52 +08:00
chn
74c4efaa9c user: 整理 2024-03-19 22:06:46 +08:00
chn
cfb7998237 move system.user to user 2024-03-19 20:12:16 +08:00
chn
cf7151d65b users -> user 2024-03-19 20:05:41 +08:00
chn
b3bcbd99fe add gricad 2024-03-19 18:37:08 +08:00
chn
c964d542b5 Revert "devices.surface: use cachyos kernel"
This reverts commit 937c2be976.
2024-03-18 21:16:57 +08:00
chn
9ef099b802 localPackages.vasp.gnu-mkl: init 2024-03-18 19:52:25 +08:00
chn
193aa605c6 services.xray: use xray to handle dns and route by domain 2024-03-18 12:17:06 +08:00
chn
996c8463da services.xray: use dnsmasq to handle dns 2024-03-18 11:54:23 +08:00
chn
f24e139c06 update linux-surface 2024-03-17 23:49:21 +08:00
chn
c243bb0e12 system.kernel: use default scheduler 2024-03-17 21:21:27 +08:00
chn
d45d4f05f9 system.kernel: set scheduler at boot 2024-03-17 15:25:05 +08:00
chn
937c2be976 devices.surface: use cachyos kernel 2024-03-17 15:14:53 +08:00
chn
12a2f13ade packages: add scx if use cachyos kernel 2024-03-17 14:10:20 +08:00
chn
5b67ec05cf devices.pc: switch to cachyos 2024-03-17 13:05:05 +08:00
chn
7daf2a0a19 use findModules 2024-03-17 00:17:49 +08:00
chn
9e31283c30 add chaotic 2024-03-17 00:16:32 +08:00
chn
14a14c8572 localPackages.vasp: fix 2024-03-17 00:16:32 +08:00
chn
a73b010701 services.xray: fix dns 2024-03-16 22:53:49 +08:00
chn
77e7427c95 localPackages: add workaround for gb 2024-03-16 14:47:52 +08:00
chn
8a6935eb59 localPackages: 整理 2024-03-16 12:16:23 +08:00
chn
86f9436872 add nix-flatpak 2024-03-16 11:45:36 +08:00
chn
ab6a6f0513 packages: add gh & warp-terminal 2024-03-16 00:08:24 +08:00
chn
1fe8a11efa add note 2024-03-15 21:46:03 +08:00
chn
199983763c devices.xmupc1: add p5000 2024-03-15 21:37:48 +08:00
chn
bd60bea419 add note 2024-03-15 20:31:29 +08:00
chn
4168a456f8 add note 2024-03-15 20:04:29 +08:00
chn
31af52f129 add note 2024-03-15 20:02:54 +08:00
chn
72c0dbf60a localPackages.vasp.amd: fix 2024-03-15 19:47:13 +08:00
chn
36e6a64e1b localPackages.vasp.amd: fix 2024-03-15 19:25:27 +08:00
chn
f3a1a298fa services.xray.client: add noproxyUsers option 2024-03-15 13:23:21 +08:00
chn
da629f2480 system.fileSystem.resume: fix 2024-03-15 11:07:33 +08:00
chn
e8e316b8bb system.fileSystems.rollingRootfs: fix 2024-03-15 11:03:50 +08:00
chn
51077626dc services.xray.server: generalize settings 2024-03-15 10:56:36 +08:00
chn
584298407d Revert "packages: remove mumax"
This reverts commit 176ec68189.
2024-03-14 23:52:56 +08:00
chn
176ec68189 packages: remove mumax 2024-03-14 23:12:23 +08:00
chn
e922d8c19a devices.vps6: remove some xray user 2024-03-14 23:04:27 +08:00
chn
bbc8071fa4 localPackages.vasp.amd: init 2024-03-14 22:47:47 +08:00
chn
23f92b206b localPackages.aocc: init 2024-03-14 11:12:50 +08:00
chn
8e2c742340 localPackages.vasp: fix 2024-03-13 17:21:02 +08:00
chn
55b26b28aa add note 2024-03-13 16:03:39 +08:00
chn
a05a5f8792 localPackages.vasp.intel: fix 2024-03-13 15:58:20 +08:00
chn
6ede310d9f services.slurm: fix 2024-03-13 15:36:14 +08:00
chn
8469e4ae50 localPackages.vasp.intel: fix 2024-03-13 12:24:57 +08:00
chn
d44c026ab4 services.slurm: fix 2024-03-12 23:57:59 +08:00
chn
9de690ef37 services.xray: fix 2024-03-12 21:52:19 +08:00
chn
3a78bf355c localPackages.vasp.intel: fix build 2024-03-12 21:36:43 +08:00
chn
3805b34055 system.nixpkgs: fix build 2024-03-12 21:27:47 +08:00
chn
f899852185 localPackages.hdf5: fix build 2024-03-12 20:55:20 +08:00
chn
20d73a7928 add note 2024-03-12 20:25:46 +08:00
chn
87646c470d add note 2024-03-12 20:21:06 +08:00
chn
408d9e63a8 devices.xmupc2: enable snapper 2024-03-12 19:47:47 +08:00
chn
0a35bb6de8 整理构建 2024-03-12 19:40:55 +08:00
chn
c273d0422b system.nix: use gccarch-exact-<march> to enforce build 2024-03-12 15:27:58 +08:00
chn
326d384275 localPackages.vasp.intel: fix 2024-03-12 15:16:54 +08:00
chn
079c97a064 devices.xmupc1: add note 2024-03-12 12:03:34 +08:00
chn
ccc5727723 try to fix xrdp 2024-03-11 21:59:14 +08:00
chn
2728a53b43 devices.xmupc1/2: remove nix.remote.slave.mandatoryFeatures 2024-03-11 18:09:33 +08:00
chn
0f53e77a87 devices.xmupc1: add p5000 support 2024-03-11 17:35:06 +08:00
chn
1a77615cd8 devices.pc: add hosts 2024-03-11 16:44:25 +08:00
chn
1a944085e2 services.groupshare: fix 2024-03-11 16:30:24 +08:00
chn
2390edb22f system.nix.remote: init 2024-03-11 16:27:53 +08:00
chn
cce3917e26 services.groupshare: fix 2024-03-11 15:33:26 +08:00
chn
182481d4d5 services.xrdp: try to fix 2024-03-11 15:17:30 +08:00
chn
87caab3535 devices.xmupc1/2: fix samba 2024-03-11 13:21:17 +08:00
chn
fc93afc10a services.xray: fix 2024-03-10 22:36:40 +08:00
chn
fe56da23eb devices.nas: fix dae 2024-03-10 22:28:42 +08:00
chn
d4dadea0f9 devices.xmupc1: remove 10T disk 2024-03-10 22:14:07 +08:00
chn
7817f832be reset user password 2024-03-10 21:50:45 +08:00
chn
eb85700981 add note 2024-03-10 21:29:58 +08:00
chn
0317d0361f devices.xmupc2: fix slurm 2024-03-10 21:21:20 +08:00
chn
5357b73c29 devices.xmupc2: fix slurm 2024-03-10 21:15:42 +08:00
chn
d5ddd05437 add note 2024-03-10 21:15:23 +08:00
chn
ffb0a5d622 add doc 2024-03-10 20:42:03 +08:00
chn
02faddaf7b devices.xmupc2: fix slurm 2024-03-10 19:27:45 +08:00
chn
c17c173654 devices.xmupc2: enable beesd and xrdp 2024-03-10 17:16:06 +08:00
chn
8148570b89 services.xray: use dae 2024-03-10 16:39:32 +08:00
chn
712c290357 localPackages.vasp: fix 2024-03-10 14:01:32 +08:00
chn
d53a82366b localPackages.vasp: fix 2024-03-10 11:38:13 +08:00
chn
3a269a9897 services.slurm: add sockets option 2024-03-09 18:44:30 +08:00
chn
499f2e0fb3 packages.ssh: add xmupc2 config 2024-03-09 17:17:36 +08:00
chn
bd5ab4758f devices.xmupc2: finalize setup 2024-03-09 16:00:39 +08:00
chn
ed651581b4 devices.xmupc2: fix build 2024-03-09 15:12:45 +08:00
chn
2b32d0b57c Merge branch 'xmupc2' into production 2024-03-09 12:53:42 +08:00
chn
075a5f255f devices.xmupc2: init 2024-03-09 12:53:32 +08:00
chn
a424e65001 packages: typora use unstable 2024-03-09 03:54:00 +08:00
chn
097010113d system.fileSystems.rollingRootfs: fix 2024-03-08 18:43:42 +08:00
chn
f9f0d5137a packages: add tor-browser 2024-03-08 14:55:16 +08:00
chn
22d557b12c services.xrdp: only enable optimise on explicit request 2024-03-08 14:22:15 +08:00
chn
2dd85db093 services.xrdp: add optimise 2024-03-08 13:51:10 +08:00
chn
41d3ca3dbe Merge branch 'production' into xrdp 2024-03-08 12:50:46 +08:00
chn
409091a2e3 暂存 2024-03-07 20:36:41 +08:00
chn
2d3c9a93f7 devices.pc: add amd config 2024-03-07 20:34:58 +08:00
chn
a146636de2 devices.pc: use prime offload as default 2024-03-07 20:34:58 +08:00
chn
b45c68a431 devices.pc: switch to amd+nvidia sync 2024-03-07 20:34:58 +08:00
chn
b07e09c94e move secrets to devices 2024-03-07 18:10:10 +08:00
chn
e9413380d4 system.networking.nebula: remove 2024-03-07 18:03:24 +08:00
chn
a0ae0522d7 devices.pc: enable colord 2024-03-07 00:35:20 +08:00
chn
2f59817b22 devices.pc: use wayland 2024-03-07 00:35:20 +08:00
chn
265b3d89b0 services.wireguard: fix 2024-03-07 00:32:49 +08:00
chn
2e8030fd5d devices.xmupc1: add note 2024-03-06 18:05:18 +08:00
chn
2c472400c8 devices.pc: fix gpu 2024-03-06 17:49:29 +08:00
chn
3edf4d340c packages.ssh: update key for hpc 2024-03-06 13:48:40 +08:00
chn
10b922975e packages: remove yuzu 2024-03-06 11:49:16 +08:00
chn
fff970f2a5 packages: add more packages 2024-03-06 11:49:16 +08:00
chn
19ab6c378e system: enable binfmt 2024-03-06 11:49:16 +08:00
chn
f75c150bc6 services.wireguard: fix 2024-03-06 11:10:04 +08:00
chn
2597870de1 packages.ssh: fix 2024-03-06 10:49:38 +08:00
chn
34cfe8cdd3 users.chn: surface add autostart 2024-03-06 10:32:18 +08:00
chn
cdd691ba1c 暂存 2024-03-04 20:58:44 +08:00
chn
71f3be8d2d services.xrdp: fix 2024-03-04 18:29:39 +08:00
chn
f312b3f53f services.nextcloud: fix 2024-03-04 12:08:53 +08:00
chn
02b1f1100d services.misskey: fix 2024-03-04 12:00:16 +08:00
chn
30ab9c6ea3 packages.ssh: update hpc key 2024-03-04 11:25:39 +08:00
chn
c4e9321982 localPackages.misskey: remove tensorflow dependency 2024-03-04 10:51:05 +08:00
chn
47946acd54 localPackages.misskey: update 2024-03-04 10:14:57 +08:00
chn
95e92f26cd hardware: remove halo-keyboard 2024-03-03 21:36:16 +08:00
chn
2240d9655b force disable xrdp currenty 2024-03-03 21:35:00 +08:00
chn
3e99e33690 localPackages.mirism: fix 2024-03-03 19:53:47 +08:00
chn
df041492cc system.kernel: use lts as default 2024-03-03 19:18:30 +08:00
chn
cb19a7e674 packages.ssh: fix 2024-03-03 00:06:31 +08:00
chn
9e4a57798f services.nextcloud: update apps 2024-03-02 22:06:41 +08:00
chn
818fad6a75 packages: add nextcloud 2024-03-02 13:52:38 +08:00
chn
9a9b5c009b packages: add mumax 2024-03-02 11:40:16 +08:00
chn
d126019fdc Merge branch 'next' into production 2024-03-02 10:52:19 +08:00
chn
0de2e097bb fix build 2024-03-02 10:49:51 +08:00
chn
72bfa4bbf9 update nix-vscode-extensions 2024-03-01 21:30:41 +08:00
chn
f5d4e60aa3 Merge branch 'mumax' into production 2024-03-01 21:12:16 +08:00
chn
8d5a663ae0 localPackages.mumax: init 2024-03-01 21:11:54 +08:00
chn
33ef334fb0 Revert "services.slurm: fix"
This reverts commit 7850be2131.
2024-03-01 19:38:55 +08:00
chn
7850be2131 services.slurm: fix 2024-03-01 19:31:44 +08:00
chn
d622d85546 services.xrdp: fix 2024-03-01 18:49:14 +08:00
chn
d54404d5bc services.slurm: fix database connection 2024-03-01 11:26:24 +08:00
chn
bc1cff1ae1 devices.pc: fix slurm 2024-03-01 11:08:35 +08:00
chn
9e7803df0d devices.pc: remove resumeCommands 2024-03-01 11:07:47 +08:00
chn
da89605fa7 remove nix-alien 2024-02-29 21:23:10 +08:00
chn
9e3adab1c7 packages: remove _prebuildPackages 2024-02-29 17:46:14 +08:00
chn
de23962a21 services.xray: add user 2024-02-29 17:10:31 +08:00
chn
f0beeb202c devices.pc: do not reload mt7921e on resume 2024-02-29 14:12:29 +08:00
chn
755f9f1204 update everything
removed: chromiumos-touch-keyboard typora lmix dguibert-nur-packages cascade
2024-02-28 22:10:42 +08:00
chn
6966b5f25b devices.xmupc1: enable snapper 2024-02-28 17:39:12 +08:00
chn
2030c3048f xmupc1: enable beesd 2024-02-28 14:37:12 +08:00
chn
26f9a01845 packages.vscode: add plugin 2024-02-28 13:22:52 +08:00
chn
97460cf9ff users: fix import 2024-02-27 21:27:26 +08:00
chn
2eb933599d services.slurm: allow overscribe on nodes 2024-02-27 20:21:22 +08:00
chn
82fb082006 devices.xmupc1: enable samba 2024-02-27 13:49:16 +08:00
chn
50a7839407 fix deploy 2024-02-27 13:21:13 +08:00
chn
bc82d0956d devices.xmupc1: enable xrdp 2024-02-27 13:17:54 +08:00
chn
8b329eabca fix 2024-02-27 12:56:43 +08:00
chn
5aeca3451d localPackages.hdf5-nvhpc: limit build 2024-02-27 12:52:04 +08:00
chn
4ea44a179e localPackages.vasp: export source 2024-02-27 12:47:15 +08:00
chn
dc0ac2a333 localPackages.vasp: use system-features to limit build 2024-02-27 12:21:44 +08:00
chn
bee788f30d revert: fix for znver3 2024-02-27 11:52:57 +08:00
chn
2649cc36df system.nix: keep-outputs = true 2024-02-27 11:19:29 +08:00
chn
09e2076eee fix build for znver3 2024-02-27 10:17:32 +08:00
chn
7fa8d58e3e devices.xmupc1: use remote build 2024-02-27 10:03:36 +08:00
chn
82f41d070c devices.xmupc1: add document 2024-02-27 09:52:24 +08:00
chn
eac0a49f51 devices.xmupc1: some fix 2024-02-26 21:03:38 +08:00
chn
380532ffbc hardware.nvidia: fix 2024-02-26 19:55:26 +08:00
chn
bca4d85c7b devices.xmupc1: autostart sddm 2024-02-26 19:39:38 +08:00
chn
864d739b68 add xmupc1 deploy 2024-02-26 19:36:44 +08:00
chn
2e14f31dcb services.slurm: fix 2024-02-26 19:34:40 +08:00
chn
b553e1cd21 system.gui: use x11 on nvidia 2024-02-26 14:39:49 +08:00
chn
e7c9de177c packages.plasma: fix 2024-02-26 14:36:55 +08:00
chn
086cc04512 packages.plasma: fix 2024-02-26 14:27:50 +08:00
chn
309812741a devices.xmupc1: re-encrypt 2024-02-26 14:05:00 +08:00
chn
a92eae2b67 packages.ssh: add more users to cdString 2024-02-26 13:29:55 +08:00
chn
89253105fd users: remove yxy 2024-02-26 13:27:33 +08:00
chn
fd416d5574 users: add test 2024-02-26 13:24:33 +08:00
chn
815819adb8 packages.plasma: setup for all user 2024-02-26 12:55:39 +08:00
chn
8cf5fa8635 services.fontconfig: fix 2024-02-26 12:48:49 +08:00
chn
38a96c5e56 devices.xmupc1: init 2024-02-26 12:17:27 +08:00
chn
90101eb222 localPackages.oneapi: add 2022.2 2024-02-25 18:59:54 +08:00
chn
890000b9ef localPackages.vasp: add intel 2024-02-25 17:40:43 +08:00
chn
b674075d49 localPackages.vasp: reorganize 2024-02-25 15:34:35 +08:00
chn
d7923aafe1 services.slurm: enable accounting 2024-02-25 15:04:44 +08:00
chn
2b20f5ab35 services.slurm: fix gui 2024-02-24 22:51:27 +08:00
chn
aa7662ef48 localPackages.vasp-gnu: rename 2024-02-24 22:45:02 +08:00
chn
adf2141297 packages: add mpi 2024-02-24 22:41:25 +08:00
chn
a609a3d6c1 localPackages.vasp: add 6.3.1 2024-02-24 22:40:16 +08:00
chn
a7d372c6a7 localPackages.oneapi: init 2024-02-24 22:11:58 +08:00
chn
2c8dca786e services.slurm: enable cuda support 2024-02-24 21:24:07 +08:00
chn
7edb16f163 packages.workstation: add nvtop 2024-02-24 19:13:56 +08:00
chn
7458744a1f localPackages.vasp-gpu: enable OPTCELL patch 2024-02-24 18:57:48 +08:00
chn
100f5241b1 localPackages.vasp-gpu: add hdf5 and wannier support 2024-02-24 18:52:12 +08:00
chn
29a98af8d4 localPackages.vasp-gpu: add vasp-6.3.1 2024-02-24 15:43:38 +08:00
chn
1bc85bc6af services.slurm: init 2024-02-24 15:21:47 +08:00
chn
a904be79b8 devices.vps6: enable beesd 2024-02-24 11:06:47 +08:00
chn
522eff0fad devices.vps6: disable snapper 2024-02-24 11:02:20 +08:00
chn
3fb9a0a63c services.beesd: use large hash table 2024-02-24 11:00:16 +08:00
chn
8928406161 devices.nas: enable snapper 2024-02-23 21:46:13 +08:00
chn
2c750d8b90 localPackages.vasp-gpu: fix 2024-02-23 18:29:19 +08:00
chn
b370ab0a88 devices.nas: disable snapper 2024-02-23 13:15:03 +08:00
chn
3d9a10f8b0 add xmupc1 to build list 2024-02-23 12:26:35 +08:00
chn
1742ff8cbd fix build for znver3 2024-02-23 12:05:35 +08:00
chn
4c3b25afca devices.surface: fix 2024-02-22 23:33:53 +08:00
chn
e5ba10751b users.chn.plasma.shortcuts: reset config on startup 2024-02-22 23:05:53 +08:00
chn
834d44fbf6 packages.server: add pydbus 2024-02-22 21:09:09 +08:00
chn
1cd3a3ff39 packages.xclip: fix 2024-02-22 21:08:12 +08:00
chn
8362b370e8 devices.nas: enable snapper 2024-02-22 14:16:44 +08:00
chn
185c001f3f packages.zsh: fix 2024-02-22 12:42:48 +08:00
chn
cfc6621074 users.chn.plasma.autostart: add crow-translate 2024-02-22 12:41:58 +08:00
chn
73445cf51b devices.xmupc1: fix 2024-02-21 18:59:15 +08:00
chn
8ff662be17 packages: add cpu-x and pdfgrep 2024-02-21 18:18:00 +08:00
chn
a3b9c2d29f packages.desktop-fat: use upstream typora 2024-02-21 16:48:02 +08:00
chn
c9552c0674 devices.xmupc1: init 2024-02-21 16:38:29 +08:00
chn
83b8690bce localPackages.vasp-gpu: fix 2024-02-21 16:18:34 +08:00
chn
b60a0e9b70 packages.zsh: fix history 2024-02-21 15:32:33 +08:00
chn
88609fafe4 localPackages.vasp: fix 2024-02-21 15:27:39 +08:00
chn
9204d9879b localPackages.nvhpc: use fhs to build 2024-02-21 14:00:27 +08:00
chn
f98887155e localPackages.lmod: fix install path 2024-02-21 11:29:47 +08:00
chn
77d268d883 systemm.nixpkgs: add cudatoolkit 2024-02-20 19:08:46 +08:00
chn
128b83a7c6 localPackages.nvhpc: allow multiple versions 2024-02-20 18:54:51 +08:00
chn
81ed72bf92 localPackages.vasp-gpu: init 2024-02-20 18:22:38 +08:00
chn
2aefcc5142 localPackages.lmod: init 2024-02-19 17:25:27 +08:00
chn
6b16d10a83 localPackages.nvhpc-sdk: init 2024-02-19 16:43:49 +08:00
chn
f7ff629c55 Revert "programs.aagl: move to desktop-fat"
This reverts commit fd4e8ebdff.
2024-02-19 11:13:34 +08:00
chn
61b3df7c82 services.vikunja: init 2024-02-18 22:59:49 +08:00
chn
fd4e8ebdff programs.aagl: move to desktop-fat 2024-02-18 22:48:13 +08:00
chn
8f623ff3df programs.chromium: move to desktop 2024-02-18 22:47:07 +08:00
chn
98817c89d4 localPackages.misskey: update 2024-02-17 21:05:24 +08:00
chn
983e9163e1 users.chn.plasma.wallpaper: add new wallpapers 2024-02-17 18:19:01 +08:00
chn
ea64073bbf users.chn.plasma.shortcuts: fix 2024-02-17 17:57:27 +08:00
chn
aa33572db7 users.chn.plasma.shortcuts: change some shortcuts 2024-02-17 17:02:23 +08:00
chn
21e8f3ec39 devices.pc: use x11 2024-02-17 15:56:25 +08:00
chn
8e2ff3d5a3 Revert "devices.pc: set QSG_RENDER_LOOP"
This reverts commit 7125ae3be8.
2024-02-17 15:56:16 +08:00
chn
7125ae3be8 devices.pc: set QSG_RENDER_LOOP 2024-02-17 15:50:08 +08:00
chn
810afe1df5 hardware.gpu: nvidia enable forceFullCompositionPipeline 2024-02-17 15:37:29 +08:00
chn
7ebb95aac2 devices.pc: switch to nvidia only 2024-02-17 15:15:20 +08:00
chn
b5ad8307dc packages.firefox: add plasma-integration 2024-02-17 07:03:22 +08:00
chn
385939522a devices.surface: restart iptsd on resume 2024-02-17 06:59:37 +08:00
chn
a3e1dce432 devices.surface: enable snapper 2024-02-17 06:55:26 +08:00
chn
e5288112e9 services.beesd: adjust hashTableSizeMB 2024-02-17 00:14:01 +08:00
chn
2396bdcd64 devices.surface: enable beesd, disable snapper 2024-02-16 23:34:49 +08:00
chn
63e4eb7bba devices.surface: enable wireguard 2024-02-16 22:33:29 +08:00
chn
c9fbc3b5bc flake: update firefox extensions 2024-02-16 17:02:52 +08:00
chn
a90f74fb77 packages: add nix-fast-build 2024-02-16 16:38:31 +08:00
chn
9b9493be53 system.kernel: add hibernate progress patch 2024-02-16 16:21:57 +08:00
chn
983decc8c1 packages.firefox: switch to lepton 2024-02-16 15:32:26 +08:00
chn
7d584a6563 hardware.gpu: fix 2024-02-16 15:01:24 +08:00
chn
7f8f65649b system.nix: increase max-jobs and max-substitution-jobs 2024-02-16 12:37:01 +08:00
chn
390c24aea9 devices.pc: reload mt7921e on resume 2024-02-16 12:36:23 +08:00
chn
98e75a2ab4 virtualization.docker: fix 2024-02-16 11:39:37 +08:00
chn
7c161d3521 devices.pc: use xcalib to load color profile 2024-02-16 10:50:12 +08:00
chn
7cb4c6ecec devices.pc: try to use colord 2024-02-16 10:48:24 +08:00
chn
aef16e54f1 devices.pc: add specialisation for nvidia graphic card 2024-02-16 10:04:07 +08:00
chn
536a96ce5e hardware.gpu: fix 2024-02-16 09:44:14 +08:00
chn
a94d6e3d21 devices.pc: switch to amd+nvidia 2024-02-15 23:20:56 +08:00
chn
0e09b925c2 hardware.gpu: rewrite 2024-02-15 23:17:20 +08:00
chn
9d1fae10d8 hardware: update nvidia driver 2024-02-15 20:28:51 +08:00
chn
ef1caae121 hardware: use default nvidia driver 2024-02-15 19:55:41 +08:00
chn
6d70eecc19 system.kernel: fix for surface 2024-02-15 19:38:33 +08:00
chn
1e42238723 system.kernel: update to 6.7 2024-02-15 19:38:17 +08:00
chn
fe089060ae Revert "add todo"
This reverts commit 54bfa1c8ac.
2024-02-15 16:54:57 +08:00
chn
8a5bb908c7 devices.nas: disable snapper 2024-02-15 16:17:16 +08:00
chn
54bfa1c8ac add todo 2024-02-15 16:16:40 +08:00
chn
54493a2ec6 users.chn.plasma: fix kwin shortcuts 2024-02-15 15:53:57 +08:00
chn
f1218571c5 fix build 2024-02-15 15:40:21 +08:00
chn
aecc530aa9 packages.firefox: fix cascade UI 2024-02-15 15:28:21 +08:00
chn
c43187a15c fix build 2024-02-15 15:27:39 +08:00
chn
86a781b327 packages.firefox: add grammarly 2024-02-12 18:39:05 +08:00
chn
0424d7eed7 users.chn.plasma.wallpaper: fix 2024-02-12 18:23:11 +08:00
chn
78a74a5aef users.chn.plasma.shortcuts: add shortcut for system monitor 2024-02-12 14:16:24 +08:00
chn
a4c04c9de2 devices.nas: use desktop-fat package set 2024-02-12 14:12:15 +08:00
chn
aad44c7edd users.chn.plasma.autostart: fix 2024-02-12 13:40:40 +08:00
chn
2a7e8d78be Revert "vps7: disable gui"
This reverts commit bffed3b584.
2024-02-12 13:39:37 +08:00
chn
8b90c0bc22 Revert "nas: disable gui"
This reverts commit 08df40f3a3.
2024-02-12 13:39:26 +08:00
chn
6f533e73ee packages.desktop: enable yubikey-touch-detector 2024-02-12 13:36:55 +08:00
chn
244b0e17fa users.chn.plasma.autostart: fix 2024-02-12 11:59:42 +08:00
chn
7f165fccf4 users.chn.plasma.autostart: add kmail and discord 2024-02-12 11:27:48 +08:00
chn
40f4d35b62 users.chn.plasma.autostart: add element 2024-02-12 11:09:26 +08:00
chn
02981d242f users.chn.plasma.autostart: init 2024-02-12 10:17:28 +08:00
chn
6a36fe0539 users.chn.plasma: split config 2024-02-12 10:04:56 +08:00
chn
45e5569d55 packages.firefox: force write profile.ini 2024-02-12 09:19:09 +08:00
chn
a9027c6127 Merge branch 'firefox' into production 2024-02-12 08:28:37 +08:00
chn
67079b0885 packages.firefox: add dualsub, pakkujs, rsspreview 2024-02-12 08:28:17 +08:00
chn
3384026e91 users.chn.plasma: use tela icon 2024-02-12 00:05:58 +08:00
chn
803b20ec96 users.chn.plasma: switch back to black background 2024-02-11 23:47:56 +08:00
chn
074f88d231 users.chn.konsole: fix opacity 2024-02-11 23:22:10 +08:00
chn
fd7fe508f5 localPackages.blurred-wallpaper: fix 2024-02-11 22:57:59 +08:00
chn
cf6a66f11e users.chn.plasma: fix 2024-02-11 22:45:59 +08:00
chn
c4c2e680a4 packages.firefox: do not use catppuccin 2024-02-11 22:23:02 +08:00
chn
bf16cc5593 packages.desktop.firefox: use catppucin color 2024-02-11 22:08:43 +08:00
chn
5d473887a3 Merge branch 'production' into firefox 2024-02-11 21:56:44 +08:00
chn
773b2e8cc1 users.chn.plasma: add impermanence 2024-02-11 21:53:12 +08:00
chn
c9cfbb515b users.chn.plasma: add yakuake and konsole 2024-02-11 21:41:43 +08:00
chn
82e2cd4e7d system.impermanence: do not persist fontconfig 2024-02-11 17:27:15 +08:00
chn
794657d0ea packages.desktop.firefox: add firefox-color 2024-02-11 17:26:24 +08:00
chn
4f621ce7f1 fix wallpaper 2024-02-11 17:17:24 +08:00
chn
4ebff80941 services.fontconfig: force set font config 2024-02-11 16:59:43 +08:00
chn
6080de15ca users.chn.wallpaper: use blurred-wallpaper package 2024-02-11 16:45:51 +08:00
chn
2310289c92 packages.desktop.firefox: enable language packs 2024-02-11 11:59:31 +08:00
chn
ef30e0f6dc packages.desktop.firefox: force set search engine 2024-02-11 11:32:22 +08:00
chn
e26e287603 packages.default.firefox: add zotero-connector 2024-02-11 11:26:42 +08:00
chn
f9227c3e85 packages.desktop.firefox: add some settings 2024-02-11 09:55:40 +08:00
chn
264be067ca packages.desktop.firefox: add user chrome 2024-02-10 11:21:49 +08:00
chn
047619ee17 packages.desktop.firefox: init 2024-02-10 10:53:57 +08:00
chn
fc6cbc6230 do not set wallpaper 2024-02-09 21:48:12 +08:00
chn
056f38dbf5 devices.pc: fix xcalib startup script 2024-02-09 21:32:12 +08:00
chn
61d7db84ba direct add wallpaper to flake 2024-02-09 21:24:20 +08:00
chn
6672ea7f4f plasma-manager: init 2024-02-09 17:05:34 +08:00
chn
4aead6cfc6 fix build 2024-02-09 12:38:12 +08:00
chn
139722dfdf fix waydroid 2024-02-09 12:12:58 +08:00
chn
ac85049d0f fix zip 2024-02-08 23:01:08 +08:00
chn
f5f71bee21 localPackages.win11os-kde: init 2024-02-05 18:18:10 +08:00
chn
08af6615af update plasma-manager 2024-02-05 11:45:56 +08:00
chn
a07800192d system.gurb: fix efishell 2024-02-04 11:37:36 +08:00
chn
13b0c77e7a do not archive 2024-02-04 11:13:34 +08:00
chn
43e8215fc6 Merge branch 'main' into production 2024-02-03 20:52:43 +08:00
chn
abdf3f5f0b vps7: disable mastodon 2024-02-03 20:52:16 +08:00
chn
9b41ebd154 Revert "services.mastodon: security update to 4.2.5"
This reverts commit 3a60acebb5.
2024-02-03 20:51:55 +08:00
chn
21e8b5300a switch to production 2024-02-03 20:49:59 +08:00
chn
6967ab4839 Revert "switch to production build"
This reverts commit 2fe4fb2a25.
2024-02-03 20:45:25 +08:00
chn
3a60acebb5 services.mastodon: security update to 4.2.5 2024-02-03 20:39:47 +08:00
chn
26f0b20684 fix build for silvermont 2024-02-03 19:21:34 +08:00
chn
2fe4fb2a25 switch to production build 2024-02-03 19:14:42 +08:00
chn
641fd3bb97 fix vps7 build 2024-02-03 10:56:07 +08:00
chn
d37e47ff40 system.grub: fix efi shell 2024-02-02 23:39:12 +08:00
chn
67d3cac7a1 packages.server: add dmidecode 2024-02-01 14:32:23 +08:00
chn
3ffdf466bb system.grub: add efi shell 2024-02-01 13:56:09 +08:00
chn
c89af3fa52 system.grub: rewrite 2024-02-01 12:30:01 +08:00
chn
817613ea96 system.envfs: fix 2024-02-01 11:09:11 +08:00
chn
236ddddffc rewrite system.nix 2024-02-01 10:55:47 +08:00
chn
c08fd457cb system.nix: keepOutputs -> includeBuildDependencies 2024-02-01 10:43:54 +08:00
chn
a577616756 system.nix: autoOptimiseStore = false by default 2024-02-01 10:39:27 +08:00
chn
9e43844e14 system.impermanence: enable by default 2024-02-01 10:05:02 +08:00
chn
81521bcd3b system: add envfs 2024-02-01 10:03:15 +08:00
chn
e2674908fb packages.desktop: fix xclip 2024-02-01 09:56:30 +08:00
chn
7d43e6218d localPackages: fix mirism 2024-02-01 09:30:37 +08:00
chn
41552e2ea1 pc: envfs use upstream 2024-02-01 00:30:11 +08:00
chn
268c5bdf3a pc: enable envfs 2024-02-01 00:05:04 +08:00
chn
500d4ac79e 整理了一些plasma的配置 2024-01-31 22:49:30 +08:00
chn
d0603c5977 fix surface build 2024-01-31 22:05:18 +08:00
chn
a5fdf1ea1d pc: do not include build dependencies 2024-01-31 21:14:21 +08:00
chn
8774a6759a packages.workstation: add yuzu 2024-01-31 15:21:22 +08:00
chn
d354b555eb Revert "pc: enable envfs"
This reverts commit 3a96911336.
2024-01-30 20:21:35 +08:00
chn
3a96911336 pc: enable envfs 2024-01-30 19:34:10 +08:00
chn
08df40f3a3 nas: disable gui 2024-01-30 19:22:25 +08:00
chn
bffed3b584 vps7: disable gui 2024-01-30 19:21:36 +08:00
chn
c29eb53ee0 Revert "Revert "pc: include all build dependencies""
This reverts commit fbc6d5bee1.
2024-01-30 13:34:54 +08:00
chn
42119af04d fix pc build 2024-01-30 11:46:06 +08:00
chn
9d5772ab1f Merge branch 'main' into next 2024-01-30 11:41:04 +08:00
chn
fbc6d5bee1 Revert "pc: include all build dependencies"
This reverts commit 9f9e58e54e.
2024-01-29 21:34:40 +08:00
chn
9f9e58e54e pc: include all build dependencies 2024-01-29 18:45:48 +08:00
chn
dc297d0d04 pc: enable snapper 2024-01-29 14:48:58 +08:00
chn
b59dc1b213 services.xray: do not bypass nvidia 2024-01-29 11:07:05 +08:00
chn
853aaf8183 system.nix: set max-jobs & max-substitution-jobs 2024-01-28 19:02:34 +08:00
chn
795acc3828 system.nix: limit max-substitution-jobs 2024-01-27 18:38:28 +08:00
chn
7cf371e78c system.grub: enable memtest86 2024-01-27 18:36:51 +08:00
chn
39fde66754 pc: enable beesd 2024-01-26 16:00:12 +08:00
chn
7a881491bd pc: do not autoOptimiseStore 2024-01-26 15:56:49 +08:00
chn
8e7c615b02 pc: disable beesd and snapper 2024-01-24 08:59:54 +08:00
chn
dbc6874ead update everything 2024-01-23 15:31:49 +08:00
chn
1a2f725a8e localPackages: zpp-bits use flake inputs 2024-01-22 21:11:00 +08:00
chn
0665f57988 pc: setup color profile 2024-01-22 10:54:31 +08:00
chn
15a9f0c05e packages.desktop: add xcalib 2024-01-22 10:50:36 +08:00
chn
82d834e93a pc: add color profiles 2024-01-22 00:52:49 +08:00
chn
c4cccacba3 packages.desktop: add argyllcms 2024-01-22 00:30:53 +08:00
chn
753709d494 pc: disable colord 2024-01-22 00:28:13 +08:00
chn
173d83daae localPackage.rsshub: use flake inputs 2024-01-21 23:45:43 +08:00
chn
cbe228c873 surface: enable waydroid 2024-01-21 18:14:11 +08:00
chn
eb2ab49388 packages: move some package from workstation to desktop-fat 2024-01-20 11:42:41 +08:00
chn
3fd0988582 surface: add maliit 2024-01-20 11:36:26 +08:00
chn
de3b40360b surface: enable iptsd 2024-01-20 11:10:27 +08:00
chn
bb9a1bfb68 Revert "surface: remove patch from nixos-hardware"
This reverts commit 9d8442b1cf.
2024-01-20 11:10:13 +08:00
chn
9d8442b1cf surface: remove patch from nixos-hardware 2024-01-20 10:04:00 +08:00
chn
26150244cb update aagl 2024-01-19 23:50:47 +08:00
chn
914eea92b6 services.wireguard: fix 2024-01-19 19:45:56 +08:00
chn
b2532ef44d services.xray: rename 2024-01-19 19:08:28 +08:00
chn
b600c81aa7 system.nix: comma use upstream nixpkgs-unstable 2024-01-19 10:39:08 +08:00
chn
01a5c290bc surface: enable swap 2024-01-18 22:38:29 +08:00
chn
16c9fa7c3d surface: disable iptsd 2024-01-18 22:12:28 +08:00
chn
9bf3faee63 system.gui: fix 2024-01-18 21:40:51 +08:00
chn
e1789991c4 allow deploy to surface 2024-01-18 21:38:11 +08:00
chn
3cbfe14cc2 system.gui: use wayland as default 2024-01-18 21:20:56 +08:00
chn
2df6396b84 localPackages.typora: update 2024-01-18 15:11:17 +08:00
chn
ce44fe7856 localPackages.misskey: use flake input 2024-01-18 14:45:50 +08:00
chn
de292de159 system: less log 2024-01-18 11:39:09 +08:00
chn
81b6831e1b do not blacklist module ideapad_laptop 2024-01-18 10:18:01 +08:00
chn
bd445d5034 surface: adjust 2024-01-17 16:22:07 +08:00
chn
0ca6df2499 nixos-hardware use upstream repo 2024-01-17 15:10:03 +08:00
chn
00d010a910 surface: fix kernel 2024-01-17 15:07:42 +08:00
chn
48f450bfe3 surface: add lantian patch 2024-01-17 14:31:09 +08:00
chn
7e4fe4837f surface: fix kernel 2024-01-17 14:27:55 +08:00
chn
13edf20710 use nixos-hardware from CHN-beta 2024-01-17 14:07:22 +08:00
chn
556a8d68fc surface: add config from nixos-hardware 2024-01-17 13:21:43 +08:00
chn
2e9972a8cd pc: enable waydroid 2024-01-17 12:16:03 +08:00
chn
30397a8443 pc: fix nvidia 2024-01-17 11:36:24 +08:00
chn
1fcecbb74d pc: disable waydroid 2024-01-17 09:38:55 +08:00
chn
d80d009e3a pc: enable virtualbox 2024-01-16 23:33:30 +08:00
chn
a9e0a57791 Revert "pc: enable anbox"
This reverts commit 17430b943e.
2024-01-16 23:15:57 +08:00
chn
17430b943e pc: enable anbox 2024-01-16 23:12:11 +08:00
chn
7e8bd6f959 pc: enable colord 2024-01-16 22:45:18 +08:00
chn
a624e98514 split machine config 2024-01-16 22:41:03 +08:00
chn
67a03b5ccc default use x11 2024-01-16 22:07:15 +08:00
chn
f64390d7a7 pc: switch back to nvidia 2024-01-16 22:00:21 +08:00
chn
d0158b1608 pc: prime use offload 2024-01-16 21:33:49 +08:00
chn
36da74115e try to fix amdgpu (failed) 2024-01-16 21:32:29 +08:00
chn
fd13dd7319 try to fix 2024-01-16 20:14:41 +08:00
chn
0e75a6f4e8 update kernel 2024-01-16 16:40:41 +08:00
chn
ccc102ea00 fix chromium 2024-01-16 01:18:22 +08:00
chn
4465522bc5 hardware: disable nvidia modesetting 2024-01-16 00:47:48 +08:00
chn
8ba5913eca surface: fix opencolorio 2024-01-16 00:14:14 +08:00
chn
478d760816 comment 2024-01-15 19:39:10 +08:00
chn
98f9bfd1e5 pc: use prime 2024-01-15 18:59:26 +08:00
chn
2d1df77bc3 vps6: xray reset uuid 2024-01-15 10:27:37 +08:00
chn
dc19b577dc comment 2024-01-14 22:37:44 +08:00
chn
49898a9d01 fix scipy 2024-01-14 22:32:57 +08:00
chn
c35664984e plasma-manager: prepare 2024-01-14 22:06:00 +08:00
chn
aec8ef7c35 add some comment 2024-01-14 20:29:46 +08:00
chn
8931b90a33 some adjust 2024-01-14 19:56:55 +08:00
chn
2b2883ab48 hardware: use production nvidia driver 2024-01-14 18:52:05 +08:00
chn
410f73e8b1 pc: try to fix backlight 2024-01-14 17:36:36 +08:00
chn
8ef28b9de5 hardware.legion: init 2024-01-14 14:55:39 +08:00
chn
c8e0c74535 hardware: fix nvidia modesetting 2024-01-14 12:42:30 +08:00
chn
d5a3a6b05a fix afdko 2024-01-14 12:42:19 +08:00
chn
00901f5cb5 packages.workstation: remove quantum-espresso 2024-01-14 12:21:27 +08:00
chn
c83505da53 pc: switch to znver4 2024-01-13 22:29:51 +08:00
chn
30c18790f9 fix numpy pandas eventlet 2024-01-12 12:24:24 +08:00
chn
216117a30a yoga->surface 2024-01-11 21:28:06 +08:00
chn
c4af4de4ea packages.workstation: update wemeet 2024-01-10 20:04:22 +08:00
chn
daa824943f services.mirism: fix 2024-01-09 11:37:36 +08:00
chn
bcd64f2fe7 packages.desktop.vscode: add vasp support 2024-01-08 19:47:40 +08:00
chn
259dfd53f3 services.mirism: restart every day 2024-01-07 20:49:55 +08:00
chn
1a463ee716 add znver4 support 2024-01-06 14:10:12 +08:00
chn
78a0a55bed localPackages: update misskey 2024-01-06 13:06:36 +08:00
chn
2a465b55ec modules.system: fstrim set to weekly (default) 2024-01-05 12:41:58 +08:00
chn
ea3f4bb00c modules.system: remove versionSuffix 2024-01-05 12:26:40 +08:00
chn
bbf601f5a8 modules.packages.desktop-fat.steam: replace chinese comment 2024-01-04 22:32:54 +08:00
chn
8543130661 packages.desktop: add firefoxpwa 2024-01-03 23:01:04 +08:00
chn
aa93dd53b6 packages.server.ssh: prefer askPassword 2024-01-03 22:43:28 +08:00
chn
0031080837 system.kernel: enable preempt as default 2024-01-02 22:21:05 +08:00
chn
d3f38c3b55 packages.server: enable gpg 2023-12-31 10:46:57 +08:00
chn
0c49c71899 services.nginx.applications.main: fix 2023-12-29 20:22:21 +08:00
chn
b0e543d324 packages.server.ssh: enable ssh agent forward 2023-12-29 20:22:02 +08:00
chn
51c8a516ff packages.server: remove gnupg agent 2023-12-29 15:33:06 +08:00
chn
f3c8017959 Revert "try to enable codex"
This reverts commit 3867469fc5.
2023-12-28 21:04:45 +08:00
chn
3867469fc5 try to enable codex 2023-12-28 21:03:38 +08:00
chn
f23f7101e4 update zsh-lsd 2023-12-28 12:55:18 +08:00
chn
8eea6ffdc3 packages.server.zsh: remove zsh-nix-shell 2023-12-28 12:29:35 +08:00
chn
729df7ab63 update misskey 2023-12-28 11:05:52 +08:00
chn
c1737fcb08 packages.server.ssh: set askPassword to systemd-ask-password 2023-12-27 17:42:53 +08:00
chn
50862f0e33 users.chn: add forwardAgent 2023-12-27 17:18:04 +08:00
chn
5b30aebfae services.frpClient: stcp allow all users 2023-12-27 15:11:15 +08:00
chn
f5e82ee889 localPackages.misskey: use nodejs 21 2023-12-25 20:50:42 +08:00
chn
a6241a201a try to fix pc power bug 2023-12-25 20:50:15 +08:00
chn
db3571b8e5 revert nodejs update 2023-12-25 20:46:27 +08:00
chn
bd6a867ab3 localPackages.misskey: use nodejs 20 2023-12-24 22:46:33 +08:00
chn
045de2b18e update nodejs 2023-12-24 22:45:26 +08:00
chn
501df43b0c services.misskey: increase statement_timeout 2023-12-24 14:58:20 +08:00
chn
fee1f32a0a localPackages.misskey: remove re2 2023-12-24 14:40:27 +08:00
chn
71c4426e53 Merge branch 'misskey' 2023-12-24 09:22:30 +08:00
chn
7cd03dd163 packages.server: add hexo-cli 2023-12-23 22:43:39 +08:00
chn
4941582aec update misskey 2023-12-23 22:42:04 +08:00
chn
29fef229d8 Revert "system: try to fix ipv6"
This reverts commit 303d67ca06.
2023-12-23 15:31:44 +08:00
chn
303d67ca06 system: try to fix ipv6 2023-12-23 10:03:09 +08:00
chn
3732d19de0 packages.server.ssh: auto cd in jykang 2023-12-22 11:39:10 +08:00
chn
26eec4d375 packages.server: split zsh 2023-12-22 11:38:56 +08:00
chn
ac362289de services.synapse: fix 2023-12-20 16:20:23 +08:00
chn
3bb5e840e7 services.synapse: fix 2023-12-20 15:26:35 +08:00
chn
8b3ef05d3b services.nginx.applications.main: fix alias 2023-12-20 15:14:51 +08:00
chn
0fd63c01f7 services.synapse: fix 2023-12-20 14:39:23 +08:00
chn
61c644a4b1 services.synapse: enable sliding sync 2023-12-20 14:33:14 +08:00
chn
788709aac9 services.synapse: fix 2023-12-20 12:33:17 +08:00
chn
f5053ae284 services.postgresql: add initializeFlags 2023-12-20 12:23:05 +08:00
chn
6a6625d585 system.kernel: port some change from xddxdd/nur-packages 2023-12-20 11:31:12 +08:00
chn
69c528a03d switch back to xanmod 2023-12-20 11:04:40 +08:00
chn
6c496b7b8e services.postgresql: fix locale setting 2023-12-19 22:09:35 +08:00
chn
13652e7c0e services.synapse: correct locale 2023-12-19 22:07:27 +08:00
chn
2160e453eb services.postgresql: allow set locale 2023-12-19 22:06:41 +08:00
chn
71acf32da3 vps7: enable second synapse instance 2023-12-19 21:43:48 +08:00
chn
aac7bad20a packages.workstation: add nheko 2023-12-19 21:19:27 +08:00
chn
1d9a3ad2c0 enable laptop-mode 2023-12-19 18:56:08 +08:00
chn
f55576883c system.kernel: switch to zen 2023-12-19 18:36:45 +08:00
chn
e71a08586d Revert "Revert "drop acpi workaround""
This reverts commit 8c2b6530a6.
2023-12-19 13:43:28 +08:00
chn
8c2b6530a6 Revert "drop acpi workaround"
This reverts commit 72e1e0140a.
2023-12-19 13:29:17 +08:00
chn
38d3d8c7df update kernel 2023-12-19 12:56:24 +08:00
chn
72e1e0140a drop acpi workaround 2023-12-19 12:51:43 +08:00
chn
59dbfaa70f add acpi workaround 2023-12-18 21:04:42 +08:00
chn
75e2b84c4c Revert "nvidia: do not add modules to initrd"
This reverts commit 45ec3e74b7.
2023-12-18 20:25:35 +08:00
chn
9cfd30db6a Revert "hardware: gpu drivers should not be in initrd"
This reverts commit 02a2d399d6.
2023-12-18 20:24:40 +08:00
chn
02a2d399d6 hardware: gpu drivers should not be in initrd 2023-12-18 20:08:24 +08:00
chn
eb25e31c70 always apply embree patch 2023-12-18 14:04:39 +08:00
chn
6265e41ca7 revert some nvidia config 2023-12-17 22:46:58 +08:00
chn
6f36cfe007 services.akkoma: init 2023-12-17 22:43:54 +08:00
chn
b8abc4a326 services.nginx.https: allow custom TLS certificate 2023-12-17 21:42:57 +08:00
chn
59b053886b services.synapse: enable redis 2023-12-17 19:52:12 +08:00
chn
1769069057 synapse 支持多实例 2023-12-17 19:44:40 +08:00
chn
9801e53230 services.gitea: fix ssh 2023-12-17 14:41:00 +08:00
chn
9ea81dfe9e services.gitea: fix ssh 2023-12-17 14:10:16 +08:00
chn
c6c9bbafae services.gitea: fix 2023-12-17 13:46:29 +08:00
chn
f906e9d556 services.gitea: init 2023-12-17 13:37:15 +08:00
chn
4ffd5aebd5 move wireguard peer config to top level 2023-12-17 12:10:45 +08:00
chn
8724c23fde fix watchfiles 2023-12-17 11:50:40 +08:00
chn
808058596f xmupc1: do not build firefox 2023-12-17 11:44:32 +08:00
chn
36b37daf2e packages.desktop.vscode: remove copilot-labs 2023-12-17 10:50:42 +08:00
chn
45ec3e74b7 nvidia: do not add modules to initrd 2023-12-17 10:49:22 +08:00
chn
f5724e10a4 pc: fix power down on load graphic driver 2023-12-17 01:10:00 +08:00
chn
183d805a8f services.gitlab: currently disable ssh 2023-12-16 22:29:02 +08:00
chn
ca7668cbd5 services.gitlab: change hostname, enable ssh and lfs 2023-12-16 21:16:56 +08:00
chn
2462e85b70 pc: disable XHCI wakeup 2023-12-16 20:34:30 +08:00
chn
a6b4077114 packages.desktop-fat: add fluffychat 2023-12-16 13:42:19 +08:00
chn
e5b13ace75 add chn.moe 2023-12-15 21:01:29 +08:00
chn
b861d7bfb9 fix tmpfiles permission 2023-12-15 20:26:04 +08:00
chn
2d8c36d108 fix wireguard port 2023-12-15 12:40:28 +08:00
chn
9ec9597421 services.fz-new-order: fix permission 2023-12-15 12:38:39 +08:00
chn
469919c75a services.wireguard: auto deduce port 2023-12-14 23:34:03 +08:00
chn
9e14036e57 system.gui: default coincide with packages._packageSets 2023-12-14 23:28:30 +08:00
chn
839e56e52c init xmupc1 2023-12-14 23:24:20 +08:00
chn
087b4f0a7f yoga: try to fix touch keyboard in initrd 2023-12-13 22:20:29 +08:00
chn
99b891a4cb packages.server.ssh: remove internal hostnames 2023-12-13 12:33:56 +08:00
chn
73d6b46a4b vps7: fix wireguard private key 2023-12-13 12:01:16 +08:00
chn
d15794e7b1 yoga: prefer gui 2023-12-12 23:40:10 +08:00
chn
417e924b04 add yogabook module to initrd 2023-12-12 23:30:43 +08:00
chn
f4d12652c2 fix 2023-12-12 00:18:03 +08:00
chn
219d3fbb20 整理 flake.nix 2023-12-11 19:19:36 +08:00
chn
d44a9c4ddb add ventoy-full 2023-12-11 17:29:51 +08:00
chn
266692c74a remove pe 2023-12-11 17:27:26 +08:00
chn
c1a8043322 install pe 2023-12-11 17:05:29 +08:00
chn
d330f60909 add exfatprogs 2023-12-11 13:48:47 +08:00
chn
2b16dde96d move some packages to workstation 2023-12-10 15:20:04 +08:00
chn
6369cf7842 use fixed uid 2023-12-09 20:01:50 +08:00
chn
0dff3a17c0 fix libreoffice 2023-12-09 10:53:51 +08:00
chn
05dddf63b1 system.security.sudo: enable pwfeedback 2023-12-08 21:41:53 +08:00
chn
73c29c5f82 Merge branch 'main' into native 2023-12-08 20:46:14 +08:00
chn
d6b6f449b8 vps7: disable nebula, enable wireguard 2023-12-08 20:25:39 +08:00
chn
1b0d9e9a2d fix zip 2023-12-08 16:43:23 +08:00
chn
625bcaf448 分离vscode的配置 2023-12-08 13:09:17 +08:00
chn
7bfbc43a50 packages.desktop.vscode: add markdown-preview-enhanced 2023-12-08 13:04:50 +08:00
chn
2463a8c1af fix 2023-12-08 12:12:53 +08:00
chn
b9fa645334 plasmamanager: init 2023-12-08 00:46:29 +08:00
chn
78b132cc58 fix pe build 2023-12-07 22:03:20 +08:00
chn
608774790b pe: init 2023-12-07 21:20:25 +08:00
chn
9ccb3d3316 build everything from source 2023-12-07 21:12:01 +08:00
chn
a0f7af141a services.nginx.transparentProxy: default listen on all interfaces 2023-12-07 20:00:22 +08:00
chn
f65433eb1e services.wireguard: fix firewall 2023-12-07 19:48:03 +08:00
chn
a9d0f4d8f9 整理ssh 2023-12-07 18:15:06 +08:00
chn
651604da94 disable nebula for pc and nas 2023-12-07 17:53:35 +08:00
chn
bb3d4db6f5 nas: enable wireguard 2023-12-07 17:46:59 +08:00
chn
7dfcd83071 services.wireguard: fix collision with xray 2023-12-07 17:44:14 +08:00
chn
b1d885f62c services.wireguard: init 2023-12-07 17:30:12 +08:00
chn
cb849daf0a move default secrets to subdirs 2023-12-07 16:28:19 +08:00
chn
66ba4864a7 packages.server: add wireguard-tools 2023-12-07 16:19:24 +08:00
chn
9a4aaedb9a add pix2tex 2023-12-07 12:58:07 +08:00
chn
902fd30be8 auto optimize store as default 2023-12-07 00:01:13 +08:00
chn
e12d3a7349 fix 2023-12-06 22:28:12 +08:00
chn
b767b11e8a pc: do not replace tensorflow 2023-12-06 22:24:32 +08:00
chn
b5eeef1147 enhance cuda support 2023-12-06 22:23:31 +08:00
chn
e07abc0ad5 packages.server: enable yazi 2023-12-06 14:52:01 +08:00
chn
07050cd9cd packages.server: enable mosh 2023-12-06 14:44:27 +08:00
chn
9097917855 fix mirism 2023-12-06 11:45:57 +08:00
chn
18e9922846 fix xdg-desktop-portal 2023-12-06 09:39:35 +08:00
chn
11058dc731 update rsshub 2023-12-05 23:25:01 +08:00
chn
8872c18810 use optimized fastfetch 2023-12-05 23:19:50 +08:00
chn
8c3d74abaf fix xdg-desktop-portal 2023-12-05 23:16:14 +08:00
chn
d83062faf0 fix fwupd 2023-12-05 19:10:02 +08:00
chn
87eb5cb8fc 分割配置文件 2023-12-05 16:40:40 +08:00
chn
1faa6103ca packages.chromium: 增加沉浸式翻译插件 2023-12-05 16:04:38 +08:00
chn
38c419f291 system.gui.fcitx5: add more themes 2023-12-05 15:52:04 +08:00
chn
a5ddab766b 铜锣湾实验室直接从本地访问 2023-12-05 14:45:56 +08:00
chn
a0c9b62c0e Revert "services.xray: nebula do not bypass"
This reverts commit 5a30ebe7b6.
2023-12-05 14:41:05 +08:00
chn
5a30ebe7b6 services.xray: nebula do not bypass 2023-12-05 12:24:18 +08:00
chn
6fd53808e6 remove trace 2023-12-05 11:43:08 +08:00
chn
e372278343 fix gdal 2023-12-05 10:55:37 +08:00
chn
d13364fa42 fix latex 2023-12-05 10:53:11 +08:00
chn
666990c1a9 替换更多包 2023-12-05 10:27:12 +08:00
chn
13363f42a1 缩减行数 2023-12-04 21:41:23 +08:00
chn
f642e11739 update flake.lock 2023-12-04 21:39:19 +08:00
chn
ed6b68eb89 vim use optimized version 2023-12-04 21:38:27 +08:00
chn
396ee9fc73 use localPackages.esbonio instead of esbonio 2023-12-04 21:38:08 +08:00
chn
44ae89efee nixpkgs: allow to replace tensorflow 2023-12-04 21:20:32 +08:00
chn
36e1faee0c fix eval 2023-12-04 18:26:27 +08:00
chn
1080a2dacf 整理 nixpkgs 2023-12-04 17:27:47 +08:00
chn
f9e35b8837 do not build with ccache 2023-12-04 11:41:29 +08:00
chn
dfad8c1df7 add logseq 2023-12-03 14:43:19 +08:00
chn
6444e76b49 fix pygls 2023-12-02 22:20:58 +08:00
chn
c2864ad7a0 fix pygls 2023-12-02 21:55:14 +08:00
chn
136d02b0eb packages: add autograd 2023-12-02 17:04:47 +08:00
chn
97158555e4 packages.vscode: add restrucuredtext 2023-12-02 15:34:50 +08:00
chn
3deeb55dbd fix nextcloud
update everything
2023-12-02 10:52:42 +08:00
chn
2184dfa34f disable ccache for tensorflow 2023-11-30 23:18:11 +08:00
chn
94d74eac46 enable ccache for multiple packages 2023-11-30 22:44:06 +08:00
chn
2bf0d49e52 ccache: move cache to /var/lib/ccache 2023-11-30 20:21:06 +08:00
chn
73ddbd00a9 fix chromium build with ccache 2023-11-30 20:14:49 +08:00
chn
1deffccf00 enable ccache for chromium 2023-11-30 14:47:38 +08:00
chn
bac20eae3e upate everything 2023-11-30 14:15:26 +08:00
chn
6057c5079f remove touchix 2023-11-29 02:19:41 +08:00
chn
2ab7119ea9 fix nextcloud twofactor_webauthn url 2023-11-29 01:30:41 +08:00
chn
56a34a9f73 update everything 2023-11-29 01:07:20 +08:00
chn
693967cf49 system.kernel: remove preempt patch 2023-11-27 02:22:08 +08:00
chn
d273fd6046 update rsshub 2023-11-26 01:07:32 +08:00
chn
73a509b1ba remove unused packages 2023-11-26 01:07:18 +08:00
chn
df7ff0516c Merge branch 'main' into next 2023-11-25 23:05:24 +08:00
chn
2b3c0e61c5 add emacs 2023-11-25 22:33:21 +08:00
chn
47406cd0a5 update 2023-11-24 11:12:05 +08:00
chn
36a702a9a2 Merge branch 'main' into next 2023-11-24 11:08:10 +08:00
chn
b42024378b add aircrack-ng 2023-11-23 23:53:13 +08:00
chn
7f68855c7d users: fix 2023-11-23 02:04:47 +08:00
chn
38c7491640 services.mastodon: fix 2023-11-22 22:00:58 +08:00
chn
18ca4d7a00 services.nextcloud: update apps 2023-11-22 21:48:23 +08:00
chn
d52d0e3139 services.mastodon: fix 2023-11-22 21:35:47 +08:00
chn
fecf4816dc packages: move some packages from desktop to desktop-fat 2023-11-22 20:54:03 +08:00
chn
3d92e9e593 localPackages.mirism: fix 2023-11-22 20:48:12 +08:00
chn
d54d37b8f2 minor fixes 2023-11-22 20:12:41 +08:00
chn
44e843ae5f exa -> eza 2023-11-22 16:42:31 +08:00
chn
ec07725983 fix pnpm2nix 2023-11-22 16:40:38 +08:00
chn
bc40195d0f yoga: add to default 2023-11-22 13:49:45 +08:00
chn
7561442593 done some todo 2023-11-22 11:58:58 +08:00
chn
b240f8d04c update meilisearch 2023-11-22 11:48:39 +08:00
chn
10691aa076 remove unnecessary unstablePackages 2023-11-22 11:41:36 +08:00
chn
8599296ff5 update inputs 2023-11-22 11:39:30 +08:00
chn
86e89c7310 use archived branch 2023-11-22 10:57:38 +08:00
chn
367c78abd7 move some packages 2023-11-22 10:48:00 +08:00
chn
50025a78a1 hardware.cpu: add some intel modules 2023-11-22 01:48:09 +08:00
chn
7c08aa5b05 system.impermanence: fix /srv mount 2023-11-21 22:03:47 +08:00
chn
24727ea5f0 services.fail2ban: add ignoreIP 2023-11-21 20:52:46 +08:00
chn
04d411d16f services.fail2ban: init 2023-11-21 20:44:31 +08:00
chn
84a2bc2eac system.impermanence: write journal to nodatacow 2023-11-21 20:06:48 +08:00
chn
616a366221 services.grafana: init 2023-11-21 00:05:26 +08:00
chn
757f0f63bf services.gitlab: add email_from option 2023-11-20 22:25:47 +08:00
chn
083cf9524c services.gitlab: fix port number 2023-11-20 22:23:45 +08:00
chn
19729fb334 services.gitlab: fix smtp 2023-11-20 22:09:41 +08:00
chn
da4a7e33ff typo 2023-11-20 20:53:34 +08:00
chn
ff5780ca42 services.gitlab: fix nginx 2023-11-20 20:51:57 +08:00
chn
9bdb9c8293 services.nextcloud: run nextcloud-setup after postgresql 2023-11-20 20:46:29 +08:00
chn
f51f9c9992 services.gitlab: init 2023-11-20 20:15:53 +08:00
chn
f5777bc89d services.gitlab: prepare 2023-11-20 15:03:02 +08:00
chn
54f2458f69 services.mastodon: add package to system 2023-11-19 22:52:06 +08:00
chn
d0ff526f82 fix mastodon 2023-11-19 22:44:06 +08:00
chn
e7708c5647 services.gitlab: preprare 2023-11-19 22:01:36 +08:00
chn
c38d84a1b1 services.mastodon: init 2023-11-19 20:47:52 +08:00
chn
4e44953e75 typo 2023-11-19 17:44:07 +08:00
chn
be8cf779c9 change some default settings 2023-11-19 17:33:38 +08:00
chn
3209e0aa60 users: 分离各个用户的配置 2023-11-19 17:15:44 +08:00
chn
7bba7613a2 add plasma-manager 2023-11-19 16:38:21 +08:00
chn
e78c263248 system.fileSystems: set delay to 2 day 2023-11-19 08:29:15 +08:00
chn
3ab09c31bb mastodon: prepare 2023-11-19 06:38:05 +08:00
chn
ae468cb654 fix 2023-11-19 02:35:06 +08:00
chn
2615d82fea nginx.applications.webdav: allow multiple instances 2023-11-19 02:32:07 +08:00
chn
3d2ad2e800 update misskey 2023-11-17 22:35:15 +08:00
chn
15e9cf917e nas: add webdav 2023-11-17 22:11:36 +08:00
chn
b0619ec108 fix xray error 2023-11-16 16:10:46 +08:00
chn
3c29b08a08 add blog catalog 2023-11-16 16:06:52 +08:00
chn
ed794ac95f 缩减行数 2023-11-16 15:51:47 +08:00
chn
17a462ad04 fix mirism path 2023-11-16 14:45:53 +08:00
chn
994360d473 dnsmasq: fix dns 2023-11-16 14:43:16 +08:00
chn
c32cff7349 nginx: fix path 2023-11-16 14:09:23 +08:00
chn
97468b121b add mirism 2023-11-16 13:58:59 +08:00
chn
8cbad5dc58 add httpapi 2023-11-16 13:18:21 +08:00
chn
790aa5fa2e add crunch hashcat 2023-11-16 12:09:11 +08:00
chn
3cfedc26c9 add john 2023-11-16 12:06:53 +08:00
chn
d2479b229e nginx.webdav: restrict write path 2023-11-16 11:57:02 +08:00
chn
87684a981d packages.ssh: add some hostname 2023-11-16 11:35:03 +08:00
chn
3386b3bd2b nginx: fix permission 2023-11-15 22:09:44 +08:00
chn
86cb0a4d85 add webdav 2023-11-15 21:37:20 +08:00
chn
7c96745618 nginx: add charset 2023-11-15 20:59:27 +08:00
chn
2a515f2a9b add kkmeeting 2023-11-15 20:42:42 +08:00
chn
5f4fea3df6 Merge branch 'nginx' 2023-11-15 19:48:38 +08:00
chn
d53c5493e1 port change from main 2023-11-15 19:29:14 +08:00
chn
8750ee1b8b 修正 addAuth 2023-11-15 19:24:03 +08:00
chn
d9c956bca1 init fz-new-order 2023-11-15 14:20:56 +08:00
chn
1f529b55e1 nginx https support cgi 2023-11-12 23:35:08 +08:00
chn
888f438031 add fcgiwrap 2023-11-12 22:13:01 +08:00
chn
7aadd673cd 打包 mirism 2023-11-12 21:59:03 +08:00
chn
f227925d38 fix php user group 2023-11-12 20:47:29 +08:00
chn
90839e445d Merge branch 'ua' 2023-11-12 20:29:27 +08:00
chn
57d07fc326 add ua 2023-11-12 20:29:16 +08:00
chn
91228c3053 allow disable sddm autostart 2023-11-12 20:15:44 +08:00
chn
3e8237286d docker only persist volumes
rollRootfs chattr +C
2023-11-12 19:35:09 +08:00
chn
3f670636e8 huginn: do not create database 2023-11-12 19:28:07 +08:00
chn
8191eec21e mariadb uses password auth only 2023-11-12 19:15:29 +08:00
chn
fed092c67c mariadb: fix user creation 2023-11-12 17:59:49 +08:00
chn
44ee17f2ff init huginn 2023-11-12 16:56:58 +08:00
chn
a898902f9e fix frp tls config 2023-11-11 20:27:12 +08:00
chn
00dd5ae7ad update frp 2023-11-11 20:14:37 +08:00
chn
d274730437 pc: frp add stcp 2023-11-11 19:13:16 +08:00
chn
333ed600ef xray 使用 nginx 的设置 2023-11-11 01:33:46 +08:00
chn
05cd6dd1c8 enable proxyProtocol as default 2023-11-11 00:57:49 +08:00
chn
b1e2497054 allow send to be forwarded 2023-11-10 23:57:13 +08:00
chn
0e56ee4293 fix send websocket 2023-11-10 23:52:43 +08:00
chn
0294805326 add send 2023-11-10 23:37:16 +08:00
chn
218b6c6140 暂存 localPackages.send 2023-11-10 20:47:05 +08:00
chn
f908883f18 fix nextcloud config 2023-11-10 19:30:37 +08:00
chn
4d81aa8ca7 fix nginx listen 2023-11-10 19:16:55 +08:00
chn
98fafdd331 add two xray user 2023-11-10 18:24:43 +08:00
chn
2549be1e55 所有机器都可以编译通过 2023-11-10 12:39:55 +08:00
chn
3d261febd2 Merge branch 'main' into nginx 2023-11-09 23:04:41 +08:00
chn
12cdc43f17 可以编译通过 2023-11-09 23:04:28 +08:00
chn
fd799befd3 全部修改完成 2023-11-09 22:19:37 +08:00
chn
69cb43e6f5 整理 vaultwarden 2023-11-09 21:02:08 +08:00
chn
7122474023 整理 synapse 2023-11-09 20:52:15 +08:00
chn
ebc8f80476 整理 photoprism 2023-11-09 20:43:25 +08:00
chn
855d24c1ea 整理 nextcloud 2023-11-09 20:32:13 +08:00
chn
aa74e0911c 修正misskey 2023-11-09 12:41:25 +08:00
chn
ad4f316339 packages: add jabref 2023-11-09 12:02:39 +08:00
chn
f8c0295bd5 修正 element 2023-11-09 12:02:05 +08:00
chn
72801ad14c minor fixes 2023-11-09 00:51:45 +08:00
chn
c975bcba51 重写nginx模块 2023-11-08 23:44:19 +08:00
chn
967f7f155e acme可以直接设置组 2023-11-08 23:18:19 +08:00
chn
bc351ff0d4 fix nginx type check 2023-11-07 16:16:04 +08:00
chn
35c183f9dc fix freshrss 2023-11-07 15:14:06 +08:00
chn
90a3604ac7 vps7: enable freshrss 2023-11-07 13:48:38 +08:00
chn
dd1ac653a3 fix synapse-admin 2023-11-07 13:40:22 +08:00
chn
8a88c8f6a7 mariadb: backup using singleTransaction 2023-11-07 13:34:14 +08:00
chn
ad6e94ec09 vps6: add synapse-admin service 2023-11-07 13:27:47 +08:00
chn
6b384443e2 confix xray for xmupc1 2023-11-06 20:11:18 +08:00
chn
21080d7d61 fix frp 2023-11-06 19:47:00 +08:00
chn
8a3b3313f7 fix freshrss 2023-11-06 19:41:31 +08:00
chn
7b3a23d19f frp: add stcp support 2023-11-06 19:41:05 +08:00
chn
dea55cdc70 freshrss do not auto enable nginx 2023-11-06 18:49:20 +08:00
chn
1216a2c674 Merge branch 'vps7-freshrss' 2023-11-06 18:30:00 +08:00
chn
3de91db3fd add freshrss 2023-11-06 18:29:46 +08:00
chn
297fcee5df vps6: disable beesd, enable autoOptimiseStore 2023-11-06 13:48:29 +08:00
chn
95e42f969c localPackages.misskey: update 2023-11-06 09:21:10 +08:00
chn
2ae484fcc9 packages.zsh: try to workaround bug 2023-11-05 23:08:32 +08:00
chn
4d0cc3e30c pc: use single swap partition 2023-11-05 12:45:09 +08:00
chn
09a687f65a change disk 2023-11-04 21:08:30 +08:00
chn
8f7c6db841 packages.ssh: add nas ip 2023-11-04 16:47:51 +08:00
chn
d225de887d packages: add reptyr 2023-11-04 12:43:30 +08:00
chn
ed98f26185 mount everything with noatime 2023-11-02 16:41:49 +08:00
chn
f1173b45b4 remove nvme bug workaround 2023-11-02 16:25:53 +08:00
chn
0204420d4f remove bfq scheduler 2023-11-02 16:24:46 +08:00
chn
c991429151 try to fix nvme bug 2023-11-02 15:54:05 +08:00
chn
7c391d6666 localPackages: fix misskey 2023-11-02 15:50:33 +08:00
chn
6beec31dc1 remove yoga from default systems 2023-11-02 12:11:04 +08:00
chn
0e4d8368e9 fix iwlwifi after hibernate 2023-10-31 17:36:53 +08:00
chn
36f71df435 Merge branch 'next' 2023-10-30 19:53:15 +08:00
chn
7b73bdb9f3 prepare merge into main 2023-10-30 19:53:08 +08:00
chn
4e05896b4f services.noisetorch: init 2023-10-30 19:13:15 +08:00
chn
44d8553aef Revert "remove big-parallel from system-features"
This reverts commit dfe5f20346.
2023-10-30 12:07:09 +08:00
chn
dfe5f20346 remove big-parallel from system-features 2023-10-30 11:23:30 +08:00
chn
42162dc08c local.pkgs: update rsshub typora 2023-10-28 21:24:56 +08:00
chn
9ef9c4daa7 packages: allow zotero 2023-10-28 12:07:46 +08:00
chn
7afa093d25 packages: permit electron_24 2023-10-28 12:04:14 +08:00
chn
c26ea843eb yubikey TOTP use home-manager module 2023-10-27 22:42:57 +08:00
chn
2b73a6549e packages: remove firefoxpwa 2023-10-27 22:25:06 +08:00
chn
ad12157fe1 update everything 2023-10-27 22:24:44 +08:00
chn
f628e55fab nas: mount /nix/backup 2023-10-27 12:15:47 +08:00
chn
2444ff5d27 system.fileSystems: rollingRootFs use subvolume id as suffix 2023-10-27 00:01:58 +08:00
chn
97ec3061e7 localPackages: add latex-citation-style-language 2023-10-25 16:03:43 +08:00
chn
e2c61c6aaa add nixpkgs-unstable to registry 2023-10-25 14:01:30 +08:00
chn
550ef39dcf Revert "packages: texlive use ubstable"
This reverts commit b2ef263267.
2023-10-25 13:59:57 +08:00
chn
b2ef263267 packages: texlive use ubstable 2023-10-25 13:57:34 +08:00
chn
a686d8259b packages: add microsoft-edge 2023-10-24 11:17:59 +08:00
chn
057e5a5d51 pc: remove modprobe config about iwlwifi 2023-10-23 17:12:08 +08:00
chn
9e36962acb pc: use last kernle 2023-10-23 17:11:35 +08:00
chn
0941aaf2ee pc: remove nvme workaround 2023-10-23 17:10:43 +08:00
chn
3197b26b10 fstrim: exclude bind mounts 2023-10-23 10:36:19 +08:00
chn
ea4b2cbeb8 system.fstrim: set interval to hourly 2023-10-22 20:34:58 +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
284 changed files with 14074 additions and 4712 deletions

3
.clangd Normal file
View File

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

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

4
.gitattributes vendored Normal file
View File

@@ -0,0 +1,4 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.icm filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text

4
.gitignore vendored
View File

@@ -1,3 +1,7 @@
result
result-man
outputs
.direnv
build
.vscode
.cache

View File

@@ -3,45 +3,49 @@ keys: # cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
- &pc age1ffvr5pqd2lfj24e3fh53s92z6h76fda3du4y4k6r3yjumdwvpfgqzj033a
- &vps6 age164tyqklwhdm57tfm5u863mdt2xrzrrzac4py8a0j9y6kzqcjy9zsp073t6
- &vps7 age137x7csalutwvfygvvzpemlsywvdxj3j4z93a50z2sjx03w6zau8q3r5902
- &yoga age1qrea4twxdhd7fnvlq5v45528c90qy6hp2wa55kghsxzgut6n6fxs7w6u42
- &pe age1cahahn9hp265dkhduaec65vugk8fct2vt9ur6y54m4mgmyx4v4fq0etjhv
- &surface age1ck5vzs0xqx0jplmuksrkh45xwmkm2t05m2wyq5k2w2mnkmn79fxs6tvl3l
- &nas age19lhcwk37jmvn6z0v4dpdfh0k4u23f76twdjknc0p7atktf37rd7s4t4wj3
- &xmupc1 age1hnarptkze0ujpp05dqr8uma04cxg9zqcx68qgpks5uf5l6rpk5gqhh8wxg
- &xmupc2 age1l4stuz0vr7gs7pqwjrmezam44702jp2vmqaqyxw0l0r42kf9updq4dfhrw
- &pi3b age1yjgswvexp0x0de0sw4u6hamruzeluxccmx2enxazl6pwhhsr2s9qlxdemq
creation_rules:
- path_regex: secrets/pc\.yaml$
- path_regex: devices/pc/.*$
key_groups:
- age:
- *chn
- *pc
- path_regex: secrets/vps6\.yaml$
- path_regex: devices/vps6/.*$
key_groups:
- age:
- *chn
- *vps6
- path_regex: secrets/vps4\.yaml$
key_groups:
- age:
- *chn
- path_regex: secrets/vps7\.yaml$
- path_regex: devices/vps7/.*$
key_groups:
- age:
- *chn
- *vps7
- path_regex: secrets/nas\.yaml$
- path_regex: devices/nas/.*$
key_groups:
- age:
- *chn
- *nas
- path_regex: secrets/xmupc1\.yaml$
- path_regex: devices/surface/.*$
key_groups:
- age:
- *chn
- path_regex: secrets/yoga\.yaml$
- *surface
- path_regex: devices/xmupc1/.*$
key_groups:
- age:
- *chn
- *yoga
- path_regex: secrets/pe\.yaml$
- *xmupc1
- path_regex: devices/xmupc2/.*$
key_groups:
- age:
- *chn
- *pe
- *xmupc2
- path_regex: devices/pi3b/.*$
key_groups:
- age:
- *chn
- *pi3b

91
devices/nas/default.nix Normal file
View File

@@ -0,0 +1,91 @@
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" = "/";
"/nix/backup" = "/nix/backup";
};
};
};
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.waitDevices = [ "/dev/mapper/root2" ];
};
initrd.sshd.enable = true;
grub.installDevice = "efi";
nixpkgs.march = "silvermont";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel.patches = [ "cjktty" "lantian" ];
networking = { hostname = "nas"; networkd = {}; };
gui.preferred = false;
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
packages.packageSet = "desktop-fat";
services =
{
snapper.enable = true;
fontconfig.enable = true;
samba =
{
enable = true;
hostsAllowed = "192.168. 127.";
shares = { home.path = "/home"; root.path = "/"; };
};
sshd = {};
xray.client.dae.wanInterface = [ "enp3s0" ];
xrdp = { enable = true; hostname = [ "nas.chn.moe" "office.chn.moe" ]; };
groupshare = {};
smartd.enable = true;
beesd.instances =
{
root = { device = "/"; hashTableSizeMB = 4096; threads = 4; };
nix = { device = "/nix"; hashTableSizeMB = 128; };
};
frpClient =
{
enable = true;
serverName = "frp.chn.moe";
user = "nas";
stcp.hpc = { localIp = "hpc.xmu.edu.cn"; localPort = 22; };
};
nginx = { enable = true; applications.webdav.instances."local.webdav.chn.moe" = {}; };
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "xCYRbZEaGloMk7Awr00UR3JcDJy4AzVp4QvGNoyEgFY=";
wireguardIp = "192.168.83.4";
};
};
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
};
}

View File

@@ -1,14 +1,22 @@
xray-client:
uuid: ENC[AES256_GCM,data:97aX07G5FPumdWcDxnYOs6fRgljXWuwyNXGg1d7zdbUUfNnb,iv:+wAC/DZXsg+evYFA4DMfLw5Ut3ExQl1RgZ/2AsNQDpo=,tag:ebD77muITHof+FQMydWobg==,type:str]
nebula:
key: ENC[AES256_GCM,data:zWLXEH628ZVDZk7U/9zEXocJatCJr7hZrCmh/pifPlxVvVud5RQxLvgRvhQ=,iv:YFn7spiIcaW/l8dQZvGhsERi81L2RKLUE/55Bht0TMQ=,tag:fVdIRCMeT6o0lrGVDjCVlA==,type:str]
acme:
cloudflare.ini: ENC[AES256_GCM,data:/LpP1qoVS+CG+5ska6vtmagHNrhcgr5e1QRzDdbdCYGnDB8Nca/GmIogzHCXsogQY/rwGTCZoXLKKEGToYiThwk=,iv:R++I0ued2wrVsmM/vYvBVMOp9M7HyZIfDOVOlg7GALE=,tag:gYchPuh8MHk3EEnGb9g4WA==,type:str]
users:
xll: ENC[AES256_GCM,data:XLSsz6fZ23PPaJS1Y5C3FAOks3wzb2f+Pv8TgyKrDBfMeoLk1M37A00OGJ2wsYxkuR0JV6Uoh+hhRpTUjOQnmLfQrBxPxxP8DA==,iv:jxEZX/flxxduM1sdrYfGHfMtFMYduMg0Lr6hY1pkAPg=,tag:CYy0y1e2S2Txz1OSh+XDHA==,type:str]
zem: ENC[AES256_GCM,data:VCVLfGO9a06XhAOBciFf1u7A5jaQikAt2wZf+dCAi1BglXpM6Hof1yAunadYOwLOBFgGlP19kX53CBBlZtaqZFL2GRDzXP0woQ==,iv:AFYtHCCkzNrllN/fjQ8GKYs2TyV3uj3BsU5n1tBQAmM=,tag:5dP7c5N4yG2NS4T+Vg0Zpg==,type:str]
yjq: ENC[AES256_GCM,data:yn6eGrySCxlRsFioaE2p1qlTHkIGC9l64+edjuDvt232xc+iFeD03EYfuulyr0GxYFwnlAwtaJnyMi5eOrSd1W6HeV3Canzdbw==,iv:qTc6vA8uQza8CB+BvffEN9GqHkiwNM4h9RkqQR14ylk=,tag:UZ2GYCJLjcWLuVXlscLviw==,type:str]
yxy: ENC[AES256_GCM,data:71vjvwr29lfPCarnblpbW3WVyJK8EMV+cR4prc4AM3r0PG4z88P6i0IrzSy8XwkVPrEasfYXxn+vDbzXyi7kIWaWXrkjcyGTxg==,iv:LfkinvbIhchvgfgixIY8Wg6esrc+TOS4YWqRTJ0qfvw=,tag:mLPw6z8DOPrHsRpUHn3/gw==,type:str]
gb: ENC[AES256_GCM,data:jIR3EVdATYUgWmW4J8RdURJRmDBC84t0S/c2EzWwtFMtjgKlqg52fIfQ66i7RnIYRAoF+s4Ex0aLSejWgzQ69NA/AF0AIS7Y/Q==,iv:mvTCTP0E74QlvM8TcY4o49G5kNGs5HFx3YUrj6mCrwM=,tag:LXfIOyAB10XuHA6Cg7LBeQ==,type:str]
frp:
token: ENC[AES256_GCM,data:zYRZoWa3Llv0NiPXtSfhWUn+wt4uIcw8Wa+QBTzn7gLk6UVIA4FD7FLABBKoFbwg62Fo79Nn,iv:YZdOYkJf6BN76Z68nCtetKElJkqKiYmcx6UmLoIXSdo=,tag:5sC2vt3Z21KhgOU9mrfXhg==,type:str]
stcp:
hpc: ENC[AES256_GCM,data:lkpM4nzt8ymQ+5eV,iv:LvSShCSN8w0VsJYjICG9NWCMiw7NSPpoSZ+I2t7uILs=,tag:LLry5z4KpPdnN75x8dANqg==,type:str]
nginx:
detectAuth:
chn: ENC[AES256_GCM,data:44vsExbVhO3gnD4Gme92eQ==,iv:LyDvZebs1sDL1/hZQiZdHoPBm4hXtBy56jR73zSH6Aw=,tag:w5xPHnK9XOSS0+97q8b5gQ==,type:str]
maxmind-license: ENC[AES256_GCM,data:JbAnFQiDcJGwvb89sG2ro77nwwOWcDnqVcA902jwb2zzZci7PpXROw==,iv:eifkWK0oN73Ekn3oWzy6XbYK2GU+4tlnLPJ+96WOWJY=,tag:35ulsshxtUfOsSQOLgAt0g==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:VPlB4wSbWqSYw3rYRwfAMa39xrPcPZfz7sV2Cq3rmOhifnUPwggxnA+51do=,iv:utnyrB6Yfe5O94Oq4HDVFm/lQ9ZBoyvUT68r2G2PdwA=,tag:snm01vA+z2yKK8d2i5i2ig==,type:str]
sops:
kms: []
gcp_kms: []
@@ -33,8 +41,8 @@ sops:
by9Rd0U0bzNiK21BQTNxN1RuQ09DQVkKJmSlzV5ppEkZFljsS17ZWmoI++fz4tJh
kTdoAStG1zsKASHyZTsmdm3RBDO3qV1KhQC2gC7d4EiwNZngxOOZJg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-09-14T11:09:58Z"
mac: ENC[AES256_GCM,data:f6D4N+He7Zz0VA2FxUzTARfckidgVlDHE1hZrYW6jDf+v9ZK/c/JAj12zLNiCy9aG6rBz5K0jdWpnTsguMlTYCKUjLcD8MSW4KJErYmeVFLpfuiSBMr0+pcSVA9DpEmekaYl0GbnxrgQKrfEL0dthR6+9m5CsP/1bvEs34XcKGk=,iv:0YVxL5iVOvmFzThk7fua2Cqpty9lTX/tdKNii5gY/UA=,tag:d+NwYbpeDziniYXwQYVCdg==,type:str]
lastmodified: "2024-03-07T12:35:21Z"
mac: ENC[AES256_GCM,data:bR4PPHaGX6VCRP+Ze96sccnwYxnZkfpmJp6iMBzr+W3JRd0VjTEwTH8aNn1WIsNFXco+BCmwroJR07oKYnbusBYgiEeHnkhXvyAELETs7BitH8JrUtSsGs2wJDfkU9fWf6BNT7oHGpP69Tyrl+8v+Q8jyLV8kW8+c7uJPyT2ACQ=,iv:Hl2eX7TV6lgWjUim0m4r44Ji0c9QDH+qzpDyBOTeVp4=,tag:6xkFMQMwEP7IhpXEB4o+hQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3
version: 3.8.1

BIN
devices/pc/color/TPLCD_161B_Default.icm LFS Executable file

Binary file not shown.

BIN
devices/pc/color/TPLCD_161B_Native.icm LFS Executable file

Binary file not shown.

Binary file not shown.

BIN
devices/pc/color/TPLCD_161B_REC709.icm LFS Executable file

Binary file not shown.

BIN
devices/pc/color/TPLCD_161B_sRGB.icm LFS Executable file

Binary file not shown.

176
devices/pc/default.nix Normal file
View File

@@ -0,0 +1,176 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/E58F-416A" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/066be4fd-8617-4fe1-9654-c133c2996d33"."/" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.auto =
{
"/dev/disk/by-uuid/4c73288c-bcd8-4a7e-b683-693f9eed2d81" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/4be45329-a054-4c20-8965-8c5b7ee6b35d" =
{ mapper = "swap"; ssd = true; before = [ "root" ]; };
};
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = {};
};
grub =
{
# TODO: install windows
# windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
installDevice = "efi";
};
nix =
{
marches =
[
"znver2" "znver3" "znver4"
# FXSR SAHF XSAVE
"sandybridge"
# FXSR PREFETCHW RDRND SAHF
"silvermont"
# FXSR HLE LZCNT PREFETCHW RDRND SAHF XSAVE
"broadwell"
# FXSR HLE LZCNT PREFETCHW RDRND SAHF SGX XSAVE
"skylake"
# AVX-VNNI CLDEMOTE GFNI-SSE HRESET KL LZCNT MOVDIR64B MOVDIRI PCONFIG PREFETCHW PTWRITE RDRND
# SERIALIZE SGX WAITPKG WIDEKL XSAVE XSAVEOPT
"alderlake"
];
remote.master = { enable = true; hosts = [ "xmupc1" "xmupc2" ]; };
};
nixpkgs =
{ march = "znver4"; cuda = { enable = true; capabilities = [ "8.9" ]; forwardCompat = false; }; };
kernel = { varient = "cachyos"; patches = [ "cjktty" "hibernate-progress" ]; };
networking.hostname = "pc";
sysctl.laptop-mode = 5;
};
hardware =
{
cpus = [ "amd" ];
gpu = { type = "amd+nvidia"; prime.busId = { amd = "8:0:0"; nvidia = "1:0:0"; }; dynamicBoost = true; };
legion = {};
};
packages.packageSet = "workstation";
virtualization =
{
waydroid.enable = true;
docker.enable = true;
kvmHost = { enable = true; gui = true; autoSuspend = [ "win10" "hardconnect" ]; };
nspawn = [ "arch" "ubuntu-22.04" "fedora" ];
};
services =
{
snapper.enable = true;
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 = {};
xray.client =
{
dnsmasq.hosts = builtins.listToAttrs (builtins.map
(name: { inherit name; value = "74.211.99.69"; })
[ "mirism.one" "beta.mirism.one" "ng01.mirism.one" "initrd.vps6.chn.moe" ]);
dae.wanInterface = [ "wlp4s0" "enp5s0" ];
};
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
acme.cert."debug.mirism.one" = {};
frpClient =
{
enable = true;
serverName = "frp.chn.moe";
user = "pc";
stcpVisitor."yy.vnc".localPort = 6187;
};
nix-serve = { enable = true; hostname = "nix-store.chn.moe"; };
smartd.enable = true;
misskey.instances.misskey.hostname = "xn--qbtm095lrg0bfka60z.chn.moe";
beesd.instances.root = { device = "/"; hashTableSizeMB = 4096; threads = 4; };
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "l1gFSDCeBxyf/BipXNvoEvVvLqPgdil84nmr5q6+EEw=";
wireguardIp = "192.168.83.3";
};
gamemode = { enable = true; drmDevice = 1; };
slurm = { enable = true; cpu = { cores = 16; threads = 2; }; memoryMB = 90112; gpus."4060" = 1; };
xrdp =
{
enable = true;
hostname = [ "pc.chn.moe" ];
};
};
bugs = [ "xmunet" "backlight" "amdpstate" "suspend-hibernate-no-platform" ];
};
networking.extraHosts = "74.211.99.69 mirism.one beta.mirism.one ng01.mirism.one";
services.colord.enable = true;
virtualisation.virtualbox.host = { enable = true; enableExtensionPack = true; };
specialisation =
{
nvidia.configuration =
{
nixos =
{
hardware.gpu.type = inputs.lib.mkForce "nvidia";
services.gamemode.drmDevice = inputs.lib.mkForce 0;
};
system.nixos.tags = [ "nvidia" ];
};
hybrid-sync.configuration =
{
nixos.hardware.gpu.prime.mode = "sync";
system.nixos.tags = [ "hybrid-sync" ];
};
amd.configuration =
{
nixos.hardware.gpu = { type = inputs.lib.mkForce "amd"; dynamicBoost = inputs.lib.mkForce false; };
boot =
{
extraModprobeConfig =
''
blacklist nouveau
options nouveau modeset=0
'';
blacklistedKernelModules = [ "nvidia" "nvidia_drm" "nvidia_modeset" ];
};
services.udev.extraRules =
''
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
'';
system.nixos.tags = [ "amd" ];
};
};
};
}

View File

@@ -4,25 +4,22 @@ acme:
cloudflare.ini: ENC[AES256_GCM,data:hPNpTclYvRbcbFO6aR9PNyHt3kDUmjeUgg4NPsr+c/yxKPundoiziNYBRfF7/axlw8Hu32jf/cDlcWaEmqCBQJY=,iv:bdGCD/a6AnGQhiFNyZ+fD1f/rILsEcPXC2qRDsAO4n8=,tag:MLZak9uSqsg/0Ldx2Wgb6A==,type:str]
frp:
token: ENC[AES256_GCM,data:0mE8/cWqHKNquCIiqgbjcNhipKk7KEfbZ+qRYbu+iZr7AH9QjfYZQiMJNp4Aa3JWwBLYAnpf,iv:ID4cc8Tn0H9b1CimXlPamMlhlAkafhRApDHo/CCQ4BE=,tag:BUuU/BCj16R7FlKlpubawA==,type:str]
stcp:
yy.vnc: ENC[AES256_GCM,data:IsZWkNGYHrbQcgvOSURDnA==,iv:4XO8RFBdNopLKYxCACmkXLMPu0wIVx64y0C7m2bsTVA=,tag:fMHzU9aQm0bRr8pTKwpuHQ==,type:str]
store:
signingKey: ENC[AES256_GCM,data:TsB1nA0Rf2AsYyH59WpUK53pTCX2JdrGQjkJ9A9BfWLLmw3EMnPoaLHG12rv1R2/xRU7rP+iVhXb77g60I/Kn4ehun3ogMmK1oEAKyQcxudBUJFk+SeijaQLr2A=,iv:e2rdGBVOPS1nyC3pXhs5r0WyEkqxcpCnX3eAcBCj93M=,tag:HwccjH2Wms5/TevU2IuzNw==,type:str]
nginx:
#ENC[AES256_GCM,data:sHSfWhEO9PHWTY0r,iv:XSyOSkzEVOjMF/9vjEVpcuKH6B2mdE5D7l9VKrSILO0=,tag:2YkAoPW5GqOjFpPF5IvApg==,type:comment]
#ENC[AES256_GCM,data:Oaxg1nXYHLNOAF2V8lNF+4OtJz5bXOdEleXi89AW+dQvDgj0HMAAlxLiixlfhFW48Clcu+C+4opFZUk+4Q3GBePTQWeabgEFAZi+MgnVoiXzfizQpmve,iv:/NyV6W0vaXvS5qFKPw+7Iqe9po1VKQDLbHaC9Fa8Mto=,tag:JiCKJxhpAI9k11N9WxfZew==,type:comment]
maxmind-license: ENC[AES256_GCM,data:PVV4VAvB22KoA8EM8Honb+KWYhydXdmTAVlDw/XnTcbaIY+5Km2gGA==,iv:7PfytRbpW4G2iDNqysvZnB0YsQFVUL5Kr1DNsBzuhCA=,tag:z2J14fdD7AUNabN+6kUojA==,type:str]
postgresql:
misskey: ENC[AES256_GCM,data:KiJ2smpRwJ1pzauCgVsmFH4aCiw4sEkCQ9JSTao5NdI=,iv:jIc0a797dokfByN2vJcYcAFfPC8MP7wCV5qsxoCDxcE=,tag:L5n1/xszwB0lhqYcbLqp2Q==,type:str]
huginn: ENC[AES256_GCM,data:Hb3Lkg==,iv:jhYobzvZUhIF4qzD7bzH0M78HtoQiTUuxqULMkk/i1w=,tag:MKqehVphO+jKb1L6E0c6NQ==,type:str]
misskey_misskey: ENC[AES256_GCM,data:MSDbQffk/WjZ6EYiwVuUMdhdv9VE59ZM7t4XldOKRO0=,iv:J/x9t4Pk5zi7Av9fbzxgAbbtbEUZttSx/JGRmmgmvE4=,tag:CwFR9K++T7YqYR932z3IAg==,type:str]
redis:
misskey: ENC[AES256_GCM,data:SAcZsRrhNB+CjpcvUcWLi5nhEA49bFM+HYHEkszNdZs=,iv:fOLletIWzCrhHZrgwl5dpdCnwUbcEeTaKNosXna8pfU=,tag:EpdBW/RexAoJ0z1G2Emvww==,type:str]
meilisearch:
misskey: ENC[AES256_GCM,data:oBYIwQyfPyjsp1dfveVGqO7mY9LO7jaD+Mpe9nTm8Sd8XKgRPJWkce4tnBXBRzkdLURvDDD25uODUekdkkO1gA==,iv:/Gw3PX1w7dWWzEMCWrETGees8CjONwzIpTZSCkQsZXc=,tag:59GHYNPRTv3KFqhpUDXBLg==,type:str]
nebula:
key: ENC[AES256_GCM,data:kNm9hwMa/EhDeOCeZw1jEnroolTkeEeAxpSEDko6tHSDHwHbhfjr01ZzHKE=,iv:q2qCi99XgZJvRuF1dm16sK6BFIoa9QUN8p4LSiZq28o=,tag:ApOKdA91LBiWHv6TuXMkpA==,type:str]
huginn:
invitation_code: ENC[AES256_GCM,data:RVvK+w==,iv:lv/d3J2Ua1CcZiMugsbuHsSKHlXt6t7HmeTB+Szk91U=,tag:n3mgg6FabiLxvMIGeOgHIA==,type:str]
mail:
bot: ENC[AES256_GCM,data:+0C08g==,iv:V5BvmArE5+CkhK+yECLQwV4Nxpd/SiUVLj9iTF+kV0s=,tag:58dXyIZx43FOi51jSpWNkA==,type:str]
misskey-misskey: ENC[AES256_GCM,data:vcvQ/hs/F3BZd1sfvWwfEeB8vVoqdnprxobcmL6xsmg=,iv:S32yrjrjj56HbxTlfFGjOb+sO2M9KKEDEazCrpQWj6Q=,tag:iwnvqwQEdd6jicx9jJBdbg==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:oIpiXJvEoyryS4eEutoe85Af0L5a5iNuOsCWCat9KEhr2ecY/vRimk/1fbA=,iv:dm2hTSNX7Q38yASon5o1jxEJZbWPXUWYydXYMBHF/sE=,tag:yrANhwIF/wHQGHGA1bfPgw==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:fGvNMmqk7Cee28VJ1QoBVrBbgIUbj/F1W0SRjdP8N4K/M8Wx4AVm1kAr0IAhPWyDLXlIjM1NUvuEV5BpYDBdjg==,iv:rFTMJ4x2kgENQUA8ftSaLjdOc25i5mWR3UYbdq54vjs=,tag:6feD0eCSv7bcHWBveLNJwg==,type:str]
nix:
remote: ENC[AES256_GCM,data:uosYkxTCB0wiY+Uufk//OcBZFN3EzbZoQGZ95M9eZMjQ5AobAZqosi4laE+EMcZL1CqYqlWXaSoEUOB8biUaZPseo+1AX1TlmUgZ7QpkfOX0VKZu01C6C+lVyqVqMFq6z1BFyX/oeITMIfnd4a/2KwJCHLAZ4hMkJ5p+aJwByKGa3N/2m41HH/1S3z7pYQWj7YJxunTPPG6WNSiRncQki11rvmddwnXmsBF89+jW1Phge8U295haC57T5oIGPxR645IeTK4ZUlL8eVuZ+BhsnwbkYcaxvjSwe+DOIVPupR8GW+gis7KxwE89kqvnQhinamexcPUz4lGHlqO/Xn6jrJx6T/wXF+19epAzeHapYte3dTWNsdPwPLPJihT16YT5fwrLnH3zq8kexWz1crmnCGUoaBs4S2tHWHLgv2lTv0IHLx5F6ijpDBj/Avg9YILIURzdeea+rBxdycHasUDTVlJtYKRH5J+WbAKWI+oJ5qmXjIRUYL+O9xIUfOGO+1b3xs8MYxRWuvDV2P88N8vN,iv:yQQp5wjbSVn1oia5yL7d6GF9Vo704G0iOQRGMbzQHzg=,tag:bpBag5y5n+7ojOa8QOcDvA==,type:str]
sops:
kms: []
gcp_kms: []
@@ -47,8 +44,8 @@ sops:
OUlxNjdQaXdXMkZ6bnV1ek4yZ2dpbkEKpKGOAxo5Eef2jtGrg4iSzmGCeg+vTgvu
+K8b+O19MIkGMDBm6UbYUPtc/7eqoEZRiTUzNMTmfkLVS4ul5zou9A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-09-16T11:06:32Z"
mac: ENC[AES256_GCM,data:hZCeW25Tp5+f0pdnysxGIYMBDHC+/nFJTBFvWDrL3s86cyjsrQRcEI8levSHAayEL7eFSD7t1syNSmwD13H74xiWwqroQfRKUfURze1mg8GLkT/sBoL8aw2cZdboE5OE8jfQxGYgovZUuBEtfgVCi6QDR+Q21uXtsDhp3MnwOI0=,iv:shA2SmoVv9LqP5fRvCUNq3Ts8gvuAcOyIARwsXhUPKw=,tag:BEOMEzyeuCAZrCRTxxz8Kg==,type:str]
lastmodified: "2024-04-08T08:13:10Z"
mac: ENC[AES256_GCM,data:44e5uZrJ25aRlrSUlbakyWpqhloyGBjJhHXCJBVBJKi0OKn+QPluS0exBvNhTERhFmGk9qHwiIvjbAbplpg+83/IIcXd3NGxekEhwSAXS5Z+AMGIJ4AMet1SSwP6n8fOiI52hCFFRNJj66MyqKXFrNNye4/DF5Bh0dvXQDQbjSQ=,iv:PHpQ/bGrjrBWCj74kKevBlAV08+SAfV9bXJ7hC4lVYc=,tag:ATLe+m8oYKR0im86UekPAA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3
version: 3.8.1

View File

@@ -0,0 +1,24 @@
{
"data": "ENC[AES256_GCM,data:ftogJ/2oPME8sVbyNAuI3t3GEzUmdCadyjf2g/bjGNx3AoV0jU0SDxnBLDFfoR1rEtV00zfgCMPDGsEXavg+QVvoICpvvhckXMOLXe37H3Ff0wDVJtL4BBIK3oVh/SiYaRm/+uR0x6HW37KX50RRvKvpQoRdMVNnvtKbMjmQVIA=,iv:MOHfTIavoU643K10jSR3HruzoofOqqVspYgiaLc294o=,tag:zjDTPKwAOh/nqkquvAQpbw==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5TTB1bHFXcDhoMk1QVzJ0\nUUplcGVBVUhoOEt0Rnc2ZStDUUpjZmV0eGpvCjFQSGl4TjlMT2R5RExNZWxwOUtz\nSWhhSUtFN0JISzJhclpCMFZDQ09jK28KLS0tIGJydDNoY3hBbEhBYUNYZGZCaWpQ\nQnVDalJCcWpIRTdVaWkzeGVNSGpDRWsKWXoMC8NApfenn191aRwdAjD0iM5+C3R6\nXKpHxfhc1Gf6paxBhketFU+AwWsKiBDKh0gntV49F+YSriPa7uI3FA==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1ffvr5pqd2lfj24e3fh53s92z6h76fda3du4y4k6r3yjumdwvpfgqzj033a",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzclYwVjdOZnQ1Y2dlUi9n\naXQya21QVHZ0KzMxTkVuTEJuazB4WklqdFdvCmpMd0h6OXUvZSttOFpmeUdsSlNs\nQkhQaVJqVFdidFNMejljV2h3WUFTaFUKLS0tIGNBemY5R1N3T00zMEthZjBsWXZh\nVXRtNG5UV3I3WG5LYUphNUNyUDI5WXcKVQpMe3zYgzHOtQQvo8Vvz94lYR6TBFuV\nD7ztr4rD/Vdk3hkSGZQvdzGjNDdGpac38LUN9vtFQbzMofykcn/etw==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-02-24T05:48:31Z",
"mac": "ENC[AES256_GCM,data:kCLcS6xeMijD8Bxa0MBUbFH2pdXX6BdGL1SztHHPet8loMkiCfgEiyp9l/QjszWa3G6zx3K+0wXXtRXmrNAxThnIgMZQVGCy4Ucw7fp8Pral/5eaJNlZGb56JQPF9ZDHb9YQPDPImaEAKYUtzayyaZAGJGlCmIIhVVhXTx7iiig=,iv:MXRDA/6YnVUbLdYAIrMvrdb2iPsi4Bmr06SPCU8CCVc=,tag:9hT7Xo0tRnHTgAaivKj4QQ==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.8.1"
}
}

29
devices/pcarm/default.nix Normal file
View File

@@ -0,0 +1,29 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/CE84-E0D8" = "/boot/efi";
btrfs."/dev/disk/by-uuid/61f51d93-d3e5-4028-a903-332fafbfd365" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
};
rollingRootfs = {};
};
grub.installDevice = "efi";
networking = { hostname = "pcarm"; networkd = {}; };
binfmt.enable = false;
nixpkgs.arch = "aarch64";
kernel.varient = "nixos";
};
packages.packageSet = "server";
services.sshd = {};
};
};
}

44
devices/pi3b/default.nix Normal file
View File

@@ -0,0 +1,44 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/ABC6-6B3E" = "/boot/efi";
btrfs."/dev/disk/by-uuid/c459c6c0-23a6-4ef2-945a-0bfafa9a45b6" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
networking = { hostname = "pi3b"; networkd = {}; };
binfmt.enable = false;
nixpkgs.arch = "aarch64";
kernel.varient = "nixos";
};
packages.packageSet = "server";
services =
{
# snapper.enable = true;
sshd = {};
xray.client.dae.wanInterface = [ "enu1u1" ];
fail2ban = {};
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "X5SwWQk3JDT8BDxd04PYXTJi5E20mZKP6PplQ+GDnhI=";
wireguardIp = "192.168.83.8";
};
beesd.instances.root = { device = "/"; hashTableSizeMB = 32; };
};
};
};
}

33
devices/pi3b/secrets.yaml Normal file
View File

@@ -0,0 +1,33 @@
xray-client:
uuid: ENC[AES256_GCM,data:82Xg9VkmkLrKKcZfojA7dHqqMZh45n+eL4T5qZ1z/xy9k0q5,iv:/2j9flBDwjY6JW2mHYo1S2VE+ruu6gxrw8BzSyoiPcc=,tag:iq8wzfIRyq1T18k3vStVGw==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:8whySpY/4WPWx2+t7IOgn+qjKCsv+BgRtaAFLrP8L0fV3TJdLob5vwDplHk=,iv:kXTDwOyJNzbjPtlzQqNsXtuk3EXFdF9CAsYkvImbyDE=,tag:tsK9nCMmwEb0c08rJ3Iwyg==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB6TzU0U2Facm5yWkYrREgw
a1Fxc1MxaHYwRWUzUHpsbDBHYVoxb1NKVDAwCjNuUFlabzJ0aWtGMFBQb05nSlRP
akwrWDI0QnZBYkFmSUpWZFFnYmQ2aDQKLS0tIGlIQ3lTREN4WXgxV3pNdjdaakF6
ZnppV1ZRZzZ5Smt2NGsyRndjTFdnV00KaWVPGLWPnqINH6AHKS/84kuYy/v1v4Tb
QdehcMiq5ZF5XLqOX5sMDLu8h96FIklqOSTZNFkzr+s9VYv/UO58rg==
-----END AGE ENCRYPTED FILE-----
- recipient: age1yjgswvexp0x0de0sw4u6hamruzeluxccmx2enxazl6pwhhsr2s9qlxdemq
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyTEZERkRSZUdSN2dySnlI
aDFjdXFCWnlJZlpYQmR1WEE2RzdCaVp1WFEwCjd1N1ZpMUExZ0ZBWmFwSHg3RUs4
RkRYTjRMWmE5cTA4Z2JJUGgyN05HSmMKLS0tIFpKZmd2Q2k2bnNYK1V2ZnNQNUxH
aDU3Vm95ZkpvSTJDMjJEOFY1ZjhrQlUKLdMYiOj6tlzwLpwZsTQVSQ8hHart0ba3
NS7+SprzJRb0hQXrvyU6s9zho8dPOw8wiGbscmMXSVS/Kar3eQigmg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-03-28T13:31:33Z"
mac: ENC[AES256_GCM,data:fuppF9gFh3O6ZqJRTcVxNqVlz2y5f4xR39JIeInKblh4hNhrdnQg7oh8repoZeXHVRewGeGyxSqzUg+Twy8J+q+d6TSmiDVViD/SHse5rPns2Egt671geF7JmGEB/yKSCbECjGCp0QFgYYEg/vUOaV3v1a0s7LLTE/t2haPIaYc=,iv:f4T7JGxKB3WmEtETuSH7ApKRJ8ptPwZPfspyqc8+vmM=,tag:GF5br+e/p6qHsNCTjfIBCA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

View File

@@ -0,0 +1,62 @@
inputs:
{
imports = inputs.localLib.mkModules [ inputs.topInputs.nixos-hardware.nixosModules.microsoft-surface-pro-intel ];
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/7179-9C69" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/c6d35075-85fe-4129-aaa8-f436ab85ce43"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.auto =
{
"/dev/disk/by-uuid/4f7420f9-ea19-4713-b084-2ac8f0a963ac" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/88bd9d44-928b-40a2-8f3d-6dcd257c4601" =
{ mapper = "swap"; ssd = true; before = [ "root" ]; };
};
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = {};
};
nixpkgs.march = "skylake";
grub.installDevice = "efi";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
kernel.patches = [ "cjktty" "lantian" "surface" ];
networking.hostname = "surface";
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
packages.packageSet = "desktop-fat";
virtualization = { docker.enable = true; waydroid.enable = true; };
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = {};
xray.client.dae.wanInterface = [ "wlp2s0" ];
firewall.trustedInterfaces = [ "virbr0" ];
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "j7qEeODVMH31afKUQAmKRGLuqg8Bxd0dIPbo17LHqAo=";
wireguardIp = "192.168.83.5";
};
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
};
bugs = [ "xmunet" "suspend-hibernate-no-platform" ];
};
boot.kernelParams = [ "intel_iommu=off" ];
environment.systemPackages = with inputs.pkgs; [ maliit-keyboard maliit-framework ];
powerManagement.resumeCommands = ''${inputs.pkgs.systemd}/bin/systemctl restart iptsd'';
};
}

View File

@@ -0,0 +1,33 @@
xray-client:
uuid: ENC[AES256_GCM,data:WEBAH3PQM5ahNpH/kvTtcjcJ2GllmmRlBR2oclG6AimGenSg,iv:TMp0WTOe9fuELSZoVGenl5XSZUFoiYUBEMWMn4NFv1g=,tag:GJTE0EELcZkrnGAKLYer1g==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:P/tyZHaEAahZUBF22dJEZb6mACm/wmUunPDG0vS7SNW3sWbzxRSut0haR/g=,iv:8VMv5iotmDrYDLiszcOvJHkD8l6uE+SboPSILr6KuzU=,tag:U/FIBhvghwDTvFtUWEqr4g==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzV1pvWkVGSFg5TVAvRlhu
TnFnMEszcDRWWHlQanAyRkRpQWdqQkdhTzFvCjBqUG4xNFBiRnlSeTNQSmdkVkdD
UlVCQjRFVExuZHdrSnViajZGZ3c2dWsKLS0tIHlQYU5VeGpEQzllMmxLSnJZZzZx
N1R3Mkhxa0dOVlJiU0V2OEZVVzZVMFkKae3c1axl22uxh9wMygAHs6q1WA5ImOS8
uzKSthWSqtC7DMqgUFaaSjBYM2TN3l402syx71xVFyyAmCcGZbbJcg==
-----END AGE ENCRYPTED FILE-----
- recipient: age1ck5vzs0xqx0jplmuksrkh45xwmkm2t05m2wyq5k2w2mnkmn79fxs6tvl3l
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCSHJVRGIwQUFpVER5SWxq
YjJOT0lXN3dFOFpjMFlWV3JCbmZFN0hnNEJBClpQUEczK2RWTGlVTmJRbVZaUC8y
bEFrL1RjTTNlYVNnRVRBZlRjaTlnUEEKLS0tIE5GM01pTGFFcWVVSWEvUHE3Z08r
a2xybTRFUFZZN20zajZJTVNwVEpGcEEKglmFMk7z1q5IlZ+lZf9M0HtknmvcYt/P
2/z5e8wLN1Hy0Zsbv0yIL/NmqwxAOGJOdzz7ElJszk/Y4kUr9aRasg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-02-16T14:25:17Z"
mac: ENC[AES256_GCM,data:lpZ+Jd5LF35ESBOmOoq7pbNHze7rJiQsiq8cOgf8+cWnAqVh1bccG0cFe7R8uBhmuKIqp7TwkORDFuD+KFCZW14cbR4SP3vndSoYzKxIBdKTObR95w2ETst+prUtQ3fvFeEtlJexeljikfprWf2pGo1OzPophAyocgT31z2iMjs=,iv:Bryz+kqRvXYPj6YuxeDhQfLsgYqHXrA+lHFX18m2GGE=,tag:A7mvmguWoOir2JoIprgL4A==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

84
devices/vps6/default.nix Normal file
View File

@@ -0,0 +1,84 @@
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 = {};
};
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.sshd.enable = true;
networking = { hostname = "vps6"; networkd = {}; };
};
packages.packageSet = "server";
services =
{
snapper.enable = false;
sshd = {};
xray.server = { serverName = "vps6.xserver.chn.moe"; userNumber = 14; };
frpServer = { enable = true; serverName = "frp.chn.moe"; };
nginx =
{
streamProxy.map =
{
"anchor.fm" = { upstream = "anchor.fm:443"; proxyProtocol = false; };
"podcasters.spotify.com" = { upstream = "podcasters.spotify.com:443"; proxyProtocol = false; };
"xlog.chn.moe" = { upstream = "cname.xlog.app:443"; proxyProtocol = false; };
}
// (builtins.listToAttrs (builtins.map
(site: { name = "${site}.chn.moe"; value.upstream.address = "wireguard.pc.chn.moe"; })
[ "nix-store" "xn--qbtm095lrg0bfka60z" ]))
// (builtins.listToAttrs (builtins.map
(site: { name = "${site}.chn.moe"; value.upstream.address = "wireguard.vps7.chn.moe"; })
[
"xn--s8w913fdga" "misskey" "synapse" "syncv3.synapse" "matrix" "syncv3.matrix"
"send" "kkmeeting" "api" "git" "grafana" "vikunja"
]));
applications =
{
element.instances."element.chn.moe" = {};
synapse-admin.instances."synapse-admin.chn.moe" = {};
catalog.enable = true;
blog.enable = true;
main.enable = true;
};
};
coturn = {};
httpua = {};
mirism.enable = true;
fail2ban = {};
wireguard =
{
enable = true;
peers = [ "pc" "nas" "vps7" "surface" "xmupc1" "xmupc2" "pi3b" ];
publicKey = "AVOsYUKQQCvo3ctst3vNi8XSVWo1Wh15066aHh+KpF4=";
wireguardIp = "192.168.83.1";
listenIp = "74.211.99.69";
lighthouse = true;
};
beesd.instances.root = { device = "/"; hashTableSizeMB = 64; };
};
};
};
}

View File

@@ -10,39 +10,30 @@ xray-server:
user1: ENC[AES256_GCM,data:S3IHO9FcVHTJOsRxjSohM9MgnrEwLdDpFU+efLkQaXT2jNJG,iv:KOesvPzjDfm1EDLFiegbk0wgjp7di5mUwUuuY2hwvOQ=,tag:ZsYyUyyEhO5S3weCw/gPMw==,type:str]
#ENC[AES256_GCM,data:OQOPobpbbhajgA==,iv:4jG3bHKzWcR+JnvSlJsc0Qlv5kywqVN5UE96J31CP7Q=,tag:P+jJkRxPu99tLXyO5k6dRA==,type:comment]
user2: ENC[AES256_GCM,data:e7ITe2ZouKr8dXT7SYATyzbzHaVeu6AKt1OcQKk3U0nsQgoa,iv:UbOOuojy6OAFEH8lGhKe5Hs+2K6FX5MZ8Br9AB007gs=,tag:5XeB4YngzTcHZvCpXe/ZXA==,type:str]
#ENC[AES256_GCM,data:vEit6GESM5G+Xw==,iv:A7uisdmzB2qiPeYkut6k8D3xxpVIBy/JE9cctC/cDQQ=,tag:ZY7Ttu5AUqjIxB4BIHEucQ==,type:comment]
user3: ENC[AES256_GCM,data:Q3GlAiELNXurVN3nv5k8Zt1/zqctYb3gvHZ4KnXApCRdShHT,iv:ihJ76k4NcwitdYCS0y4/UlH4K63vwmAY63bCWSi9dkk=,tag:XaH97gpAdaFkUiUTb50aLw==,type:str]
#ENC[AES256_GCM,data:93BxR0AEdQ==,iv:rf69GWpuxYt7fu1Fyv55pynuQDhi+TA5CwZK3cc3yBo=,tag:/hLy6atNMxLw6G3/qgMM4g==,type:comment]
user3: ENC[AES256_GCM,data:r+6jXaIj4HJoYLnJcnjJB+WEZlGaoSy/ktc1Aw77hFtNrrGp,iv:P+YUKns1yaOZokH5WkDB0jssGyHg3ncc54tF1PyA7Oc=,tag:/pxMEr7l4ye5EDAOsllxJA==,type:str]
#ENC[AES256_GCM,data:4gqZh391hg==,iv:No22DrD6EBs2FA4/qH8msWEjs20fc+ZpEeZep+HIv+c=,tag:aHrYNbI83POI4PRj1nd+Yw==,type:comment]
user4: ENC[AES256_GCM,data:ujiml/r4aFiKOkSJkaD/KE8rKuBtLSnpZREBH3vRJUzDT0QM,iv:a3VFlXpMLNFihvFa7gloANtHmBLg4szTL5LTm8E2kNs=,tag:W9KZ1GAVx9IBKfda7Zedng==,type:str]
#ENC[AES256_GCM,data:bnnxo/I=,iv:8jOo0P+8gk05O1vnxOiyGhaeD4wyuaaA3CCr8/DbzII=,tag:J6VSJZoko3EiWyn0ATcmqA==,type:comment]
#ENC[AES256_GCM,data:PTYBkBHs16U=,iv:qr3u7OveM1CmTBIf9gZK4fTRuLCpcZCwf8jmnd1L3Co=,tag:w3O41NG7yCwCVqPGh/6SXA==,type:comment]
user5: ENC[AES256_GCM,data:iDuLRb4dhLUOjpamioMwoTYrn7Cy+Ln4SaedVXkwVD05rjJ0,iv:AqzBBvLpJuIJCUJq0IyDcHrlqb0e84nQC0c94Rj85uw=,tag:0xou1i/iwAxGngO74OIMXg==,type:str]
#ENC[AES256_GCM,data:zsCT,iv:iTPnIsLoQKbmJuyFrf/aCKsiOy/TOrnbpJLu6dWFT4o=,tag:lFybPTAA7EedSsJ5dEfCLg==,type:comment]
user6: ENC[AES256_GCM,data:WLAKPPIHGvZrTaGMLFRQIgEYWFHYy0mD6sLJEYjCD+g93wek,iv:fCOxekJSBczJz/ODYwWgk1CqERc5q/87C+G/9ETuaSI=,tag:rkpBLQoEOPnWuE+U+BnzIQ==,type:str]
#ENC[AES256_GCM,data:D5xiJW0Oyg==,iv:9a/6myiT9Crf/fff6ZkXj/obW2k95cABUNqQdPmcwcc=,tag:chs8BA8YtVkM9m3Ey9ETlA==,type:comment]
user7: ENC[AES256_GCM,data:7rxvmKbtYrDKBlo8kZIfd86KLd9EcSWB0ikasIRqfCZ24W0h,iv:Uplz4fnFymmBVZ9YTniHFFY3EVSrTYsg1+CTFqBu1WY=,tag:l3EPeYRHSeRsCyRhqFRrEg==,type:str]
user6: ENC[AES256_GCM,data:YzLlf37SxKmU1/QA7gUIJsGid3KZNoAGOew8xR7cmw5l8ZmX,iv:SfKubo2jfjtxKn9odDiokMEZyPFfYZ/wwyYtBrgvgmM=,tag:+hxwIU5uBhzQyrKX4r3oiw==,type:str]
#ENC[AES256_GCM,data:8FxApg==,iv:vPa5p3QVHAvw+ECusWGqx1ugTcHh42CVFDQcMhG59wM=,tag:lHiZtydcYFBQiXnWh8pCrw==,type:comment]
user8: ENC[AES256_GCM,data:FNT3hHMwPJu3iI1LuOP1KvsoOonh+J/ecrNrRQO5TpunDPUq,iv:tTEB0MSUmQ39tNq9v1BTfaEcJY7Y59CPHRASMC1a4U8=,tag:klDm6Isk52hG8ubcFu6yHA==,type:str]
user9: ENC[AES256_GCM,data:4BD/4MXAVLhDm3EXdgTiEgPketf0WgflVPGb3/JMWXfycEKY,iv:jwE5sFVxZjORwoqCBdufP2EhetVtFGHyCP58AzJwle0=,tag:OCteA20hDBLI9zt1ET0tUQ==,type:str]
user10: ENC[AES256_GCM,data:d9qxJQH9Jo8gJKUi5jjSdVwqzuHG+dj08Tk+TxhczJmlSaFT,iv:DS+9isZX2B9AYAyV4Yle4fpHzA/SHcR56B/GW8QdALw=,tag:9nUQ0OuMCuXGSZs2kjfnIQ==,type:str]
user11: ENC[AES256_GCM,data:RPIH0DudfPJwPsa0yFLNqUy2EMwQh1bIqkmhCfteVTkUQGWP,iv:NH0aGTZ6nVqz2nn+o1HQS0PKpqHTBMkAhy0oFeyX/8k=,tag:kgd5zkHXW+oxRFC9x2VTUg==,type:str]
user12: ENC[AES256_GCM,data:Q+XcMYPWWeHqXZZt3lf9OurlWwVQGBJWTnRwDUvg7np19g3+,iv:ybREjo5/SFRN5LMSyYdm0ygkYoq/G1uBv9K0iGPqrh4=,tag:g2y8IJeXtHW1XjelOvT+/A==,type:str]
user13: ENC[AES256_GCM,data:IKKk8joJQ5rcSXV84jbYd4uox548czpcgXwTtyK4rFimQIoO,iv:ycVDDSb0qAtZE8WzEdKkaBYKY13JpKj+4xrgkLogikw=,tag:z9ty67NWIgGlh1psbE5qVQ==,type:str]
user14: ENC[AES256_GCM,data:WFhrirjRUEZlOaCLGvHzvRPyp5O+035k0bNFqCvs0UTdT0+y,iv:C2vvOexQwFFkQyvFd8tf7lca2ZZIF3hbSiOHa2RFfGU=,tag:zowYrIut44mRiq6/h0r4fQ==,type:str]
user15: ENC[AES256_GCM,data:Sfc4BWiQ5dz7K0kwlp/1e8x/ahPTnbTvSvFjz9R5KQL52uaO,iv:kzap3jQgm9P22teMkYJHlySh2azLBBuy/kpm+ylxIhM=,tag:2fOBw+McYdT3r+qoF/Wkzw==,type:str]
user16: ENC[AES256_GCM,data:ijz4n66TY2tGpKLvGr7I6n+cOP6BfgpJdHmcPy2oTPGCvhR0,iv:RK8wi3Cj9XFVTqqt00DLru12Hiu/WJU8lV/v9MF5deI=,tag:6SHR8Yb2dO1rRY/xV5u9yw==,type:str]
user17: ENC[AES256_GCM,data:Wz7tWzASeIKE9TzicUIwyOnjZDDICYvDAUu/scHrQoFjoOlE,iv:A2gPFSiIXaf1dQkFlXjw5yesKtv3qOVcIXzM2QspvDk=,tag:JWCVx2FJS84v2iMdzBxhlQ==,type:str]
user18: ENC[AES256_GCM,data:xQMRt+YC1Kn0Qxtis9QVIypq4uHNLq2sWKxxQe515Kfg+zzw,iv:28nQibxqzx5Q17UkEwK0zYhu6mFJ8LUk78xxlQrIqFY=,tag:B7N/fC81v8VBTsDdIZDvDw==,type:str]
user19: ENC[AES256_GCM,data:Qjajmu6cfACT4eho6BK56zRd7BSXxo4fUeJ2RRawopVFZESJ,iv:QZN81pQxspe76V90NQxzsKmMwtvaC1qwuvd5a6WbrdU=,tag:/+LYeQLqvwM60DgIPtZzKA==,type:str]
user20: ENC[AES256_GCM,data:uRSG6jOks7utk2bRdd5sndvqVnSGRhjkts2f3+V7JdEwQf4k,iv:xZdVv/H5RuliwSEWmgLViLquWZ5znGOpP9YwwLJfsyo=,tag:JR3BsCKkHpkE7woTaMHXwQ==,type:str]
user21: ENC[AES256_GCM,data:9cd7IY3zzoziXznclguxbmmZ5hfc2H1DPa+KW1geuybRlpB9,iv:NKwdt7ppRuNpn44f1ypNOoPS27Yqk3Z31ABQbflS9Gg=,tag:S2B1vR0PVd3FYu24XwTfpQ==,type:str]
user22: ENC[AES256_GCM,data:sCOmhXaJjzDIiuwP3Nh+yXQRYCppATzVWIdjOoMOlu+OFT+U,iv:HKRsCLJ/2jr7rGkM04uv4V1GKQheo2oxeFu4zqxcIAc=,tag:1swUo08hSzJ1PmQr/dBcgQ==,type:str]
user23: ENC[AES256_GCM,data:rgS6IdC4DBLvWWBkf5Db54yaNvagfISm5tHUD1KgeqrCR5x/,iv:ANQYEXssMfbU0bvk25dVYq+yQlMiVEyQCwrGPw1AGxc=,tag:d9sOvvxheWwsE/SeOgcWUQ==,type:str]
user24: ENC[AES256_GCM,data:3bn/ZG0En/OgY4PA4Ir8MaVWpJbX+ywpkoXQn7HChT+xhKFZ,iv:Jw8AG7vTc6j4VznekF6x2LXkoSFz960yqsSjPm1ORvw=,tag:EszCODBuLULKHJHh4Itq7A==,type:str]
user25: ENC[AES256_GCM,data:17bfY/7nClQ3c4OL/aNrUIuafPa1RLc9aLZUCyJMhsKp/1ob,iv:s6OD1AipescKuwdTw8x4hQkfHsl01FCh5c20SnpQk0g=,tag:+vlKdXWI6y7fU0AJIHVRJQ==,type:str]
user26: ENC[AES256_GCM,data:ubecAnPqdUhyEWU3vn3cbSFl0Ql/XfUbqWO9553jLqd2DP8R,iv:6GeibZBoBfJHWUjlW/eHbYwj6z9AFXDyom62BCpJp90=,tag:N3Al0SLPbC8lteky+aXNvA==,type:str]
user27: ENC[AES256_GCM,data:KM7HUEUHzXd+g/Vxy13uv+zOXLJ1BtSRPUnFIl2/u+ISu6MW,iv:fAxQRVjPsA3cFV1VLyIYMpG60sxi1pWW7153Cc8zjFM=,tag:HtiU8F5shQrFwonQEgQDiA==,type:str]
user28: ENC[AES256_GCM,data:FWuW6SmdA9l+yhTE7KEec72KZ7Ab0A9jYEWoHcLm1+DPydHk,iv:WipmZE/tZ5yCU+cDfeJCNpKv8o7T/zrcMzYRIVXI7FM=,tag:IDTNiPBGY9lER8fdIfL/6w==,type:str]
user29: ENC[AES256_GCM,data:SSP4igGqVthHTDOxOUodm1KEqPSOikWP/7jFKpYhXGe1wqrF,iv:ri82voK2BEArMlyV9F+NMTXQfV1pakGMoUyKh/LoYN4=,tag:VHZ/3DThAD7NmP3oOGyfcw==,type:str]
user7: ENC[AES256_GCM,data:H/jje9ONEY6XuBXTZmTVGIcWUgGSMf5OB1NNRPtqGCgRP1ei,iv:xew+0BkRqz3nfOoBXTPbBv5hRczy/3tgYSKq432q4iw=,tag:da2ljcffiCVJCsMZaNPZyQ==,type:str]
#ENC[AES256_GCM,data:QdaYYH3RGJ4qIg==,iv:79NBTEKCPtgVVv3G7wg+vdoLOWxc+bdqT1lF4HJpTC8=,tag:8mRFGjy7lBrdyGyX9vaSOQ==,type:comment]
user8: ENC[AES256_GCM,data:H1gPtqF8vryD0rVH7HYzpMuZ3lufOBYczKwaTr4PidQtTyQK,iv:wh7NwFc/1ogNrnTTpm5L9dBqDVkvWiIsJZelR2mtR4Q=,tag:oEFdMFZJ9UYhsSVdefJ4rg==,type:str]
#ENC[AES256_GCM,data:aYWIiLxs1UvupQ==,iv:AisokHuAzD5B6fEF6ak8WfAe151CM3a8MsaWC4uJPnw=,tag:cdk5S4n9ulyWrqsD+jcqYg==,type:comment]
user9: ENC[AES256_GCM,data:HVK9KvGfOcwn1joc3VrkjBjE6hrxQPOBD5RTtQUgBPepToh6,iv:VK9aQ64L/GajpledBxC8PNB1BdNYEqwcdL3GKttgxvs=,tag:O/piztCYBARtAFxTMNXGaA==,type:str]
#ENC[AES256_GCM,data:b839t/OihMOmz0gIcTo43r2MIw==,iv:8kaAFG7DhFOoitcvbFaAvE1NUSLFrFhy1KiMrqs4r/c=,tag:G4vSADa52ZfN5y5ytoFJoQ==,type:comment]
user10: ENC[AES256_GCM,data:xjVkr/wy7OxRuNZKfQagfNxdVxTEyQP1ZhnR6jHy2gjBQ0RD,iv:G6iOBCHOqlvfEENY/ega/TUm81wgT2OOdZKZ6bPfg9o=,tag:p8AMa3bGsIl0hWQ09lSzgA==,type:str]
#ENC[AES256_GCM,data:+s3MMeNU5Q==,iv:CUrg+nNxCpJFbHQmMNXmSE+JcZK6Dfu8cGwtznx3CFY=,tag:G5CYMtao+hz3hs0fPVPmcw==,type:comment]
user11: ENC[AES256_GCM,data:BIZ2zRgGv5/9AexiZZvu+m4A62YUWtAkjWWMu89GteqpWMBq,iv:13IJcDf18LjoxJk7uoKnuFZT6Ihxrxsy7DBaAaiFqus=,tag:RN7wj+uPneCkqNlMRyYrXw==,type:str]
#ENC[AES256_GCM,data:spyQkQIHwg==,iv:7+0DUK95MPH7lpr+GMbbLu4/5yA11/4gTuLhQKlStfE=,tag:G/gIXML8UhYoCi9FfoTvSA==,type:comment]
user12: ENC[AES256_GCM,data:FAF9lXOzXW9CrZgnQ1a2+E8snZj2+JHqP5Gny92k09o/Wzga,iv:/qZuAtFmUQE7A9lMzJUoCvGx+3Sv9Ioh2ahch3puaC4=,tag:urwbLwGkSX3e85NCjyPhhg==,type:str]
#ENC[AES256_GCM,data:HueqiREBet2bxQ==,iv:WCjTAGg2gXgBSvY3zc/YyB/1X0XjvphPduVXLsjOwH8=,tag:wC+On6lyyYQ1Dt/BHDvONw==,type:comment]
user13: ENC[AES256_GCM,data:ExbnvWDIBqga5+k2mpoT8AKBOXAvUNMjBTPXUKrmtWzz4l+L,iv:UI7CvSx2FHYGf6BEHS4e3iwHZZWkl2Zt5xg2WdKbLvY=,tag:ad0c7YW2Bxo+Dn+BoSZ0Ng==,type:str]
#ENC[AES256_GCM,data:R8lN5T0=,iv:FXLf8Vtjg+PkwNhxXWDViMKqwn7tFMaPhio9zhnudZw=,tag:34gxRH+P9lmkUxlOPKcYMg==,type:comment]
user14: ENC[AES256_GCM,data:dgNPPlJD5JOFPbKhlvlRHBLmUNKeDm/JAiawUVpBE7H07Box,iv:w+t9BkqYvlxVKr+x0MwtBz0/YSR/7z1OnZLIoPdW4gc=,tag:CR3GLbaO0jSQgA2HuwzRqg==,type:str]
telegram:
token: ENC[AES256_GCM,data:xsJoGgQ8pLeZqA2alGKkCyrvnjY6rVF5TlXn4GWDrStFBl65XXzwVY/9ZZthYQ==,iv:qTLfpRUyuIGFM668URfknhSRtx3WEHp/WTGzGUPuFd4=,tag:p8mF0tM+t02g7v2EQZN3Vg==,type:str]
chat: ENC[AES256_GCM,data:X1JxFQw0bPCu,iv:hf+TOSH2p9RdnXDFKxTpSRzxDLdJyzNHVV8MfOQuGWY=,tag:iiWw9IFiBGOOyOSl9Jj2wQ==,type:str]
@@ -60,8 +51,8 @@ send:
redis-password: ENC[AES256_GCM,data:6zVKw9AmKwSWvHUZhzy0F2KcJW96uFoZY/N1Zq8ilUJOLZeX,iv:viwLIgJz9v8oadr8784OgETbEsxzGsJvVoxmOwWEFxo=,tag:XEYFnoCGwlnrkqaUbgeH+Q==,type:str]
coturn:
auth-secret: ENC[AES256_GCM,data:50KqO4GQ1ERbCnK4IjYu6aywT+IPMtVlTzh/TE4MwWApU4pO9yqz25ENGUAKRLi4p+Ecug+Rn3InRl1b+q6bAQ==,iv:SgHkHvHg/+yA1Z5E9effgCnZMVXv5amGNUsVKErai54=,tag:PoYLV9Xr0IXXsA39n7wiTQ==,type:str]
nebula:
key: ENC[AES256_GCM,data:1zvyGKsyJESAbf6tUCy6hX93rDXEYNA5QBsqV4Ag4+cksToQ5IubchciQt4=,iv:ZG+pCofTTGx6LcJ05qohotRcX6MK4JsUzL2DfmKE4eI=,tag:o/Vm72d4QbfLXoSVwXZYhw==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:4DKPPqQkjb33rQzFIz863A2arDRQA9AivWFBaWTf0xXDX4hWvJFiIlJQfvE=,iv:0R2TH3CMxHgwVjojzjE2Gnp8SXonmBDLWF7hB33NiX0=,tag:vgtV8JkuCdspleN/SvgIqQ==,type:str]
sops:
kms: []
gcp_kms: []
@@ -86,8 +77,8 @@ sops:
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2023-09-03T08:50:37Z"
mac: ENC[AES256_GCM,data:+w04X4hdgiBO3VpCI5tM2h+X13m3QOQeMdcmKGavqBoC9S+jx9dOoy2H9FdhjyYN/dkhglFqG5LMnHqEsdLGSwSxUsJDmHMm3MvFLJYIybvanNB+Gxb9+ooBNpC/e+d1iLg85mAUTXhLlezw5gaRHtwiQ4llOXZesE+c+Wnbbws=,iv:mM5lw8pFJoqYvz8uIi+oTqJFyIHq6HjspYTaEJp2xzY=,tag:9AqRnzwUxIV/ClJATxz95g==,type:str]
lastmodified: "2024-03-28T10:31:05Z"
mac: ENC[AES256_GCM,data:6Z+ltjbvQaYhDPoiCN7ajQeWcp6vj3TIcUXUm/r/tZU4mIOvfxA7hxW971b76bYPTeVwgp7ZB9qQy9emDHV9i+aSyJpTPKQHRRz5J+T+NJhTP/IL3R3VmG89ssC6NH8FSk0S487JkPd8tNz+G6bvwFCPRxRLNj1pXX0Dp6tgwIw=,iv:xLw2iX1ODAbJCTJ8fEvG7SdZ1GnGwADIckH8DibVM2Y=,tag:TTzlHdcyIQr/92ZHmViRXQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.3
version: 3.8.1

77
devices/vps7/default.nix Normal file
View File

@@ -0,0 +1,77 @@
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 = {};
};
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.sshd.enable = true;
networking = { hostname = "vps7"; networkd = {}; };
gui.preferred = false;
};
packages.packageSet = "desktop";
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = {};
rsshub.enable = true;
wallabag.enable = true;
misskey.instances =
{ misskey.hostname = "xn--s8w913fdga.chn.moe"; misskey-old = { port = 9727; redis.port = 3546; }; };
synapse.instances =
{
synapse.matrixHostname = "synapse.chn.moe";
matrix = { port = 8009; redisPort = 6380; slidingSyncPort = 9001; };
};
xrdp = { enable = true; hostname = [ "vps7.chn.moe" ]; };
vaultwarden.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 1024; };
photoprism.enable = true;
nextcloud.enable = true;
freshrss.enable = true;
send.enable = true;
huginn.enable = true;
fz-new-order = {};
nginx.applications = { kkmeeting.enable = true; webdav.instances."webdav.chn.moe" = {}; };
httpapi.enable = true;
gitea.enable = true;
grafana.enable = true;
fail2ban = {};
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "n056ppNxC9oECcW7wEbALnw8GeW7nrMImtexKWYVUBk=";
wireguardIp = "192.168.83.2";
listenIp = "95.111.228.40";
};
vikunja.enable = true;
chatgpt = {};
};
};
};
}

138
devices/vps7/secrets.yaml Normal file
View File

@@ -0,0 +1,138 @@
acme:
cloudflare.ini: ENC[AES256_GCM,data:PJ3JhdSPCyxzdcRI4UFdESWgyAjIYGyuVaU9l0R3s8mJidtgavvSSMy0hC0G/2fauLB/Eqc3L3NppXFjlKVywVE=,iv:lZVlOf7P/Vs/+u/5YPKFXmdeYV9NP9kcVWd00w1OjB4=,tag:LfWZTvPQH4QPrNrYfZ/Z6Q==,type:str]
nginx:
detectAuth:
chn: ENC[AES256_GCM,data:Gk0TTbnFcsvIgoDcen6B8w==,iv:kvyvygw9zDwaiTQ2vPFTHQex0EWDFg8M8U22AConQFM=,tag:ewAZ/nXxmTOhDAjW/A2OnA==,type:str]
led: ENC[AES256_GCM,data:Owax7cyp,iv:NCEKyicVCYZNgxJzlO90heUmwPjfXbZEcyXX09XQKI4=,tag:WMTCVMVCD9sJgAhRUsqvYg==,type:str]
chat: ENC[AES256_GCM,data:1HJiO1zU5SX4G56oWxv5zqGyUqnBWByrtSnQ01wvmZ7PmRkrV+DV6StMg5DtJR9HhkWYnbXlbnBHzP+poPUMag==,iv:sfwI62nwGSnsdj1RyADWgXvp5AY+9RQdtSooxbKFWTs=,tag:pN/LF0mo7RXWoIPPzzs8qw==,type:str]
maxmind-license: ENC[AES256_GCM,data:9aW4QR3K6S+eTqzIjVlNEwkG0wZ4u5jgRfe7CMwRlJlK4AmcS6c45Q==,iv:cPTN1K4Aag5sohGbCQUZHYTvcwAL7AhF+rrY3OvXGPs=,tag:d9GGUMHnfzRz9Cf2U+dBfw==,type:str]
redis:
rsshub: ENC[AES256_GCM,data:uPnZIjbnRRoWIHlWkZNZkMpIb3Ujnnpb+AisVSVGFv4sfDAuDlAjt39pRdnWkCXJPqtXjJzQ+FeT34cqxTf8Bg==,iv:/jcyAHkxByFnbkmCAYQwda2QRmhW7L/ICoLuCgsVLCI=,tag:M5Q+dh/Bn7FiNpqQGYus4Q==,type:str]
wallabag: ENC[AES256_GCM,data:WkiqS9TOHxYalDp7Ssgg2x7vj4D58psQ5au4a0e3LZBecERwzUKmrhbVKRuDvNTwWbYxSds9SAca0wN+pWmrmA==,iv:QqHlzSXG1I4+p8wd58lcQs8TqAF3foxiYVdgL8L3IpA=,tag:CPtFgIeFL5W25gtd6NFkrg==,type:str]
misskey-misskey: ENC[AES256_GCM,data:OHjt9o+m++NT5aaFbwBT/wSMdUdgf4zscd/JxjCo5HDhC3WeWMJV7z//kATI5Dg4BWAhvPlL02Vrly4RraIzLw==,iv:sQB4/D2SsOuDR3bTrmlNg7o+6ehFznDsqVc3BX9pK20=,tag:tcwTBt/JhyW8ZTAIWIkWBA==,type:str]
misskey-misskey-old: ENC[AES256_GCM,data:amUqMycdXUFvjg66pXKnlZqiESBYMci0k8iYzj824SaEqHl3Nq/I0TjYX++xEUg+RGYyTIcSaj96HUANTKpc1A==,iv:ND1mQLHxltRlOdpJ80ywheGo6hkl7OgRyk9TguJMuTw=,tag:dhCCwnCOnyT2iXdEMK0szg==,type:str]
nextcloud: ENC[AES256_GCM,data:jwN/CqwkU/5Rd6w75/bV2Yej9b0CoxZaiJEcZXFx+9XUPY3Xg1tQdEr1SALG8xzOEdoL6WBVs14NvrrL25GeTQ==,iv:p5+0AB52QqScJwMhNIrM/7HAcRPdD9Z8xV6uwIDOwIg=,tag:f1XbNDDRXvGl/dkV9Wp2Ug==,type:str]
send: ENC[AES256_GCM,data:IGxj3cgp+fQBdupfK+IgPEQSPuXdM9LRSLGSATNIkzUWC6sQw1aaKTDuRc8cU2BG6quthRwuWnK/F7k3KrUi8Q==,iv:LI9MkaF4e47FPUyL7AXZpO+CdgF91ScdiqjrE8PZjJ4=,tag:eNugln5M0AhU1xmVWFN7Aw==,type:str]
mastodon: ENC[AES256_GCM,data:E5aMRzqd1dqcw66uZwWoT+LDH30mg1vZjk3lhKIXKPd36MANE6z04aBPcAHyHT71jEYsect9JXagC4MUJBuSSQ==,iv:4IjTTNSTraL33fInlTkB2ZylcEaaKi5pgvugZIk24e0=,tag:32JSTNpF2cxYh/NEAS6jZQ==,type:str]
synapse-synapse: ENC[AES256_GCM,data:8CVbcN2FG4mRT4PnlOGsS7tDfS+6ojIJFvq2EwItxn1gg2Ghd/Bmx+5tS/Do2FrYp/Xiv1EqucomM50r5bXnmg==,iv:TT7zBKQ4M10XYVCn5aeSu9IqjrIEHHazPUCOTmgRAU0=,tag:0+Q9hZMBVDj1TnHj3xoTBA==,type:str]
synapse-matrix: ENC[AES256_GCM,data:eJ9GXDVLPg1C+Zjpj3NnWUyZxDbOZ61f+gs/bkZgdWjeu61MEMtU/Hh+p/ceAn3y0aPi0ZTcd+zSgIPIkcj+qg==,iv:uTdS4uguNJErc+DDW4H6dsRFkqlkHtaCfR8LR/d9nvY=,tag:UhY9xbe1r7FUpyid2nSt5Q==,type:str]
postgresql:
wallabag: ENC[AES256_GCM,data:ANwvEE3K/W/hU34Y7RvlbUuJNo2bOaRfeusYM9pRxXQOdG4XpwYfd/DprsrVjlkrMFuTurUR5j6UNHWh+ILDbQ==,iv:K8doqhVosz+OosMrLJXrSxairr84EeGs3EWgVQjpkS8=,tag:WjDzy7ubm/GVlBkW0O3znQ==,type:str]
misskey_misskey: ENC[AES256_GCM,data:lRbSz7bbiWEdK/cRD41fLvFJF4WYsclKHVykFcU3LIz9vnKlR3VdczzznVqpT7JvG6OUi+TmipJii+0KzXHtdA==,iv:8sBKgVwuDJdThup0KQ6cnAV5O2liwVra1yIpDHVfpMI=,tag:DyUpaHai8ZUyllvZBUm8sg==,type:str]
misskey_misskey_old: ENC[AES256_GCM,data:Wwtd+hKI0s7m3PbEPHbnSyTsCkW0x8SYHUiCYuNSNCG8i4RAmiAbONNFfWN2hXnmTmRK79Tx/3GR+L0KMzmNGQ==,iv:BekTELToPQXUdZHyNtkuqKyZeez+moI6k907P7NhA3Q=,tag:A5YB0WIa1RkDCtzeBhiuyA==,type:str]
synapse_synapse: ENC[AES256_GCM,data:lzaggyuXM1XwsRxFHslsP89r8wEcgi6LNfbcm+pFWj6WLO8y8WaQIdOkiF3D2ToKDwcw5XgSGSt/VAk6lv+GeA==,iv:8WOL3jze797Wz9kSRq7YpY8OS1TBMqHYhfgZlluJlic=,tag:utNhs1AMbGthp6M2c0x67g==,type:str]
vaultwarden: ENC[AES256_GCM,data:Uz8GJMaLUTQ9pQbZyZLWS4bL5wmt9RvbAwNctAIDt9JrV3FaXxgKjE0MJSGklS55yj/Z/wbO6RCuCK2AWR2VKw==,iv:7hA8YcB88M1qCV8EhFYpHbfPmAZ/7xNqvTMJYZ/UcAY=,tag:mkDHJYmRoYZ/Ct0UmOp9FA==,type:str]
nextcloud: ENC[AES256_GCM,data:5UpYSMsZgUgEJHg0ou9Z1RTE+YFFUKuXwPtc6L5XxD4GNo8Gd3CvcQSNGAol+5DtyPKF3q1+ZgtScWGrqU1RyA==,iv:Zfm+Oa4eON8WiJzYUkMFawafDwo9pOnOpWkwHYLIKkk=,tag:4ECMla1dFfCrn7lILwWFNA==,type:str]
mastodon: ENC[AES256_GCM,data:IQxoNjZILazu5cxkEzFAqqmGSsOffMQHoRB7AC2NqI/+CJSVsfdwiSVfxN+Jc9dmrqCjscUSxaWCMHnrZj/JyQ==,iv:d6tyj/w0uH2E3qHjEcopVhnmE/Pq0qN9PHthSArryyw=,tag:kfJsxqkErFcG11B0CmiIKw==,type:str]
gitea: ENC[AES256_GCM,data:EAuFPlUFvtARh4wbevoIUwZ886nS+3O9Jy7q/SkaTDx7PkQKGhZcPPxY45AG0QQrjSaI3cGLzDBMutFMXP0BMA==,iv:0cLOsopAfyMLHJDowyZirVR5nqLrjSLHYtnPC8GXReE=,tag:BwG5UibGLS16rwJbH/0ZyQ==,type:str]
grafana: ENC[AES256_GCM,data:ZLtDIZ3oKasE4r1WNllNe/rkXxqRS+QAJI7EGPKhiFF1BtAxD46UpGQnUag3yg0gP/8+3COQs6camVSxcKFL1A==,iv:wMj3keVjNpVwNMwlt4E3ds1EYjLNIZ/S3RydhOlmYWU=,tag:ZRn7NWaUPbf2rHYLoLYw+w==,type:str]
akkoma: ENC[AES256_GCM,data:6piRt7BbMBLVGdot+VyoJN3/S8DoPNTYHFh/1coHSLNmiA6kU/6sca4Bts1Up/Vu164oTsFAr1JsKx6tzNzAPg==,iv:qplA1GXHwzVrmjm7eagCk3PFa7DRdwaf+p7N1HLb6mw=,tag:W6WedSK3R1IgZVo/0Hr9vA==,type:str]
synapse_matrix: ENC[AES256_GCM,data:5j+TYJ3vYUqu6CdRDYAT558DsTWbX4Rh+HuukPog5HGXlhneL3RnxVeGBR9CV1rlCP1NY99Nm8roBG+BcyPYHQ==,iv:CboB6lzqxAE/8ZlzaTU3bxw94N6OAhrq8pZ0AfxQiUc=,tag:z6cM3ufgbMn5n5PzgqdRjw==,type:str]
vikunja: ENC[AES256_GCM,data:syb4NYBxL3DdmZmcC+em0klmm6bkkIL/DH/gnzShYRiaezRFskT+yay9govn++SpbuvkoCJq/GYAFxNL+hcVtw==,iv:TQUgdzYQ0gqsAmux9v3BAQFNzHnCTZ+X/OC0b9Bfya8=,tag:b1AsiAW5XzA3DzGdf8J03g==,type:str]
rsshub:
pixiv-refreshtoken: ENC[AES256_GCM,data:EeSOTSAAh+1Dc8+a/AaPJ0aBK5DTa3pdS6DrIMQmRw/n0SRu2QoynIF76w==,iv:dnZxi8jM1I4w3C2duYielpP/8wOAdHDjcqDIrowM0dM=,tag:8irGvLEbRJHV9TB8Jibs9g==,type:str]
youtube-key: ENC[AES256_GCM,data:OEm/ynOUPUq7ZEVzL2jgs9d+utkLTIdNq0MHE0JDujb9ndAwyJJI,iv:RRae6Cg6GdDnXAQOdtBYmcA7ZNuu70VpIg2MEezBn5k=,tag:gX4ZG345cT3Jh3ovUxtLGw==,type:str]
youtube-client-id: ENC[AES256_GCM,data:dPo4+HsfXHdxrgF9F0qJmOGcSHDCn2KIkHx3ZYZU94iv8ImiPI9dTRfoz0zq8UIN7rwIKidQu9GxCRrg9aXk34pc35SXzEh8JQ==,iv:ROVHb0QjVsNae9eJevG6qc5dc4gkrGt+Y7S2QYrzmQ4=,tag:Advoh75OKPC7CnIeL4GFbA==,type:str]
youtube-client-secret: ENC[AES256_GCM,data:c/ALpo/4qJdccMgYiSLg9ZgG7ddaMYxHwJYZ/ogJN2ED21k=,iv:CkrIq+Vpuq28CsRNwdKRLnBq6L8NF37y4xhhnmHQHqQ=,tag:SKtHpm/QZWnGViDtSKlUUQ==,type:str]
youtube-refresh-token: ENC[AES256_GCM,data:pnXQ1euCdix2H7IxudmUUcpxc2OUhciKT8OcGV89c/EpoXHgx1+eLxwY5rRszroWwjge9M001RGHngvD/ny3phfWAwYmIzMJxun2f7JCPe7ybMesWmPSkiqVBss1Zfic1uB8mNM/yw==,iv:8p8/vATY8F3YuGA1TtjekiuaKOMnQyTMjrwDBJaK4VU=,tag:/jVg9FDOuLMNrupgrywpBQ==,type:str]
mail:
bot-encoded: ENC[AES256_GCM,data:HstqDfhKoLqDip9O+mwYGbNlNQ==,iv:CZSTfxJHhI6nG7501cQdJiZ9l3uKS7d5YsA8iVTUuoE=,tag:Rj3rvXJzDp8XzODV/gABog==,type:str]
bot: ENC[AES256_GCM,data:j4Y5oYeVt0sd2z2Qwuqisw==,iv:wasQCTqEMAyttbn1zm9oKck6QiByom+F7ZIMDUse9Gc=,tag:92O4ka6f0I9qnlnVy2dltA==,type:str]
synapse:
synapse:
coturn: ENC[AES256_GCM,data:9MDq0eXLHjJ8Cd2d1iogS1lnjI0A2+0ZK8OtLKRLqT16BVzQQJyhbkAYwkn1+9ppfrazsHFGrk7DVsA7PWjdmA==,iv:SOjwZIyzkMK9Q1fGkmBSr6nSIarNe/WeD91GPJRuZjg=,tag:1GljmXdK80NKTPSg6xJz0A==,type:str]
registration: ENC[AES256_GCM,data:MmRJ3el59XaTwFImuCsiAm2zXeGhgvyUyw9AIv7FvxR4N3YWnHKALcQJtG52N4bmLXU=,iv:vm2R7XGzGET0eTcD2trl3xD2I09NzYmx5NPIY4KK4xM=,tag:exm8/ehPufeqtp6j61ap0Q==,type:str]
macaroon: ENC[AES256_GCM,data:2/8GuF/a+ocVtLN0PU17JDvXw/RoXX/CXFHPlI9THl5bY8lBm6tEawijnOKVoFLovfU=,iv:GPAr3ZjqLf9ixevsZoQgs4cPkv0VL4WJoFfQZOdThlw=,tag:HRt/igDEfUJ3K39mG7b9Fg==,type:str]
form: ENC[AES256_GCM,data:Z9cYL9ibRWmOhAYtB269n0cWZSvL4zGgc03ZRag0m8cz2j0god/Fn/w6kx3cyGK1C70=,iv:Yst6WSV63IvbMF5nnicIoBj77eSwVMnAHtHrKo2UcDk=,tag:4qf6F2rdctcCf4J9vECvYg==,type:str]
signing-key: ENC[AES256_GCM,data:BbPJiNcVTqMAL2XG3K3CIbsb8EM4r8ct/WxPK10FHRwAnqChKy3CAviYU9gewO/tNZXHvUYUAUbPww==,iv:IZB/40EE3DIxAqagdH/a4kcSmiec5l24XLCQKCQNaRo=,tag:/1t0WAPBYmYrPTx4V4wgkw==,type:str]
sliding-sync: ENC[AES256_GCM,data:POXExkTRRhXin4lD4MA61xsuzYXCT6U7QtQWtNnEb6kUWRrAvS9mqk+JTBn3onCzf2Azhi3WQOY/t+OiQFXI1w==,iv:GJfJSGb6t/q9KdVCr0dVVcD+e0yZUQzrJrtuhOlYJIE=,tag:ovd1ZXRkk7VoNo8KoYDViA==,type:str]
matrix:
coturn: ENC[AES256_GCM,data:MwZKkYMefshuk46Cne4wn9ooFH8RCDbrxp+MbLJWli9iPHuzJJzUuQNU9EDL0aNbzyYEMt/7DErw42z6KrpGww==,iv:u/SVVTgfJO2FakiYU+uLHXjA4tHU/W6ASsR3S31+pWs=,tag:VTeKNOKwm2bsiZAOVXeBOQ==,type:str]
registration: ENC[AES256_GCM,data:+pA61vTg12lYUyXjLrHSY7y/ExfTQffLlGUI4HBOSFFPTck7bu68FrCaHOIBTtEMfjU=,iv:Ex/phkBZxglG8HiRz+m7h2HNanpq2Pxwbm08vdM3xFc=,tag:mM3YEa70FnCeYIUthK4TeA==,type:str]
macaroon: ENC[AES256_GCM,data:/+RaayKiPPpVV7OWWdaSkSSRHMjb8d58lZcpvltN9cYkN1btvMViEgdLSlfqzRRlPUE=,iv:pg9GXgNsrVWKlUAiCKZ2pYXugRH6MsBIMpHKoYWYLik=,tag:/mj5Ak7XAX/FH7sNPEVALw==,type:str]
form: ENC[AES256_GCM,data:7HF7HMUH1BTJgXXP6cpUiVj0jCwGW57bx9wKTJu7PnRsNuAam/+nKX7Zfg7WD+gSBlA=,iv:SYeUsuFVgAA6U6STCtKT5c5E8Kglh3x7hy6+Op4n0W8=,tag:eICmHTwwn0KcgNhdDGnusA==,type:str]
signing-key: ENC[AES256_GCM,data:hzxxDbGp1L09O7+ueUSa5lJOY/QvF2zvHdpueEHjaPQEToQt9mr2loeTQHC7ObTegfLb9UHrI1jn4A==,iv:KngfahwYZZmDQ5LeOUPWptTMGAC8TZm1G0FWcrwCwsw=,tag:U9pW6/boBIpiswn67Ezrfw==,type:str]
sliding-sync: ENC[AES256_GCM,data:BeA6g98IWDP6hnLFI77QqG6esDwB6j3OPzAv3eJxWoTajAsByHSgSYP1vHN5Iok6IgvSSmkf0/HiOJy1Ca8IIA==,iv:ca+t/rYwc/fAVUcz0JTmrRQCOcbDNscbnE8BpHkx/OE=,tag:eEfhUChUt4kRnO82XqRY4g==,type:str]
vaultwarden:
admin_token: ENC[AES256_GCM,data:muavuOY88Lm4rSEoCp4IIPp7Z+sqf36VwpnPgf+K6IwwFkUgYM1GO80ogReYWqqUM6ij1Yzl5D9ncUbq+aGTKQ==,iv:jA4MRJlz71CMmPnWjb2tGbbIoMkEsESUowhXDckKKMI=,tag:l0HaJmnU29YeFUxjOgN3Kg==,type:str]
mariadb:
photoprism: ENC[AES256_GCM,data:TF1SZVFnvzyE+7vrHYYUS4Juqhbiw9QcJx7p3Xj88xyBFcTqS1YjzAKs/9GQ1PuzdBrt6hXm/XtJILHiuktnSg==,iv:sd9sQEuIePL6LzUYbFtmdecJ57sMrkF0coalBf8KFqQ=,tag:P/knaKYTJ+aXu4l6IixISA==,type:str]
freshrss: ENC[AES256_GCM,data:ydqCbj3UbsLC1e++p5ixb5Kpmk2BsYd0urcfw8T51Is5N1/gQ7P0zgR33AOteAxw2oj85WQZhxu3eAN7BCXV5A==,iv:1oiMo1wwFNXiTZLsf4UPZSJfKFIWLI3h947TC06CVy4=,tag:Otq1oeKBnWXhqNilfsywPQ==,type:str]
huginn: ENC[AES256_GCM,data:1Tdg1WDwGgFSXdChgif8knWS24BIFYnmaiSjJXxs5uj/v/5fJ1alb4K4XHW/kFRjQbuAOFfJiJ9ogJ1KAyk17A==,iv:qLMaQpVaKrjP7g2lWzhaNLghxwiV4YJmyYY1hrpu5I8=,tag:566JCENvOxgwD7tM3aQBiw==,type:str]
photoprism:
adminPassword: ENC[AES256_GCM,data:gB81joOfS8h05BNy2YmD/N0cpLPa/vAduDcQBeHiY/WkcnvqSXnXsOfnvbP74KQfoP4W35oFkfyGVPUBSB83tg==,iv:AkN2NoqMXVHQA9fHTTR7xbEapEqy/D61mHn7O23hyYk=,tag:WV+siDA3VnRkOYnP4Z9Qhw==,type:str]
nextcloud:
admin: ENC[AES256_GCM,data:1rglLrLtRf3yXQwfHDMZLewk8ueIbMFOC+1mtoAyLKnDmcQAoEQZ1vHw/hpKkFXJQ+QyX3sP8eUjRXuBEIVl3A==,iv:lfEGPEw9ybSdOYLDdaGCLXKgCvgRxn3k9eIy2DJHDYU=,tag:j4qRexbEAgK5HAGhr/wxfA==,type:str]
freshrss:
chn: ENC[AES256_GCM,data:XGcgfuRozJ/xowtmFPSW,iv:yZ9LTuVE8dGyrtE3vxLA2jLErvmt67XC0jefl1njiOM=,tag:J5d+oGFWhfXEFwVOnsJ2iA==,type:str]
huginn:
invitationCode: ENC[AES256_GCM,data:+m2AabRzUiCFy3MAKTB8d1IE05WHTcmZ,iv:ccdIPHl9N+bvPR/QCwZUwZOfWTeW6gWhhBjOpL85JRg=,tag:Ir2085K04XUGkAuoCG+7VQ==,type:str]
fz-new-order:
manager: ENC[AES256_GCM,data:qZc5U3SZQPWzcKVjN2+A2qWNae4GItcjvEQFgkThvIQ=,iv:fJpiUlViiUg1ea/zGhgedQG7TeTbeb9dPviYoiUBLqI=,tag:6T7rgJflsjgK++28SgsLtg==,type:str]
token: ENC[AES256_GCM,data:qhwWRflJbW1QMOhiPfbTIrEdQJyVtfZ1QycCgstdKD1Nh40=,iv:GvZ8MJig64l34jkvuJbMMjyNaPT5yz0/pFCc6KEPTvA=,tag:cMXo/6F9thl8k2iAhT507Q==,type:str]
uids:
#ENC[AES256_GCM,data:WJszzA==,iv:KvyEnUu69+L5ZxNbRmjtP2R+8lHKgdlMN0WuvDbYgE4=,tag:LP2FJ2HXWZJmTdvXpHflVQ==,type:comment]
user0: ENC[AES256_GCM,data:Qw18Ht6qXo3n7DD9NgNB+3IRbCmKuvJQiK5UBsg/FC8=,iv:TeeTcR0tnRrniySqKrsKfOfr2JO7+kqS3iETdCFX5ZA=,tag:rRo2yNku9JWxmILWBS/Wyw==,type:str]
#ENC[AES256_GCM,data:O3DOE3jFCg==,iv:9shUoHCLXsJPKHELlyWdreouEcyOqhsfVI2KaqwC4CU=,tag:tYKVv+/DuesSijZwWGdrig==,type:comment]
user1: ENC[AES256_GCM,data:vY4qTPNqdFp2H348jAgvwKktywdVVvQK/lR2NgRE4Ho=,iv:DrweeSEJ5ETomIkRtkcVboiQindzBoxvxjlSmrQIfI8=,tag:sMz1ITHkDclBc4OY91dMGg==,type:str]
#ENC[AES256_GCM,data:yeA9zF8Tug==,iv:VZuWLZnt1RBmkBWudKVvgJkYfqxIj/umEHVCfR6IG3k=,tag:1kj7HyjVT59n05VYJ1uP+w==,type:comment]
user2: ENC[AES256_GCM,data:7hlq1FEauGcKkStREDbxA3tOA5NmFo9AbXiOPUt+kZ4=,iv:urOP3ENSviWRKDIWGc1P5PkEtkoBSCSYlgGqJQznp8s=,tag:NNKCW5bFPY7t/PC7dsSJwg==,type:str]
#ENC[AES256_GCM,data:4G7DyLVVgQ==,iv:Ht/exln1QtL2BxjCaOTIXHRPDiSFYP4zIa7VaeMCuhE=,tag:btVLXf+WS/YgzRFbVFoAfQ==,type:comment]
user3: ENC[AES256_GCM,data:nBTbmp9OP14ayVBz1UGC5g76txfUwxL2NPQCKGxsQyw=,iv:2B8ISdT+8WpfeiU9peKoMlpwcRoGZVh11VyAnS9IKP4=,tag:uBMxqrPlb6TaftnAMqodKw==,type:str]
#ENC[AES256_GCM,data:TGrZBuCRgQ==,iv:9IOJ3Bkw9udS/y93TTtZ9o79aDq3Bb+DMEogJG77iqA=,tag:S/XcPX1f89IyfZnMoR9s/A==,type:comment]
user4: ENC[AES256_GCM,data:LVendDEBlPUCkXPfgbYf2X0EgJsAdLKjAudXeAgy2Is=,iv:bR0emkQa6OHUP1ucgAvJU0eEop0gp+3rwDB5XJhh4+s=,tag:YZsW9Yyr+ey9AbTO3ucWDg==,type:str]
#ENC[AES256_GCM,data:b4iJ73sUoQ==,iv:A2hmi7lCR15E5jVR8E71GQuHgF4TdjDuQadXOtBon6k=,tag:eopTJdjN16u7PtpZdhKymQ==,type:comment]
user5: ENC[AES256_GCM,data:wG4awLnfB4B0qLWG6Aj+OslLMnViPjIzicfB4ZzkZPA=,iv:b9C1IDmZTMV0RYXqkM/Y3khZeSQEOISrQyPjhQe3WKM=,tag:cRMtLNU6TCwTQG4UVhvTng==,type:str]
config0:
username: ENC[AES256_GCM,data:p8+q8u1A,iv:9s52kS5yLB4vQuGVXNtA4amZqT3eHTTybsbsQZRiFnk=,tag:7SA4SEzMHpP9H/rwoE+UJQ==,type:str]
password: ENC[AES256_GCM,data:58+gFodT,iv:ohZlT1BwnzCYv84xHgFsLRkiPMpE8lB8QVHwr0QtDWc=,tag:XF047RnXs6IbKsTnsm0D6g==,type:str]
comment: ENC[AES256_GCM,data:T4XcbF1c,iv:hHdsMjU8rzPiduhT05v98pgDqxRW/Km5zmXCEZaT2AI=,tag:LWvwIEfbW2IuDELr4fEXKg==,type:str]
config1:
username: ENC[AES256_GCM,data:xWP1cesh,iv:11KFZ/J9PScz/oW2+H5BWgw0+ETkCXlcYOMuPpgjEs0=,tag:HswEVzm6ElRjIDsZyEfZcA==,type:str]
password: ENC[AES256_GCM,data:Da/E7ZeZ,iv:gIoheXeTErV3+CtZSEDsX7pGzRahHWlKYQ6QZ6W2eu8=,tag:0oQzQ5DJiS2hqMQfU6JRWw==,type:str]
comment: ENC[AES256_GCM,data:etfZKwbh,iv:XqqF3D0PpCPd2Q/CCu/PAH4SrvXAOu+lIXvSht/KfKk=,tag:7jyG33foxneRK2wvI/5uBg==,type:str]
httpapi:
token: ENC[AES256_GCM,data:fuGJ+5sKr3yob7JbyqtwGBAxnDzxTvoC5XPWHNawOjqC7Ydz6HujpYudG2CUMxt+rA==,iv:Yhg5NqRRp+PYsxNKFUiUydAL1hmz2pr/T0f5GDKV18w=,tag:SZoy0gTzpeq39mEFBTUDLA==,type:str]
gitlab:
secret: ENC[AES256_GCM,data:hBax7ClSuttBacykKw42pvrvowZW8OeTry/0rkmy5BHyLM7HllNYCOw+tupIOdhVEfgJPWQeBeGuyFHt7lPRWQ==,iv:zOM+eMW04Z9QkTchkAXWYHg2eWTQmGEs/dHtUnvNVd8=,tag:RzLyecuASl9CcmQSuabN6w==,type:str]
otp: ENC[AES256_GCM,data:Hgq5Tyq+BUTsexVsjFWf07fY0znPL50+qIm+fhuVljlauXBZouQjJKMhqTs9zhLECOktYUtp0wrNa++nO1Ys9A==,iv:Am51j8QjDtldtsZL8uCu0I3pr/SQ6R8KUQinznZjClg=,tag:hbtrlG0MGNL3VcbQUG/irQ==,type:str]
dbFile: ENC[AES256_GCM,data:AKxE/Z4jooDlkIl3WpQZIlN+MLxlZ7SEWVF12/8f9aq7LtVl5B0RDA6bZbeM0PU8h4eGcSX9feSpLIVpvBAQxQ==,iv:li6hBLw9filwVVXa01oICtvY9UJsMgB+3XYOgZyCTnY=,tag:wC18TzVMM+dcpIi8wwCcIw==,type:str]
root: ENC[AES256_GCM,data:nPO4MT7BWuCHnWkbHPRYygMpieGsni4+BQs6HVwxBqH5KuD0O7I3PQlcgntxb4kWbqvyWstYW+k9LdscSEzgXg==,iv:fgfW8BljGlOIQzGK+UiEFcT6Hp5ieA8C86kwT8xRlO4=,tag:eSWPda0NYBe47uVYCOUiLg==,type:str]
grafana:
secret: ENC[AES256_GCM,data:QYhopqGcHGr+24qYlfaTdMtnyzmIZYG4PcvS9KYqC24W3M+HmloCkPHh7Y3ZTVg8MnrDGOcbA9YPLdY7eh/u4g==,iv:dh7egVIem2bgDbmWJ1sqH9fLdIYbAIQjnjNvyuEjVq0=,tag:DbIRVHbCcpKGcNc6sDTasA==,type:str]
chn: ENC[AES256_GCM,data:0bbjggWS1MdcUIQiQyPlBTULm+faKDpJbmZmV6vSw8k=,iv:am65WQzUE+AvQrQV+NSF5u6RCWn7EetyPsdy4Cuvyyw=,tag:lxNUM1cIYVSXVgwEnS1Hdw==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:TS+toaJRgAvC78XVwTciXe2IG8++vaqXVCi/u/8Aej6qq1B9Cb6f20cp5K0=,iv:T/NkLvcYiWzIDG3jWtuhe/sH2GT4z5f0xdUGbSL901I=,tag:qN7YokFBj3Kbbx4ijHTRnw==,type:str]
vikunja:
jwtsecret: ENC[AES256_GCM,data:p6e22qPJzTGB21oWhSr8AA4bfrele9ZOHVtZ8BHgX21IhoKdm58coGtSX1CGXR7J6+1/74RdLY9K88nGrM1F1w==,iv:DGUO8rhf7Lg9dTqSmzlR/Jd2K4oUjO8w9E5bihwsykI=,tag:SpX6UI0QIju/tC1fIL9CCg==,type:str]
chatgpt:
key: ENC[AES256_GCM,data:bkLxKUqkjwpUeqeAZCaAgKiOse8QtZ0zOn9TQNA84+B3rxNiTFPisI8=,iv:Zd5dO5Sdt4HCvNZgS2K0FjJAzti6oE22vahYQl99TrI=,tag:E3o+X84tRsIEGU9Jfb85JQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWb0FWUkoxeWZ4K1lOb2k5
cUZXQktjSTY3djFZOEJyL1dWd0dmWHV4Y3dzClMvSWNiNk9YSzFoRmhQSG9wb1NG
ejRUeStyKy9qYWFwWHJraXFWREdhZFkKLS0tIExMb3VCWm13ZkJ3UXcrM3IrRGQv
ZjhMWlAyRUpUYkVjb2lidHZPNkg4SUEKctTzocxhVXJ56sHH4BO6QkS5Rn9k/y2U
IrZHT9b3nyyyZxhctOArjBXohwt1asNeAe7qsTypTtAMgKTRwggX9Q==
-----END AGE ENCRYPTED FILE-----
- recipient: age137x7csalutwvfygvvzpemlsywvdxj3j4z93a50z2sjx03w6zau8q3r5902
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB1Vi8vRTFFTW5tNW9OdnNQ
MEpxeXY5MnRzTE9GUkRLMVl1cTRBcU1FSmhnCkdmY3RCcy9oS2lZOVJ0Ni9RL041
UWo0TkxMblRqSkZoaDVYZm9xRFBCeDgKLS0tIEFVVkl0bUdoN3FVcThVRHpmVEJk
SnFHS1Z0SXUzTFdEd29KTy9DU3Y3R0UKfhh+rUmWDrf+UGjclP57dHipPLFoXSqy
HdelmfV6q4/c7ppx2E+oZw3VNgoZCsrxxzYZfwxHJiZb+5vkE0D8iA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-04-08T08:12:57Z"
mac: ENC[AES256_GCM,data:o+T7o5Z/8JIoS/a3iqFe8CphZzwgQl3RlalGMFE9YEprLUuXLwL4IioU7Q1WKHTS+ih1Q1oCye/7363njewo+8PZq+BbJXOP+cSpoSUflsfyGymxgdQk2vo308TTvCXuHJobVqtxPd2QLUzvCpEXuatUWmxbmJNpSFO+kEvM3qU=,iv:YUUST05szM5BII4SaO8vRm7prS5L5MJJJuecRL5sLUM=,tag:K0NRXtDcn2poi5I7QCl50w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

278
devices/xmupc1/README.md Normal file
View File

@@ -0,0 +1,278 @@
# 硬件
* CPU16 核 32 线程。
* 内存96 G。
* 显卡:
* 409024 G 显存。
* 309024 G 显存。
* 2080Ti: 12 G 显存。
* 硬盘2 T。
# 队列系统SLURM
## 基本概念
SLURM 是一个用来对任务排队的系统,轮到某个任务时,再调用其它程序来执行这个任务。
## 常用命令
提交一个 VASP GPU 任务的例子:
```bash
sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" vasp-nvidia-640
```
* `--gpus` 指定使用GPU 的情况:
* 要占用任意一个 GPU排到这个任务时哪个空闲就使用哪个`--gpus=1`。要占用任意两个就写 `--gpus=2`,以此类推。
但一般来说,**单个任务不要占用超过一个 GPU**,多个显卡的速度会比单个更慢。
* 要指定具体使用哪个 GPU 时,写 `--gpus=4090:1`。2080 Ti 需要写为 `2080_ti`P5000 需要写为 `p5000`
* 当需要使用多个不同类型的显卡(例如,指定使用一个 3090 和一个 4090`--gres=gpu:3090:1,gpu:4090:1`
* `--ntasks-per-gpu=1` 对于 VASP 来说一定要写。
* `--job-name=xxx` 指定任务的名字。可以简写为 `-J`。也可以不指定。
* 默认情况下,一个 task 会搭配分配一个 CPU 核(一个线程),一般已经够用。如果一定要修改,用 `--cpus-per-task`
* `vasp-nvidia-640` 指调用 std 版本,要使用 gam 或 ncl 版本时,写为例如 `vasp-nvidia-640-gam`
提交一个 VASP CPU 任务的例子:
```bash
sbatch --ntasks=4 --cpus-per-task=4 --hint=nomultithread --job-name="my great job" vasp-intel-640
```
* `--ntasks=4 --cpus-per-task=4` 指定使用占用多少核。
* CPU 的调度是个非常复杂的问题,而且 slurm 和 Intel MPI 之间的兼容性也不算好,因此**推荐照抄下面的设置**。
也可以自己测试一下怎样分配更好,但不要随意地设置。不同的设置会成倍地影响性能。
* 对于 xmupc1`--ntasks=3 --cpus-per-task=4`
* 对于 xmupc2`--ntasks=4 --cpus-per-task=10`
* `--hint=nomultithread` 记得写。
* `--job-name=xxx` 指定任务的名字。可以简写为 `-J`。也可以不指定。
* `vasp-intel-640` 指调用 std 版本,要使用 gam 或 ncl 版本时,写为例如 `vasp-intel-640-gam`
要把其它程序提交到队列里,也是类似的写法。请自行举一反三。
要列出已经提交(包括已经完成、取消、失败)的任务:
```bash
squeue -t all -l
```
取消一个任务:
```bash
# 按任务的 id 取消
scancel 114514
# 按任务的名字取消
scancel -n my_great_job
# 取消一个用户的所有任务
scancel -u chn
```
要将自己已经提交的一个任务优先级提到最高(相应降低其它任务的优先级,使得总体来说不影响别人的任务):
```bash
scontrol top 114514
```
要显示一个任务的详细信息(不包括服务器重启之前算过的任务):
```bash
scontrol show job 114514
```
要显示一个任务的详细信息(包括服务器重启之前算过的任务):
```bash
sacct --units M --format=ALL -j 114514 | bat -S
```
## `sbatch` 的更多参数
```bash
# 提交一个新任务,但是礼让后面的任务(推迟到指定时间再开始排队)
--begin=16:00 --begin=now+1hour
# 指定工作目录
--chdir=/path/to/your/workdir
# 指定备注
--comment="my great job"
# 指定任务的 ddl算不完就杀掉
--deadline=now+1hour
# 标准错误输出写到别的文件里
--error=error.log
# 将一些环境变量传递给任务(=ALL是默认行为
--export=ALL,MY_ENV_VAR=my_value
# 不传递现在的环境变量
--export=NONE
# 打开一个文件作为标准输入
--input=
# 发生一些事件(任务完成等)时发邮件
--mail-type=NONE,BEGIN,END,FAIL,REQUEUE,ALL --mail-user=chn@chn.moe
# 要求分配内存(不会真的限制内存使用,只是在分配资源时会考虑)
--mem=20G --mem-per-cpu --mem-per-gpu
# 输出文件是否覆盖
--open-mode={append|truncate}
# 指定输出文件
-o, --output=<filename_pattern>
# 不排队,直接跑(超额分配)
-s, --oversubscribe
# 包裹一个二进制程序
--wrap=
```
# 支持的连接协议
## SSH
ssh 就是 putty winscp 之类的工具使用的那个协议。
* 地址xmupc1.chn.moe
* 端口6007
* 用户名:自己名字的拼音首字母
* 可以用密码登陆,也可以用证书登陆。
从一台服务器登陆到其它服务器,只需要使用 `ssh`` 命令:
```bash
ssh jykang
ssh xmupc1
ssh xmupc2
ssh user@host
```
直接从另外一台服务器下载文件,可以使用 `rsync` 命令:
```bash
rsync -avzP jykang:/path/to/remote/directory_or_file /path/to/local/directory
```
将另外一个服务器的某个目录挂载到这个服务器,可以使用 `sshfs` 命令:
```bash
sshfs jykang:/path/to/remote/directory /path/to/local/directory
```
用完之后记得卸载(不卸载也不会有什么后果,只是怕之后忘记了以为这是本地的目录,以及如果网络不稳定的话,运行在这里的软件可能会卡住):
```bash
umount /path/to/local/directory
```
如果不喜欢敲命令来挂载/卸载远程目录,也可以 RDP 登陆后用 dolphin。
## RDP
就是 windows 那个远程桌面。
* 地址xmupc1.chn.moe
* 用户名:自己名字的拼音首字母
* 密码和 ssh 一样(使用同样的验证机制)。
RDP 暂时没有硬件加速(主要是毛玻璃之类的特效会有点卡)。
记得在连接时点击“显示选项”将“体验”中的连接速度改为“LAN10 Mbps 或更高)”,不然会很卡。
## samba
samba 就是 windows 共享文件夹的那个协议。
* 地址xmupc1.chn.moe
* 用户名:自己名字的拼音首字母
* 初始密码和 ssh 一样,你可以自己修改密码(使用 `smbpasswd` 命令。samba 的密码和 ssh/rdp 的密码是分开的,它们使用不同的验证机制。
在 windows 上,可以直接在资源管理器中输入 `\\xmupc1.chn.moe` 访问。
也可以将它作为一个网络驱动器添加(地址同样是 `\\xmupc1.chn.moe`)。
# 计算软件
## VASP
VASP 有很多很多个版本,具体来说:
* VASP 多个版本可以共存。目前安装了两个版本6.3.1 和 6.4.0。
* VASP 可以用不同的编译器编译。目前安装的有nvidia、gnu、intel 和 amd。nvidia 使用 GPU 计算,其它的只能用 CPU 计算。
* VASP 的 std/gam/ncl 版本有一点区别,一般用 std只有一个 gamma 点的时候用 gam 会快一点,系统中存在方向不平行的磁矩时必须用 ncl。
* 无论哪个版本,都集成了下面这些补丁:
* HDF5用于生成 hdf5 格式的输出文件。
* wannier90我也不知道干啥的随手加上的。
* OPTCELL如果存在一个 `OPTCELL` 文件VASP 会据此决定弛豫时仅优化哪几个晶胞参数。
* MPI shared memory用来减小内存占用。
如何提交 VASP 到队列系统已经在上面介绍过了。下面的例子是,如果要直接运行一个任务的写法:
```bash
vasp-nvidia-640-env mpirun -np 1 -x CUDA_DEVICE_ORDER=PCI_BUS_ID -x CUDA_VISIBLE_DEVICES=0 -x OMP_NUM_THREADS=4 vasp-std
vasp-gnu-640-env mpirun -np 2 -x OMP_NUM_THREADS=4 vasp-std
vasp-intel-640-env mpirun -n 2 -genv OMP_NUM_THREADS=4 vasp-std
vasp-amd-640-env mpirun -np 2 -x OMP_NUM_THREADS=4 vasp-std
```
其中 `CUDA_VISIBLE_DEVICES` 用于指定用哪几个显卡计算(多个显卡用逗号分隔)。
要查看显卡的编号,可以用 `CUDA_DEVICE_ORDER=PCI_BUS_ID vasp-nvidia-640-env nvaccelinfo` 命令。
这里 `vasp-xxx-6.4.0` 命令的作用是,进入一个安装了对应版本的 VASP 的环境,实际上和 VASP 关系不大;
后面的 `mpirun xxx` 才是真的调用 VASP。
所以实际上你也可以在这个环境里做别的事情,例如执行上面的 `nvaccelinfo` 命令。
## mumax
问龚斌,我没用过。
## lammps
除了我应该没人用,就不写了。
## quantum espresso
我也只用过一次。大规模用到了再说吧。
# 其它软件
我自己电脑上有的软件,服务器都有装,用于科研的比如 VESTA 什么的。可以自己去菜单里翻一翻。
## 操作系统
操作系统是 NixOS是一个相对来说比较小众的系统。
它是一个所谓“函数式”的系统。
也就说,理想情况下,系统的状态(包括装了什么软件、每个软件和服务的设置等等)是由一组配置文件唯一决定的(这组配置文件放在 `/etc/nixos` 中)。
要修改系统的状态(新增软件、修改设置等等),只需要修改这组配置文件,然后要求系统应用这组配置文件就可以了,
系统会自动计算出应该怎么做(增加、删除、修改哪些文件,重启哪些服务等等)。
这样设计有许多好处,例如可以方便地回滚到之前任意一个时刻的状态(方便在调试时试错);
一份配置文件可以描述多台机器的系统,在一台上调试好后在其它机器上直接部署;
以及适合抄或者引用别人写好的配置文件。
以上都是对于管理员来说的好处。对于用户来说的好处不是太多,但是也有一些。
举个例子,如果用户需要使用一个没有安装的软件(例如 `phonopy`,当然实际上这个已经装了),只需要在要执行的命令前加一个逗号:
```bash
, phonopy --dim 2 2 2
```
系统就会帮你下载所有的依赖,并在一个隔离的环境中运行这个命令(不会影响这之后系统的状态)。
还有一个命令可能也有用,叫 `try`。
它会在当前的文件系统上添加一个 overlay之后执行的命令对文件的修改只会发生在这个 overlay 上;
命令执行完成后,它会告诉你哪些文件发生了改变,然后可以选择实际应用这些改变还是丢弃这些改变。
例如:
```bash
try phonopy --dim 2 2 2
```
这个命令和 NixOS 无关,只是突然想起来了。
## 文件系统
文件系统是 BtrFS。它的好处有
* 同样的内容只占用一份空间;以及内容会被压缩存储(在读取时自动解压)。这样大致可以节省一半左右的空间。
例如现在 xll 目录里放了 213 G 文件,但只占用了 137 G 空间。
* 每小时自动备份,放置在 `/nix/persistent/.snapshots` 中,大致上会保留最近一周的备份。如果你误删了什么文件,可以去里面找回。
## ZSH
所谓 “shell” 就是将敲击的一行行命令转换成操作系统能理解的系统调用C 语言的函数)的那个东西,也就是负责解释敲进去的命令的意思的那个程序。
大多情况下默认的 shell 是 bash但我装的服务器上用 zsh。
zsh 几乎完全兼容 bash 的语法,除此以外有一些顺手的功能:
* 如果忘记了曾经输入过的一个命令,输入其中的几个连续的字母或者单词(不一定是开头的几个字母),然后按 `` 键,就会自动在历史命令中依次搜索。
例如我输入 `install` 按几下 `` 键,就可以找到 `sudo nixos-rebuild boot --flake . --install-bootloader --option substituters https://nix-store.chn.moe` 这个东西。
* 如果从头开始输入一个曾经输入过的命令,会用浅灰色提示这个命令。要直接补全全部命令,按 `` 键。要补全一个单词,按 `Ctrl` + `` 键。
* 常用的命令,以及常用命令的常用选项,按几下 `tab` 键,会自动补全或者弹出提示。

View File

@@ -0,0 +1,99 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/467C-02E3" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/2f9060bc-09b5-4348-ad0f-3a43a91d158b" = { "/nix" = "/nix"; "/nix/boot" = "/boot"; };
"/dev/disk/by-uuid/a04a1fb0-e4ed-4c91-9846-2f9e716f6e12" =
{
"/nix/rootfs" = "/nix/rootfs";
"/nix/persistent" = "/nix/persistent";
"/nix/nodatacow" = "/nix/nodatacow";
"/nix/rootfs/current" = "/";
};
};
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "znver3";
cuda =
{
enable = true;
capabilities =
[
# p5000 p400
"6.1"
# 2080 Ti
"7.5"
# 3090
"8.6"
# 4090
"8.9"
];
forwardCompat = false;
};
};
gui = { preferred = false; autoStart = true; };
kernel.patches = [ "cjktty" "lantian" ];
networking.hostname = "xmupc1";
nix.remote.slave.enable = true;
};
hardware = { cpus = [ "amd" ]; gpu.type = "nvidia"; };
packages.packageSet = "workstation";
virtualization = { waydroid.enable = true; docker.enable = true; kvmHost = { enable = true; gui = true; }; };
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = { passwordAuthentication = true; groupBanner = true; };
xray.client.dae.wanInterface = [ "wlp57s0" ];
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
smartd.enable = true;
beesd.instances =
{
root = { device = "/"; hashTableSizeMB = 16384; threads = 4; };
nix = { device = "/nix"; hashTableSizeMB = 512; };
};
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "JEY7D4ANfTpevjXNvGDYO6aGwtBGRXsf/iwNwjwDRQk=";
wireguardIp = "192.168.83.6";
};
slurm =
{
enable = true;
cpu = { cores = 16; threads = 2; };
memoryMB = 94208;
gpus = { "2080_ti" = 1; "3090" = 1; "4090" = 1; };
};
xrdp = { enable = true; hostname = [ "xmupc1.chn.moe" ]; };
samba =
{
enable = true;
hostsAllowed = "";
shares = { home.path = "/home"; root.path = "/"; };
};
groupshare = {};
};
bugs = [ "xmunet" "amdpstate" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
services.hardware.bolt.enable = true;
};
}

View File

@@ -0,0 +1,48 @@
acme:
cloudflare.ini: ENC[AES256_GCM,data:PjCyozvFTXxA///enYYbaMZ8ISfFjJviLVKfdOcMSi5G3CEjEsp1Ez4krbgy4/eJo4v9HfTN0bMmUnl2OHOyzTg=,iv:e1iQZ5JUHkzfnfP956Lzl3FWs11xdULctA5MZsALtU0=,tag:8X2Q/Hixxn/ci4XRSUDidg==,type:str]
nginx:
maxmind-license: ENC[AES256_GCM,data:/7R7w+fiMw54Cmd7y/wT/s8RMqFMf3Fc0Mph0ZhURmCzowkmLEhtmw==,iv:i+Z+2NbssI864Edwf73SQfaeFuWoqr+U8eQ/8R23FOk=,tag:8ITlkS97vlsmHM1HDk6/3A==,type:str]
xray-client:
uuid: ENC[AES256_GCM,data:4PM/d263HgBseIgRplgo5ahJ8u8HuPznXt2hW5O+VawS6WjP,iv:98Ymj4eiCGQPMcaHBI9zJAaRagm82mF0LY2c9bzA+/s=,tag:8imXq/hxAxS5XKy0uWIBPw==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:Azaqung7llErB7/IdnOnEkwjQ39yQHKcO7VgvMDCDTExM7nS0zx+yMYX4ls=,iv:FX8oLHMBVEnKkYOg8q2A9vFmtRZDws5T87+lEl7+2G8=,tag:DdOQUbNKB6JK7Tp6McQ0Og==,type:str]
users:
#ENC[AES256_GCM,data:1RG/IM/UrLCk,iv:LY2QCBN0gYwuhVwS/WIrjt4MEHhjPPQG+cjTZJhU6Zc=,tag:AEL+smmitSqW+D70K74LbQ==,type:comment]
xll: ENC[AES256_GCM,data:YauaeGHDVAnMXp9hSz4r4jNsioF79Q+WplfsYGpl4g5FxoakhfjRlnfzrLmMO3mWEIBOmDqeShbDEulyV5O47CIBGaMUUHe+Gg==,iv:RNwRfghJBb0PO4A/T5d5J1U0NsXdygXlWq/FfF8MO4U=,tag:BOh666TYGbCCHcgB/uBhTw==,type:str]
#ENC[AES256_GCM,data:zxOQcoOzJNBK,iv:YJQB8lV+nhwm5XYMpDIyt0IDHBlHTiHO8cpgXkXe/dQ=,tag:re5ekGkYRewPdxv83mtLUQ==,type:comment]
zem: ENC[AES256_GCM,data:bIxVN4T3Gh3aSa1gylkPmW3/uT5xQAlruC+L3zk0Tc3KvwBCQA5DpxXU8ZxjeK0P0xGi02U7gFWgm+yxp6otdCsUEmWed4EHHw==,iv:vpKpY0nRUwuI5mCcYTOD3zN/E21wHl4ZbRDUPoFmdhQ=,tag:m5WTzCgOTC7oqU4yfV9gkQ==,type:str]
#ENC[AES256_GCM,data:ZnMFN0WzjKDd,iv:t1YHrNoHOohYsdBOqoV6OtfS5ig6CTS8jW5mKy0oSQA=,tag:WkgrH1ZXcbHruxJY/hVsmg==,type:comment]
yjq: ENC[AES256_GCM,data:ua0DINHutjt2Pk+SfHRQRV99mT3Cnw6rRKO8VRIAlP0dY6QhK9wkNdyRYWYRBKVrWgyFQMGNFYAxIpymjF/X7mBOVI2sOHLgkw==,iv:PUZ6S0KICuqoSA2sDLxdL4gtAOQnQXOUY+5f3qDZgpc=,tag:f39P34vAUOrV23BsKkRarA==,type:str]
#ENC[AES256_GCM,data:6qNjSdjck4Vz,iv:c/GNqCNgRgwgL+2f6Vumtjb/ub9WCBSy8R02NRCDqk8=,tag:b/tucJsHTjSfcK0vgHtE8A==,type:comment]
gb: ENC[AES256_GCM,data:3eAKBiJoC1owCHTFd3Xq8vI8VK980evePc92xCXJJ21M9D1MdbwN8ySZ3Ovjk7VfQmEo8oRv1Ll1sftyrXYoeTHmJsNDxCpR6A==,iv:Ju/ERNuGrgO5kYlbvmkbLJkgiW3Elou34AsJTFITCUg=,tag:POVlxYh9kZ1BMSbt97IVOQ==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:qQMD8SKNmxb3PdScXNqppF9zkX7dV5i7rvljvZuhiI5zLnu77qYCHBW6ymh0mrY14N9NjxmQZhZWX/H8TvBlcg==,iv:J5N3LjCYW3QmuEkMBpl7qvPFW1Z9ZoPLkj45jKcIW9U=,tag:Tl+ld07+lVkmzt7f/f2MqQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5RWIreCtMeTZ0UE9Zd2di
VE9tR0x6SUNyWjlPV1BqMU5Tb0RTSXNGN2hNCkxuVjFFb0xJZTBMekxqdE96RlRh
czF0dHQxdVhsNE5tVWg0Q2RmYktsWDgKLS0tIFY3dHRlbFpsWUsyTzA3RVR1Qyts
UUJHMU13cm1lOXhRYzhSWlFyTFltYWcKDUxABRGskWWpHEFL44gHYzAqaQ3AmBDt
LcL/4IiEs3TwOpuY+WTVx8JKZBOsxcSlNahiDuCnoTbL4gZTPnd0pA==
-----END AGE ENCRYPTED FILE-----
- recipient: age1hnarptkze0ujpp05dqr8uma04cxg9zqcx68qgpks5uf5l6rpk5gqhh8wxg
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBwbHd4ZHhsTk5leDlreC9E
TVAzRXVuS0Judk5zTGVWRVhWSUhpMFdscEg0ClVFYzZYZG9hNjJKTlRVZ1I3eXVq
M2Y5by85dE1QM25yQ3g3bFVSL2tsVlkKLS0tIHVYbGxrT0hOQkZ5SHBsQ3UyaVly
ZDNHUjE2QVlCV3p0NHdKYW5IMHVBZzQKkZtfyvfroOntg3yRjMw4jQHiQj8eaB2h
IeIHfW4y01mmVT2ofbtB0xYpjcl4gtUlQ8X3tn5iJ9P8gcVo0G598A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-03-10T13:47:17Z"
mac: ENC[AES256_GCM,data:19w2Q1SRhKIyxibGgKa+CkEhiizFJ27FePOlMll+8tJVJRzfIl8KrutlRi0hMhEYFlML0bWunbINUEIg7yJbIwFCSjxFDnqKsCT3iClT3kaktxr5+0R+ECoQTGGV67VkT5WY/LT3V1zdLYI38MVaBQObGKCpBs23nIK2QXrg39Q=,iv:q1ezSmo14vsmEE8owxnsonWMq2uj6mrVjKNh+RuK+cE=,tag:QBc99UEaEPiEgZH+Z3Z8tA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

View File

@@ -0,0 +1,24 @@
{
"data": "ENC[AES256_GCM,data:tuEymMXW0f7Rui5wrz/xozphTEq6ffkYIfNIoURFNHwH2Cg+aKHz2ox0gk02BJARhPMDrxCYlChkcrEI0ma/T0eBe9sWz3tA8AOwU1lHSZ06d/JWzW7IUIyTac2mnjt3/jY/qpnR4A8wtHwD0j4zkzXgUgFwq7k/fs24acEE4Jo=,iv:iDTS0xswLrwkOYmfomE5hluVONgJYia/RjINDy7T3R0=,tag:oIYNpFCuT2D+X1QEJJiHew==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3aFRRa0NsOUp5MEg3UHcx\nc3g1VFZEQS9Tci9QSnNFYnIrT3hUdVU5cWxjCnU5UXVEdTFXczJzcHVvSjF2WHdB\nYmpyQVVaUFozKzJIZThBbXUxb2k2YzAKLS0tIHE1QXVrOXo1Y3VXMzJJYitWU3Qv\neDF1cndrSi94clh1cS9NczN0UW9pOXcKtrnIj3WovMYdcg5nWnnyRhJhTGLrlwxW\nxQ6bmNrfbZedmCNdjY2lPXmudMXJ8YlWe/HGCe94x3iFlaSwCIGUsA==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1hnarptkze0ujpp05dqr8uma04cxg9zqcx68qgpks5uf5l6rpk5gqhh8wxg",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBocFl1SHJEemRySlBnMmNn\nVW9RS1NNdlo4M3l2WGlQaHJmbDBHcjMwaVVnCnY5WExPOXZJVEdYSlJ6UTRBMGJj\ncmlYaUNVV1hnWTNkaWVuV2VuaXN2eU0KLS0tIDBTYnd2NmVYTUJKaHZWRWo3ZlUx\nTEtPZWc2RE1XNG9WTXFOTllWVUVWeUkK+9aLz1rygGAQjpG+oMNUtrDkQaDfg+2q\nnl/CtZZrFD6NXGw6Di0X5t9fQu295NTJ/0qjXnfMigG8gDtxkE+/7g==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-02-26T06:04:53Z",
"mac": "ENC[AES256_GCM,data:y0RkPyUwwff95BFL951TxS/x5ORzMsxFJVjopSw+8iVtswD8MT1nmsbwyth4C9OnJ/IAtnZk/CjAt72a68AZpPI+2W/JqJq20ohFoquDNhTlsoyLWdO3Vjrd+Wo3hp0+iKQ3e/uYrF1sTqQO9a3OIxu2sVLM0gEDmIe2nJpLJQo=,iv:EjXTQvVdjzfClNfQ3rPxAFVWVqr7sSOz4ap+nshPEAk=,tag:DcIlf9W7NNqQ+gf8f46MwQ==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.8.1"
}
}

31
devices/xmupc2/README.md Normal file
View File

@@ -0,0 +1,31 @@
# 硬件
* CPU44 核 88 线程。
* 内存256 G。
* 显卡:
* 409024 G 显存。
* P500016 G 显存。
* 硬盘18 T。
# 支持的连接协议
## SSH
* 地址xmupc2.chn.moe
* 端口6394
* 用户名:自己名字的拼音首字母
* 可以用密码登陆,也可以用证书登陆。
## RDP
* 地址xmupc2.chn.moe
* 用户名:自己名字的拼音首字母
* 密码和 ssh 一样(使用同样的验证机制)。
## samba
* 地址xmupc2.chn.moe
* 用户名:自己名字的拼音首字母
* 初始密码和 ssh 一样。
其它内容请阅读 [xmupc1](../xmupc1) 的说明,两台机器的软件大致是一样的。

View File

@@ -0,0 +1,83 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
vfat."/dev/disk/by-uuid/23CA-F4C4" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/d187e03c-a2b6-455b-931a-8d35b529edac" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
};
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "skylake";
cuda =
{
enable = true;
capabilities =
[
# p5000 p400
"6.1"
# 2080 Ti
"7.5"
# 3090
"8.6"
# 4090
"8.9"
];
forwardCompat = false;
};
};
gui = { preferred = false; autoStart = true; };
kernel.patches = [ "cjktty" "lantian" ];
networking.hostname = "xmupc2";
nix.remote.slave.enable = true;
};
hardware = { cpus = [ "intel" ]; gpu.type = "nvidia"; };
packages.packageSet = "workstation";
virtualization = { waydroid.enable = true; docker.enable = true; kvmHost = { enable = true; gui = true; }; };
services =
{
snapper.enable = true;
fontconfig.enable = true;
sshd = { passwordAuthentication = true; groupBanner = true; };
xray.client.dae.wanInterface = [ "wlp4s0" ];
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
smartd.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 16384; threads = 4; };
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "lNTwQqaR0w/loeG3Fh5qzQevuAVXhKXgiPt6fZoBGFE=";
wireguardIp = "192.168.83.7";
};
slurm =
{
enable = true;
cpu = { sockets = 2; cores = 22; threads = 2; };
memoryMB = 253952;
gpus = { "4090" = 1; "p5000" = 1; };
};
xrdp = { enable = true; hostname = [ "xmupc2.chn.moe" ]; };
samba = { enable = true; hostsAllowed = ""; shares = { home.path = "/home"; root.path = "/"; }; };
groupshare = {};
};
bugs = [ "xmunet" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
};
}

View File

@@ -0,0 +1,48 @@
acme:
cloudflare.ini: ENC[AES256_GCM,data:/y070fzfZFI/Jb9xS8UO7iRnjHJ3uItqsHqjyHPAqsTN4tSEyMpaE3KtNpecgWxk2PvLRfqdmdwu/bnGlIp7adU=,iv:fv4dbeK1F/cn5nhnSC1lTUqxeFPG/0lNqEvPWMH6Mzw=,tag:dE4clxPGraAXXsJM6NS8XQ==,type:str]
nginx:
maxmind-license: ENC[AES256_GCM,data:FPVSD8otQMNpbESNEHXCfQjB/zi3OVwZoyLijUtnHQlQzec7KVSiGw==,iv:DkkwCqvRmcFHQIXseh2fycCxZboJMYhHPu67GddenY4=,tag:iHEC8r5GcuB1QcZ5Uf8Skw==,type:str]
xray-client:
uuid: ENC[AES256_GCM,data:j2R0UtfS/es2A+Ic+Kq6FZJSqXlA/Q8tGkuAIX0ZdTsV4hGk,iv:Ovpr49isIJRdUyM3jxgiT+9Sc+qTF6ZnkKUwxIq6KUs=,tag:2VRSkiPNWaOmCqLJti8Bzw==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:0Vw9NVs/Kxc52zUlmeAPFeOG8msdL0YopjhzFKRWhv6+kfb+SFObOP8EJ2M=,iv:KgIZIawbnN+1sIcMjNECkdtujPbg7yQktKVc25SXavI=,tag:b79oZP+GZKmM3OVFshvFhg==,type:str]
users:
#ENC[AES256_GCM,data:FP1Mr1TmRI4L,iv:3K4LMbOQPvF1ORWNyaXDoC5MXn3yColR4eKs9sm9y5s=,tag:f3guTegVXw1A6aqolKQnqA==,type:comment]
xll: ENC[AES256_GCM,data:CAEd+usnLKoQZ+0PLEiJfbZpz2pyn+I/edC2KbNXBXZPAgT7IDENMnSQyxme899KqRVL4nLrtHs82aA8+kl/dE+QYSTCFVVuHg==,iv:Hs8rb0Iu5Xw74p9/cL2gWfPLh61VaLzIltKUSjRFZjc=,tag:/u5vI0oTMQbNoCEzhcWqOw==,type:str]
#ENC[AES256_GCM,data:UIns0CnC/QmJ,iv:Gn4XDPcdTyDLXAgGq7qwayrN206Gx7JsJ3V9G+4bTyA=,tag:FITVs8Tgkiq1XoS8joXM1Q==,type:comment]
zem: ENC[AES256_GCM,data:znpGuS8LVxaztnwQlIwu3hykWRBUtQvOsniLaOasXDbw9lHGX8lwwYJuCE+0I14HmiZK/RrrouIwfAfcjZQzPyjJ/SRoOG1Vyg==,iv:YXHX43y99/w9102vhsvFLVOUtJmuRnLVLu+ywfn9URY=,tag:AzsmkXOyX7y/D+ndteuMmA==,type:str]
#ENC[AES256_GCM,data:6vMItERptBsX,iv:G0sDjEfLciheMxTZbeLIbWKlimPD1ANIk/VVdhQifXA=,tag:oR9FEdVx6W+0uDeKfb37iw==,type:comment]
yjq: ENC[AES256_GCM,data:sGPQ0xALULREnhzl9g/V91M5osMglsSps6R4gYn5OZc/4xVC1phF3qajVN3YMOr7kKgkHbF2Rjm6/2vuK0k1iYZnFswUAmFlmw==,iv:5vG1hn7SlX6HCpas2BgxBSwWqLby8OCxcH3EKNvceIc=,tag:TVwFBAuosKnEOZecq1phXw==,type:str]
#ENC[AES256_GCM,data:ALHxkRABA+ll,iv:r1IDiHLFcTdLID3q16zrLTavAwQfddC7bXMKcFZFveI=,tag:4Pd0/Q1BmH4gJjaM4hbqqQ==,type:comment]
gb: ENC[AES256_GCM,data:z4CrtdmdLJJ0qZzr7qvihnluJQgjtciX56KdEmtemiRu0llEJk9qz6a23aJ7m40Sfc38elF1/LsvjOuBOC87+BVkKDCj76phag==,iv:WrFVxkr3snmqDXZx5kAYCLp7ixEIzxoT7El3rV7Ovqg=,tag:iExf2Y/HObHQrKMTRvqn7A==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:9wLQ1zF/kDaiw0s3UaRpiHgmngU7u6hwyqpddSjev0+Z0v58Q2oiJtK8vn+2VlSxx5ACfqEFbzp0PZYAxd575w==,iv:q9JTkgDymOwkbZ/PaxRAAQrtO96QmGgZcQuLTFCMoS4=,tag:dwOHlOTgZqT/1jQ+oGf7UQ==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0Rmc2Ull1WFB4Smh3c0Zl
emlTNGJKZkpIK2JFeUNVeUcrR2FzRXRQZHlvCkhzMHpzYmZRZ0M0cXdRVi8wZmp6
ZDRZQ2FkOWt6M0lrdjBHa3VTWXBDKzgKLS0tIGtJbTRRelg1VVk2QStwdzlFM1g4
M1JOd1g3cVdjUFRhZ0FxcWphZXZJbkkKFXDtJVoi+qIrXp6cznevuZ+peBiRRITP
rrplqLiYsNIGKmKYtRIUu8WXDZ2q2CJ8Z+pka3W3H/U+m957hBDWyw==
-----END AGE ENCRYPTED FILE-----
- recipient: age1l4stuz0vr7gs7pqwjrmezam44702jp2vmqaqyxw0l0r42kf9updq4dfhrw
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsSHdka3FPQUYrcXQzcTFo
a000TUllT0MvUzk5ZzVFbXZheG9ZVTM2S253CkE5VW9tQktvL2pMWFoxcnFjTGpr
Z0p1RjZWRGpSZ01TdTZRcEJXM2NOUkUKLS0tIC9rNmNzWitMdEd5dXQvdWlELzhM
M0xoL1dQR0kvMWpzN0RMNWVCTFQxNFUKj9LPjBo5NGOrGYNvu8qZ13PLYjLEWllU
LARzEn4XgkeHckouwvxZYMCx7WxmAruRWaOvnxTIczzSNP7wIrqnkA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-03-10T13:46:59Z"
mac: ENC[AES256_GCM,data:j+bdp0emAtTNNI7aZsKTJ+uARsuyLb9GRV0CeIb2EoZaOmj5cJpUzYtcAWIdCYplt1ZScCcR7iQPUlCzUb0+pXth7QDibtGJcj0dqw87DoaY3cqm7jNkKteiIYxXOCmbMBgED9eMxQVdcGZTDSuTQ0KjFYoXkcUSriMsJltDUDc=,iv:+eLNmlxeqB/Q7Rmz5B/wZSajiesV+/ED3ROJuuShpfo=,tag:95xKRRuqRZkUFUjHbPrDNw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

View File

@@ -0,0 +1,24 @@
{
"data": "ENC[AES256_GCM,data:Um00c+kry3QrHEZVdlUws+gGGvtPKh8WzkpT6CHL7uwHRUWc+5E0bvlwXFJTkmPdGOOV2Jx9fGvSKpQb1/MPJhMhpCAw5n69QIRjVVURZcvVVFrl+eNO2sf/h2GTFvKRAtlcNAh7cvjkpiB3r+S7mRYSI914B7w8GLTdRFvtqYo=,iv:gk7S1SiA0iBAfpXLhhPJuexolP6w1XAd8M2H+sqqmoM=,tag:O8Eoa4LjEo14H/+1W5rcgQ==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWYmNFOFlnbm1FdXdGWUNr\nOGN3THhDUyt4SDVzcHY5dEYrSWsrQm1UOFJvCmhXaWFlcC8wazROaXZzcm9tUnFM\nQlphZ0x6c0RhbzY0aGVFbXdOa1BHbG8KLS0tIHF2YUNTVnZ3Z25FSnFlTEdmdXhE\nb3Z2UEp1c2UrOUp3NEdNcE5HSFptbzAKWGSTwv6xUNs/f+p0Bhpzg8zZ7EVK8kMm\no13fru2Cnqrw8Cj0zfx+7LODpBVzo03fLYKqZ6kbPZGa12ihk+fD4g==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1l4stuz0vr7gs7pqwjrmezam44702jp2vmqaqyxw0l0r42kf9updq4dfhrw",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKRVMrenM2Q1ZheFVPc2Rz\nYVd6UGoxbkpSQlZsNFN1dmIzSkl6SERwaTBRCjlHV3MvTEpxbDY4OHZjeUd5NmRF\nRmc1NzVCMTA0bDhwajNlMWZKTlNKK2cKLS0tIHRZZ0cxY2dwV21iRDlmeE5UZkM4\nK1dKV24yY3FKV2J3U2VzZWt2QnBSTHcKn8mq+1RnJG/nBbH2mAFpSFSTHDWvMqJj\nsziW9lK0cH6bPxhcpDO4oG8K08bdGHUVGtx2Zk81CDqzfamlMzzG2Q==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-03-09T07:59:38Z",
"mac": "ENC[AES256_GCM,data:zNh6Cioh4+r0+nx04yLqeQShozxl7bLLKSmwodnmHtVQVlOTjj5sDLMEAAmrj1Ym2KrBPJOgdm34Sl6AbsmiBLxzDcBKe6J68Y/LHIeaPkToRKpmoy9I9a177w0KzFXgNaU2ieH71egD+nf8JmGG61hDjpiJRpx1Lwxb16Bn+Xs=,iv:QxiUYymiGuH0EBwEhyg5gDzkSKvGhq0+0wERNEJ71UM=,tag:N1Nn9X9vrghwwJWC3kituA==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.8.1"
}
}

2033
flake.lock generated

File diff suppressed because it is too large Load Diff

680
flake.nix
View File

@@ -3,36 +3,77 @@
inputs =
{
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-23.05";
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:CHN-beta/nixpkgs/nixos-unstable";
home-manager = { url = "github:nix-community/home-manager/release-23.05"; inputs.nixpkgs.follows = "nixpkgs"; };
"nixpkgs-23.05".url = "github:CHN-beta/nixpkgs/nixos-23.05";
"nixpkgs-22.11".url = "github:NixOS/nixpkgs/nixos-22.11";
"nixpkgs-22.05".url = "github:NixOS/nixpkgs/nixos-22.05";
home-manager = { url = "github:nix-community/home-manager/release-23.11"; 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"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs-unstable"; };
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"; 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"; };
qchem = { url = "github:Nix-QChem/NixOS-QChem/release-23.11"; 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"; };
plasma-manager =
{
url = "github:pjones/plasma-manager";
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
nix-doom-emacs = { url = "github:nix-community/nix-doom-emacs"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-linyinfeng = { url = "github:linyinfeng/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nixos-hardware.url = "github:CHN-beta/nixos-hardware";
envfs = { url = "github:Mic92/envfs"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-fast-build = { url = "github:/Mic92/nix-fast-build"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-flatpak.url = "github:gmodena/nix-flatpak";
chaotic =
{
url = "github:chaotic-cx/nyx?rev=03b2bea544688068025df1912ff1e9a1ad4a642a";
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
gricad = { url = "github:Gricad/nur-packages"; flake = false; };
misskey = { url = "git+https://github.com/CHN-beta/misskey?submodules=1"; flake = false; };
rsshub = { url = "github:DIYgod/RSSHub"; flake = false; };
zpp-bits = { url = "github:eyalz800/zpp_bits"; flake = false; };
citation-style-language = { url = "git+https://github.com/zepinglee/citeproc-lua?submodules=1"; flake = false; };
concurrencpp = { url = "github:David-Haim/concurrencpp"; flake = false; };
cppcoro = { url = "github:Garcia6l20/cppcoro"; flake = false; };
date = { url = "github:HowardHinnant/date"; flake = false; };
eigen = { url = "gitlab:libeigen/eigen"; flake = false; };
matplotplusplus = { url = "github:alandefreitas/matplotplusplus"; flake = false; };
nameof = { url = "github:Neargye/nameof"; flake = false; };
nodesoup = { url = "github:olvb/nodesoup"; flake = false; };
tgbot-cpp = { url = "github:reo7sp/tgbot-cpp"; flake = false; };
v-sim = { url = "gitlab:l_sim/v_sim"; flake = false; };
win11os-kde = { url = "github:yeyushengfan258/Win11OS-kde"; flake = false; };
fluent-kde = { url = "github:vinceliuice/Fluent-kde"; flake = false; };
rycee = { url = "gitlab:rycee/nur-expressions"; flake = false; };
blurred-wallpaper = { url = "github:bouteillerAlan/blurredwallpaper"; flake = false; };
slate = { url = "github:TheBigWazz/Slate"; flake = false; };
linux-surface = { url = "github:linux-surface/linux-surface"; flake = false; };
lepton = { url = "github:black7375/Firefox-UI-Fix"; flake = false; };
lmod = { url = "github:TACC/Lmod"; flake = false; };
mumax = { url = "github:CHN-beta/mumax"; flake = false; };
kylin-virtual-keyboard = { url = "git+https://gitee.com/openkylin/kylin-virtual-keyboard.git"; flake = false; };
};
outputs = inputs:
let
localLib = import ./local/lib inputs.nixpkgs.lib;
devices = builtins.attrNames (builtins.readDir ./devices);
in
{
packages.x86_64-linux =
@@ -40,7 +81,7 @@
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" ]));
devices));
}
// (
builtins.listToAttrs (builtins.map
@@ -49,577 +90,48 @@
name = system;
value = inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel;
})
[ "pc" "vps6" "vps7" "nas" "yoga" ])
devices)
);
nixosConfigurations = builtins.listToAttrs (builtins.map
(system:
{
name = system.name;
value = inputs.nixpkgs.lib.nixosSystem
# ssh-keygen -t rsa -C root@pe -f /mnt/nix/persistent/etc/ssh/ssh_host_rsa_key
# ssh-keygen -t ed25519 -C root@pe -f /mnt/nix/persistent/etc/ssh/ssh_host_ed25519_key
# systemd-machine-id-setup --root=/mnt/nix/persistent
nixosConfigurations =
(
(builtins.listToAttrs (builtins.map
(system:
{
system = "x86_64-linux";
name = system;
value = inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
specialArgs = { topInputs = inputs; inherit localLib; };
modules = localLib.mkModules
[
(moduleInputs: { config.nixpkgs.overlays = [(prev: final:
# replace pkgs with final to avoid infinite recursion
{ localPackages = import ./local/pkgs (moduleInputs // { pkgs = final; }); })]; })
./modules
./devices/${system}
];
};
})
devices))
// {
pi3b = inputs.nixpkgs.lib.nixosSystem
{
system = "aarch64-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
);
[
(moduleInputs: { config.nixpkgs.overlays = [(prev: final:
# replace pkgs with final to avoid infinite recursion
{ localPackages = import ./local/pkgs (moduleInputs // { pkgs = final; }); })]; })
./modules
./devices/pi3b
];
};
})
(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 =
{
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";
};
};
};
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.enable = false; };
misskey = { enable = true; hostname = "xn--qbtm095lrg0bfka60z.chn.moe"; };
misskey-proxy."xn--qbtm095lrg0bfka60z.chn.moe" = {};
huginn.enable = true;
};
bugs =
[
"intel-hdmi" "suspend-hibernate-no-platform" "hibernate-iwlwifi" "suspend-lid-no-wakeup" "xmunet"
"suspend-hibernate-waydroid" "embree"
];
};})
];
"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";
map =
{
"ng01.mirism.one" = 7411;
"beta.mirism.one" = 9114;
};
};
streamProxy =
{
enable = true;
map =
{
"nix-store.chn.moe" = { upstream = "internal.pc.chn.moe"; rewriteHttps = true; };
"anchor.fm" = { upstream = "anchor.fm:443"; rewriteHttps = true; };
"podcasters.spotify.com" = { upstream = "podcasters.spotify.com:443"; rewriteHttps = true; };
};
};
};
misskey-proxy =
{
"xn--qbtm095lrg0bfka60z.chn.moe".upstream.address = "internal.pc.chn.moe";
"xn--s8w913fdga.chn.moe".upstream.address = "internal.vps7.chn.moe";
};
coturn.enable = true;
synapse-proxy."synapse.chn.moe".upstream.address = "internal.vps7.chn.moe";
vaultwarden-proxy = { enable = true; upstream.address = "internal.vps7.chn.moe"; };
};
};})
];
"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"; };
sshd.enable = true;
rsshub.enable = true;
nginx = { enable = true; transparentProxy.externalIp = "95.111.228.40"; };
wallabag.enable = true;
misskey = { enable = true; hostname = "xn--s8w913fdga.chn.moe"; };
misskey-proxy."xn--s8w913fdga.chn.moe" = {};
synapse.enable = true;
synapse-proxy."synapse.chn.moe" = {};
xrdp = { enable = true; hostname = "vps7.chn.moe"; };
vaultwarden.enable = true;
vaultwarden-proxy.enable = true;
# huginn.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.auto =
{
"/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; };
};
rollingRootfs = { device = "/dev/mapper/root1"; path = "/nix/rootfs"; };
};
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;
};
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;
};
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" ];
smartd.enable = true;
};
};})
];
}));
}
);
# 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
@@ -652,10 +164,24 @@
{
hostname = node;
profiles.system.path = inputs.self.nixosConfigurations.${node}.pkgs.deploy-rs.lib.activate.nixos
inputs.self.nixosConfigurations.${node};
inputs.self.nixosConfigurations.${node};
};
})
[ "vps6" "vps7" "nas" ]);
[ "vps6" "vps7" "nas" "surface" "xmupc1" "xmupc2" "pi3b" ]
);
};
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; topInputs = inputs; }); };
config.archive = false;
devShell.x86_64-linux = let inherit (inputs.self.nixosConfigurations.pc) pkgs; in pkgs.mkShell
{
packages = with pkgs; [ pkg-config cmake ninja clang-tools_17 ];
buildInputs =
(with pkgs; [ fmt boost magic-enum libbacktrace eigen range-v3 ])
++ (with pkgs.localPackages; [ concurrencpp tgbot-cpp nameof ]);
# hardeningDisable = [ "all" ];
# NIX_DEBUG = "1";
};
};
}

View File

@@ -1,6 +1,6 @@
lib:
lib: rec
{
attrsToList = Attrs: builtins.map ( name: { inherit name; value = Attrs.${name}; } ) ( builtins.attrNames Attrs );
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 ) ];
@@ -12,9 +12,9 @@ lib:
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))
let handle = module: let type = builtins.typeOf module; in
if type == "path" || type == "string" then (handle (import module))
else if type == "lambda" then ({ pkgs, utils, ... }@inputs: (module inputs))
else module;
in handle
)
@@ -32,4 +32,26 @@ lib:
in
# Split into lines. Strip leading tabs. Concat back to string.
builtins.concatStringsSep "\n" (stripTabs (lib.strings.splitString "\n" text));
# find an element in a list, return the index
findIndex = e: list:
let findIndex_ = i: list: if (builtins.elemAt list i) == e then i else findIndex_ (i + 1) list;
in findIndex_ 0 list;
# return a list of path, including:
# - all .nix file in the directory except for default.nix
# - all directories containing a default.nix
findModules = path:
mkModules (builtins.filter (path: path != null) (builtins.map
(subPath:
if subPath.value == "regular" && subPath.name != "default.nix"
then if lib.strings.hasSuffix ".nix" subPath.name
then "${path}/${subPath.name}"
else null
else if subPath.value == "directory"
then if (builtins.readDir "${path}/${subPath.name}")."default.nix" or null == "regular"
then "${path}/${subPath.name}"
else null
else null)
(attrsToList (builtins.readDir path))));
}

View File

@@ -1,29 +0,0 @@
{
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,25 @@
{ version ? "4.2.0", stdenv, fetchurl, lib }:
let versions =
{
"4.1.0" = "1k9anln9hmdjflrkq4iacrmhma7gfrfj6d0b8ywxys0wfpdvy12v";
"4.2.0" = "1aycw6ygzr1db6xf3z7v5lpznhs8j7gcpkawd304vcj5qw75cnpd";
};
in stdenv.mkDerivation
{
pname = "aocc";
inherit version;
src = fetchurl
{
url = "https://download.amd.com/developer/eula/aocc/aocc-"
+ builtins.concatStringsSep "-" (lib.lists.take 2 (builtins.splitVersion version))
+ "/aocc-compiler-${version}.tar";
sha256 = versions.${version};
};
dontBuild = true;
installPhase =
''
mkdir -p $out
cp -r bin include lib lib32 libexec share $out
'';
dontFixup = true;
}

View File

@@ -0,0 +1,28 @@
{ version ? "4.2.0", stdenv, fetchurl, lib }:
let versions =
{
"4.1.0" = "04780c2zks0g76c4n4a2cbbhs1qz4lza4ffiw1fj0md3f1lxihr5";
"4.2.0" = "0p4x0zza6y18hjjs1971gyc5kjd2f8nzzynp2jabhl2vxiys2nnj";
};
in stdenv.mkDerivation
{
pname = "aocl";
inherit version;
src = fetchurl
{
url = "https://download.amd.com/developer/eula/aocl/aocl-"
+ builtins.concatStringsSep "-" (lib.lists.take 2 (builtins.splitVersion version))
+ "/aocl-linux-aocc-${version}.tar.gz";
sha256 = versions.${version};
};
dontBuild = true;
installPhase =
''
installDir=$(mktemp -d)
bash ./install.sh -t $installDir
mkdir -p $out
cp -r $installDir/${version}/aocc/lib_LP64 $out/lib
cp -r $installDir/${version}/aocc/include_LP64 $out/include
'';
dontFixup = true;
}

View File

@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.14)
project(biu LANGUAGES CXX)
enable_testing()
include(GNUInstallDirs)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message("Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
find_package(magic_enum REQUIRED)
find_package(fmt REQUIRED)
find_package(Boost REQUIRED COMPONENTS headers iostreams)
# find_package(concurrencpp REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(range-v3 REQUIRED)
find_path(NAMEOF_INCLUDE_DIR nameof.hpp REQUIRED)
# find_path(TGBOTCPP_INCLUDE_DIR tgbot/tgbot.h REQUIRED)
# find_library(TGBOTCPP_LIB libTgBot.a REQUIRED)
# find_path(BACKTRACE_INCLUDE_DIR backtrace.h REQUIRED)
# find_library(BACKTRACE_LIB backtrace REQUIRED)
# add_library(biu SHARED src/common.cpp src/logger.cpp src/string.cpp)
add_library(biu SHARED src/common.cpp)
target_include_directories(biu PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${NAMEOF_INCLUDE_DIR} ${TGBOTCPP_INCLUDE_DIR})
target_link_libraries(biu PUBLIC
magic_enum::magic_enum
fmt::fmt
Boost::headers Boost::iostreams
# concurrencpp::concurrencpp
Eigen3::Eigen
range-v3::range-v3)
# ${TGBOTCPP_LIB} ${BACKTRACE_LIB})
set_property(TARGET biu PROPERTY CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF)
install(TARGETS biu EXPORT biuConfig)
install(EXPORT biuConfig NAMESPACE ${PROJECT_NAME}:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/biu)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")

View File

@@ -0,0 +1,10 @@
{
stdenv, cmake,
magic-enum, fmt, boost, eigen, range-v3, nameof
}: stdenv.mkDerivation
{
name = "biu";
src = ./.;
buildInputs = [ magic-enum fmt boost eigen range-v3 nameof ];
nativeBuildInputs = [ cmake ];
}

View File

@@ -0,0 +1,10 @@
# pragma once
// # include <biu/atomic/atomic.tpp>
// # include <biu/called_by.hpp>
# include <biu/common.tpp>
// # include <biu/concepts.tpp>
// # include <biu/format.tpp>
// # include <biu/logger.tpp>
// # include <biu/smartref.tpp>
// # include <biu/string.tpp>
# include <biu/eigen.hpp>

View File

@@ -0,0 +1,41 @@
# pragma once
# include <biu/logger.hpp>
namespace biu::detail_
{
template <DecayedType ValueType> class AtomicBase<ValueType, true>
: public Logger::ObjectMonitor<Atomic<ValueType, true>>, protected AtomicBase<ValueType, false>
{
using DeepBase_ = AtomicBase<ValueType, false>;
using DeepBase_::AtomicBase;
public: class TimeoutException : public Logger::Exception<TimeoutException>
{
using Logger::Exception<TimeoutException>::Exception;
};
protected: template
<
bool ReturnFunctionResult,
typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t, bool Nothrow = false
> static auto apply_
(
auto&& atomic, auto&& function,
ConditionFunction&& condition_function = nullptr, Duration timeout = nullptr
) -> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(atomic), ReturnFunctionResult, ConditionFunction, Duration, Nothrow>
requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(atomic), ConditionFunction, Duration>;
protected: template <bool Nothrow = false, typename Duration = std::nullptr_t> static auto wait_
(auto&& atomic, auto&& condition_function, Duration timeout = nullptr)
-> DeepBase_::template WaitReturnType_<decltype(atomic), decltype(condition_function), Duration, Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), Duration>;
protected: template
<bool Nothrow = false, typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t>
static auto lock_
(auto&& atomic, ConditionFunction&& condition_function = nullptr, Duration timeout = nullptr)
-> DeepBase_::template LockReturnType_<decltype(atomic), Duration, Nothrow>
requires DeepBase_::template LockConstraint_<ConditionFunction, Duration>;
};
}

View File

@@ -0,0 +1,267 @@
# pragma once
# include <mutex>
# include <optional>
# include <condition_variable>
# include <cstddef>
# include <experimental/memory>
# include <biu/common.hpp>
# include <biu/concepts.hpp>
# include <biu/called_by.hpp>
namespace biu
{
template <DecayedType ValueType, bool UseLogger = true> class Atomic;
namespace detail_
{
template <DecayedType ValueType, bool UseLogger> class AtomicBase;
template <DecayedType ValueType> class AtomicBase<ValueType, false>
{
protected: mutable std::recursive_mutex Mutex_;
protected: mutable std::condition_variable_any ConditionVariable_;
protected: ValueType Value_;
AtomicBase() = default;
AtomicBase(const ValueType& value);
AtomicBase(ValueType&& value);
public: class TimeoutException : public std::exception
{
protected: std::string Message_;
public: explicit TimeoutException(std::string message);
public: const char* what() const noexcept override;
};
// Apply a function to stored value.
// Wait for some time (if provided) until condition funciton returns true (if provided)
// before applying the function.
protected: template
<
typename Function, typename Atomic,
typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t
>
constexpr static bool ApplyConstraint_ =
(
(std::invocable<Function, MoveQualifiers<Atomic, ValueType>> && std::is_null_pointer_v<ConditionFunction>)
|| (
InvocableWithResult<ConditionFunction, bool, const ValueType&>
&& (std::is_null_pointer_v<Duration> || SpecializationOf<Duration, std::chrono::duration>)
)
);
protected: template
<
typename Function, typename Atomic, bool ReturnFunctionResult,
typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t,
bool Nothrow = false
> using ApplyReturnType_ = std::conditional_t
<
Nothrow,
std::conditional_t
<
ReturnFunctionResult && !std::is_void_v<std::invoke_result<Function, ValueType>>,
std::optional<std::remove_cvref_t<FallbackIfNoTypeDeclared<std::invoke_result
<Function, MoveQualifiers<Atomic, ValueType>, int>>>>,
bool
>,
std::conditional_t
<
ReturnFunctionResult,
std::invoke_result_t<Function, MoveQualifiers<Atomic, ValueType>>,
Atomic&&
>
>;
protected: template
<
bool ReturnFunctionResult,
typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t,
bool Nothrow = false
> static auto apply_
(
auto&& atomic, auto&& function,
ConditionFunction&& condition_function = nullptr, Duration timeout = nullptr
) -> ApplyReturnType_
<decltype(function), decltype(atomic), ReturnFunctionResult, ConditionFunction, Duration, Nothrow>
requires ApplyConstraint_<decltype(function), decltype(atomic), ConditionFunction, Duration>;
// Wait until condition funciton returns true, with an optional timeout
protected: template <typename ConditionFunction, typename Duration = std::nullptr_t>
constexpr static bool WaitConstraint_
= (InvocableWithResult<ConditionFunction, bool, const ValueType&>
&& (std::is_null_pointer_v<Duration> || SpecializationOf<Duration, std::chrono::duration>));
protected: template
<typename Atomic, typename ConditionFunction, typename Duration = std::nullptr_t, bool Nothrow = false>
using WaitReturnType_
= std::conditional_t<Nothrow && !std::is_null_pointer_v<Duration>, bool, Atomic&&>;
protected: template <bool Nothrow = false, typename Duration = std::nullptr_t> static auto wait_
(auto&& atomic, auto&& condition_function, Duration timeout = nullptr)
-> WaitReturnType_<decltype(atomic), decltype(condition_function), Duration, Nothrow>
requires WaitConstraint_<decltype(condition_function), Duration>;
protected: template <typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t>
constexpr static bool LockConstraint_
= std::is_null_pointer_v<ConditionFunction> ||
(
InvocableWithResult<ConditionFunction, bool, const ValueType&>
&& (std::is_null_pointer_v<Duration> || SpecializationOf<Duration, std::chrono::duration>)
);
protected: template <typename Atomic, typename Duration = std::nullptr_t, bool Nothrow = false>
using LockReturnType_
= std::conditional_t
<
Nothrow && !std::is_null_pointer_v<Duration>,
std::optional<std::conditional_t
<
std::is_const_v<Atomic>,
typename std::remove_reference_t<Atomic>::template Guard<true>,
typename std::remove_reference_t<Atomic>::template Guard<false>
>>,
std::conditional_t
<
std::is_const_v<Atomic>,
typename std::remove_reference_t<Atomic>::template Guard<true>,
typename std::remove_reference_t<Atomic>::template Guard<false>
>
>;
protected: template
<bool Nothrow = false, typename ConditionFunction = std::nullptr_t, typename Duration = std::nullptr_t>
static auto lock_
(auto&& atomic, ConditionFunction&& condition_function = nullptr, Duration timeout = nullptr)
-> LockReturnType_<decltype(atomic), Duration, Nothrow>
requires LockConstraint_<ConditionFunction, Duration>;
};
}
// Thread safe wrapper of custom class
template <DecayedType ValueType, bool UseLogger> class Atomic : public detail_::AtomicBase<ValueType, UseLogger>
{
public: Atomic() = default;
public: Atomic(const ValueType& value);
public: Atomic(ValueType&& value);
public: template <bool OtherUseLogger> Atomic(const Atomic<ValueType, OtherUseLogger>& other);
public: template <bool OtherUseLogger> Atomic(Atomic<ValueType, OtherUseLogger>&& other);
public: Atomic<ValueType, UseLogger>& operator=(const ValueType& value);
public: Atomic<ValueType, UseLogger>& operator=(ValueType&& value);
public: template <bool OtherUseLogger>
Atomic<ValueType, UseLogger>& operator=(const Atomic<ValueType, OtherUseLogger>& other);
public: template <bool OtherUseLogger>
Atomic<ValueType, UseLogger>& operator=(Atomic<ValueType, OtherUseLogger>&& other);
public: ValueType get() const&;
public: ValueType get() &&;
public: operator ValueType() const&;
public: operator ValueType() &&;
protected: using DeepBase_ = detail_::AtomicBase<ValueType, false>;
public: template <bool ReturnFunctionResult = false> auto apply(auto&& function) const&
-> DeepBase_::template ApplyReturnType_<decltype(function), decltype(*this), ReturnFunctionResult>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this)>;
public: template <bool ReturnFunctionResult = false> auto apply(auto&& function) &
-> DeepBase_::template ApplyReturnType_<decltype(function), decltype(*this), ReturnFunctionResult>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this)>;
public: template <bool ReturnFunctionResult = false> auto apply(auto&& function) &&
-> DeepBase_::template ApplyReturnType_<decltype(function), decltype(*this), ReturnFunctionResult>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this)>;
public: template <bool ReturnFunctionResult = false>
auto apply(auto&& function, auto&& condition_function) const&
-> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(*this), ReturnFunctionResult, decltype(condition_function)>
requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function)>;
public: template <bool ReturnFunctionResult = false> auto apply(auto&& function, auto&& condition_function) &
-> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(*this), ReturnFunctionResult, decltype(condition_function)>
requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function)>;
public: template <bool ReturnFunctionResult = false> auto apply(auto&& function, auto&& condition_function) &&
-> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(*this), ReturnFunctionResult, decltype(condition_function)>
requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function)>;
public: template <bool ReturnFunctionResult = false, bool Nothrow = false>
auto apply(auto&& function, auto&& condition_function, auto timeout) const&
-> DeepBase_::template ApplyReturnType_
<
decltype(function), decltype(*this), ReturnFunctionResult,
decltype(condition_function), decltype(timeout), Nothrow
> requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function), decltype(timeout)>;
public: template <bool ReturnFunctionResult = false, bool Nothrow = false>
auto apply(auto&& function, auto&& condition_function, auto timeout) &
-> DeepBase_::template ApplyReturnType_
<
decltype(function), decltype(*this), ReturnFunctionResult,
decltype(condition_function), decltype(timeout), Nothrow
> requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function), decltype(timeout)>;
public: template <bool ReturnFunctionResult = false, bool Nothrow = false>
auto apply(auto&& function, auto&& condition_function, auto timeout) &&
-> DeepBase_::template ApplyReturnType_
<
decltype(function), decltype(*this), ReturnFunctionResult,
decltype(condition_function), decltype(timeout), Nothrow
> requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function), decltype(timeout)>;
public: auto wait(auto&& condition_function) const&
-> DeepBase_::template WaitReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template WaitConstraint_<decltype(condition_function)>;
public: auto wait(auto&& condition_function) &
-> DeepBase_::template WaitReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template WaitConstraint_<decltype(condition_function)>;
public: auto wait(auto&& condition_function) &&
-> DeepBase_::template WaitReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template WaitConstraint_<decltype(condition_function)>;
public: template <bool Nothrow = false> auto wait(auto&& condition_function, auto timeout) const&
-> DeepBase_::template WaitReturnType_
<decltype(*this), decltype(condition_function), decltype(timeout), Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), decltype(timeout)>;
public: template <bool Nothrow = false> auto wait(auto&& condition_function, auto timeout) &
-> DeepBase_::template WaitReturnType_
<decltype(*this), decltype(condition_function), decltype(timeout), Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), decltype(timeout)>;
public: template <bool Nothrow = false> auto wait(auto&& condition_function, auto timeout) &&
-> DeepBase_::template WaitReturnType_
<decltype(*this), decltype(condition_function), decltype(timeout), Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), decltype(timeout)>;
// Attain lock from outside when constructing, and release when destructing.
// For non-const variant, When destructing, ConditionVariable_.notify_all() is called.
public: template <bool Const> class Guard
{
protected: std::unique_lock<std::recursive_mutex> Lock_;
protected: std::experimental::observer_ptr
<std::conditional_t<Const, const Atomic<ValueType, UseLogger>, Atomic<ValueType, UseLogger>>> Value_;
public: template <bool OtherConst> Guard(const Guard<OtherConst>& other) requires (Const || !OtherConst);
public: Guard
(decltype(Lock_)&& lock, decltype(Value_) value, CalledBy<detail_::AtomicBase<ValueType, UseLogger>>);
public: ~Guard();
public: std::conditional_t<Const, const ValueType&, ValueType&> operator*() const&;
public: std::conditional_t<Const, const ValueType*, ValueType*> operator->() const&;
public: std::conditional_t<Const, const ValueType&, ValueType&> value() const&;
public: auto operator*() const&& = delete;
public: auto operator->() const&& = delete;
public: auto value() const&& = delete;
};
public: auto lock() const& -> DeepBase_::template LockReturnType_<decltype(*this)>
requires DeepBase_::template LockConstraint_<>;
public: auto lock() & -> DeepBase_::template LockReturnType_<decltype(*this)>
requires DeepBase_::template LockConstraint_<>;
public: auto lock() const&& = delete;
public: auto lock(auto&& condition_function) const&
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template LockConstraint_<decltype(condition_function)>;
public: auto lock(auto&& condition_function) &
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template LockConstraint_<decltype(condition_function)>;
public: auto lock(auto&& condition_function) const&& = delete;
public: template <bool Nothrow = false> auto lock(auto&& condition_function, auto timeout) const&
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(timeout), Nothrow>
requires DeepBase_::template LockConstraint_<decltype(condition_function), decltype(timeout)>;
public: template <bool Nothrow = false> auto lock(auto&& condition_function, auto timeout) &
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(timeout), Nothrow>
requires DeepBase_::template LockConstraint_<decltype(condition_function), decltype(timeout)>;
public: template <bool Nothrow = false> auto lock(auto&& condition_function, auto timeout) const&& = delete;
};
}

View File

@@ -0,0 +1,366 @@
# pragma once
# include <biu/atomic/nolog.hpp>
namespace biu
{
template <DecayedType ValueType> detail_::AtomicBase<ValueType, false>::AtomicBase(const ValueType& value)
: Value_{value} {}
template <DecayedType ValueType> detail_::AtomicBase<ValueType, false>::AtomicBase(ValueType&& value)
: Value_{std::move(value)} {}
template <DecayedType ValueType>
detail_::AtomicBase<ValueType, false>::TimeoutException::TimeoutException(std::string)
: Message_{"TimeoutException"} {}
template <DecayedType ValueType>
const char* detail_::AtomicBase<ValueType, false>::TimeoutException::what() const noexcept
{return Message_.c_str();}
template <DecayedType ValueType>
template <bool ReturnFunctionResult, typename ConditionFunction, typename Duration, bool Nothrow>
auto detail_::AtomicBase<ValueType, false>::apply_
(auto&& atomic, auto&& function, ConditionFunction&& condition_function, Duration timeout)
-> ApplyReturnType_
<decltype(function), decltype(atomic), ReturnFunctionResult, ConditionFunction, Duration, Nothrow>
requires ApplyConstraint_<decltype(function), decltype(atomic), ConditionFunction, Duration>
{
std::unique_lock lock{atomic.Mutex_};
// try to meet the condition
if constexpr (!std::is_null_pointer_v<ConditionFunction>)
{
if constexpr (std::is_null_pointer_v<Duration>)
atomic.ConditionVariable_.wait(lock, [&]
{return std::forward<ConditionFunction>(condition_function)(std::as_const(atomic.Value_));});
else if (!atomic.ConditionVariable_.wait_for(lock, timeout, [&]
{return std::forward<ConditionFunction>(condition_function)(std::as_const(atomic.Value_));}))
{
if constexpr (Nothrow)
{
if constexpr
(ReturnFunctionResult && !std::is_void_v<std::invoke_result_t<decltype(function), ValueType>>)
return std::nullopt;
else return false;
}
else throw TimeoutException{};
}
}
// apply the function and return
if constexpr (ReturnFunctionResult && !std::is_void_v<std::invoke_result_t<decltype(function), ValueType>>)
{
auto&& result = std::forward<decltype(function)>(function)
(static_cast<MoveQualifiers<decltype(atomic), ValueType>&&>(atomic.Value_));
if constexpr (!std::is_const_v<decltype(atomic)>) atomic.ConditionVariable_.notify_all();
return std::forward<decltype(result)>(result);
}
else
{
std::forward<decltype(function)>(function)
(static_cast<MoveQualifiers<decltype(atomic), ValueType>&&>(atomic.Value_));
if constexpr (!std::is_const_v<decltype(atomic)>) atomic.ConditionVariable_.notify_all();
if constexpr (ReturnFunctionResult && std::is_void_v<std::invoke_result_t<decltype(function), ValueType>>)
return;
else return std::forward<decltype(atomic)>(atomic);
}
}
template <DecayedType ValueType> template <bool Nothrow, typename Duration>
auto detail_::AtomicBase<ValueType, false>::wait_(auto&& atomic, auto&& condition_function, Duration timeout)
-> WaitReturnType_<decltype(atomic), decltype(condition_function), Duration, Nothrow>
requires WaitConstraint_<decltype(condition_function), Duration>
{
std::unique_lock lock{atomic.Mutex_};
if constexpr (std::is_null_pointer_v<Duration>)
{
atomic.ConditionVariable_.wait(lock, [&]
{return std::forward<decltype(condition_function)>(condition_function)(std::as_const(atomic.Value_));});
return std::forward<decltype(atomic)>(atomic);
}
else
{
if (!atomic.ConditionVariable_.wait_for(lock, timeout, [&]
{return std::forward<decltype(condition_function)>(condition_function)(std::as_const(atomic.Value_));}))
{
if constexpr (Nothrow) return false;
else throw TimeoutException{};
}
else
{
if constexpr (Nothrow) return true;
else return std::forward<decltype(atomic)>(atomic);
}
}
}
template <DecayedType ValueType> template <bool Nothrow, typename ConditionFunction, typename Duration>
auto detail_::AtomicBase<ValueType, false>::lock_
(auto&& atomic, ConditionFunction&& condition_function, Duration timeout)
-> LockReturnType_<decltype(atomic), Duration, Nothrow> requires LockConstraint_<ConditionFunction, Duration>
{
if constexpr (std::is_null_pointer_v<ConditionFunction>)
return {std::unique_lock{atomic.Mutex_}, std::experimental::make_observer(&atomic), {}};
else if constexpr (std::is_null_pointer_v<Duration>)
{
std::unique_lock lock{atomic.Mutex_};
atomic.ConditionVariable_.wait(lock, [&]
{return std::forward<ConditionFunction>(condition_function)(std::as_const(atomic.Value_));});
return {std::move(lock), std::experimental::make_observer(&atomic), {}};
}
else
{
std::unique_lock lock{atomic.Mutex_};
if (!atomic.ConditionVariable_.wait_for(lock, timeout, [&]
{return std::forward<ConditionFunction>(condition_function)(std::as_const(atomic.Value_));}))
{
if constexpr (Nothrow) return std::nullopt;
else throw TimeoutException{};
}
else
return {{std::move(lock), std::experimental::make_observer(&atomic), {}}};
}
}
template <DecayedType ValueType, bool UseLogger> Atomic<ValueType, UseLogger>::Atomic(const ValueType& value)
: detail_::AtomicBase<ValueType, UseLogger>{value} {}
template <DecayedType ValueType, bool UseLogger> Atomic<ValueType, UseLogger>::Atomic(ValueType&& value)
: detail_::AtomicBase<ValueType, UseLogger>{std::move(value)} {}
template <DecayedType ValueType, bool UseLogger> template <bool OtherUseLogger>
Atomic<ValueType, UseLogger>::Atomic(const Atomic<ValueType, OtherUseLogger>& other)
: detail_::AtomicBase<ValueType, UseLogger>{other} {}
template <DecayedType ValueType, bool UseLogger> template <bool OtherUseLogger>
Atomic<ValueType, UseLogger>::Atomic(Atomic<ValueType, OtherUseLogger>&& other)
: detail_::AtomicBase<ValueType, UseLogger>{std::move(other)} {}
template <DecayedType ValueType, bool UseLogger>
Atomic<ValueType, UseLogger>& Atomic<ValueType, UseLogger>::operator=(const ValueType& value)
{
std::scoped_lock lock{DeepBase_::Mutex_};
DeepBase_::Value_ = value;
DeepBase_::ConditionVariable_.notify_all();
return *this;
}
template <DecayedType ValueType, bool UseLogger>
Atomic<ValueType, UseLogger>& Atomic<ValueType, UseLogger>::operator=(ValueType&& value)
{
std::scoped_lock lock{DeepBase_::Mutex_};
DeepBase_::Value_ = std::move(value);
DeepBase_::ConditionVariable_.notify_all();
return *this;
}
template <DecayedType ValueType, bool UseLogger> template <bool OtherUseLogger>
Atomic<ValueType, UseLogger>& operator=(const Atomic<ValueType, OtherUseLogger>& other)
{
std::scoped_lock lock{DeepBase_::Mutex_};
DeepBase_::Value_ = value;
DeepBase_::ConditionVariable_.notify_all();
return *this;
}
template <DecayedType ValueType, bool UseLogger> template <bool OtherUseLogger>
Atomic<ValueType, UseLogger>& operator=(Atomic<ValueType, OtherUseLogger>&& other)
{
std::scoped_lock lock{DeepBase_::Mutex_};
DeepBase_::Value_ = std::move(value);
DeepBase_::ConditionVariable_.notify_all();
return *this;
}
template <DecayedType ValueType, bool UseLogger> ValueType Atomic<ValueType, UseLogger>::get() const&
{
std::scoped_lock lock{DeepBase_::Mutex_};
return DeepBase_::Value_;
}
template <DecayedType ValueType, bool UseLogger> ValueType Atomic<ValueType, UseLogger>::get() &&
{
std::scoped_lock lock{DeepBase_::Mutex_};
return std::move(DeepBase_::Value_);
}
template <DecayedType ValueType, bool UseLogger> Atomic<ValueType, UseLogger>::operator ValueType() const&
{return get();}
template <DecayedType ValueType, bool UseLogger> Atomic<ValueType, UseLogger>::operator ValueType() &&
{return std::move(*this).get();}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult>
auto Atomic<ValueType, UseLogger>::apply(auto&& function) const&
-> DeepBase_::template ApplyReturnType_<decltype(function), decltype(*this), ReturnFunctionResult>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this)>
{return apply_<ReturnFunctionResult>(*this, std::forward<decltype(function)>(function));}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult>
auto Atomic<ValueType, UseLogger>::apply(auto&& function) &
-> DeepBase_::template ApplyReturnType_<decltype(function), decltype(*this), ReturnFunctionResult>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this)>
{return apply_<ReturnFunctionResult>(*this, std::forward<decltype(function)>(function));}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult>
auto Atomic<ValueType, UseLogger>::apply(auto&& function) &&
-> DeepBase_::template ApplyReturnType_<decltype(function), decltype(*this), ReturnFunctionResult>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this)>
{return apply_<ReturnFunctionResult>(std::move(*this), std::forward<decltype(function)>(function));}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult>
auto Atomic<ValueType, UseLogger>::apply(auto&& function, auto&& condition_function) const&
-> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(*this), ReturnFunctionResult, decltype(condition_function)>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this), decltype(condition_function)>
{
return apply_<ReturnFunctionResult>
(
*this, std::forward<decltype(function)>(function),
std::forward<decltype(condition_function)>(condition_function)
);
}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult>
auto Atomic<ValueType, UseLogger>::apply(auto&& function, auto&& condition_function) &
-> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(*this), ReturnFunctionResult, decltype(condition_function)>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this), decltype(condition_function)>
{
return apply_<ReturnFunctionResult>
(
*this, std::forward<decltype(function)>(function),
std::forward<decltype(condition_function)>(condition_function)
);
}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult>
auto Atomic<ValueType, UseLogger>::apply(auto&& function, auto&& condition_function) &&
-> DeepBase_::template ApplyReturnType_
<decltype(function), decltype(*this), ReturnFunctionResult, decltype(condition_function)>
requires DeepBase_::template ApplyConstraint_<decltype(function), decltype(*this), decltype(condition_function)>
{
return apply_<ReturnFunctionResult>
(
std::move(*this), std::forward<decltype(function)>(function),
std::forward<decltype(condition_function)>(condition_function)
);
}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult, bool Nothrow>
auto Atomic<ValueType, UseLogger>::apply(auto&& function, auto&& condition_function, auto timeout) const&
-> DeepBase_::template ApplyReturnType_
<
decltype(function), decltype(*this), ReturnFunctionResult,
decltype(condition_function), decltype(timeout), Nothrow
> requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function), decltype(timeout)>
{
return apply_<ReturnFunctionResult, Nothrow>
(
*this, std::forward<decltype(function)>(function),
std::forward<decltype(condition_function)>(condition_function), timeout
);
}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult, bool Nothrow>
auto Atomic<ValueType, UseLogger>::apply(auto&& function, auto&& condition_function, auto timeout) &
-> DeepBase_::template ApplyReturnType_
<
decltype(function), decltype(*this), ReturnFunctionResult,
decltype(condition_function), decltype(timeout), Nothrow
> requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function), decltype(timeout)>
{
return apply_<ReturnFunctionResult, Nothrow>
(
*this, std::forward<decltype(function)>(function),
std::forward<decltype(condition_function)>(condition_function), timeout
);
}
template <DecayedType ValueType, bool UseLogger> template <bool ReturnFunctionResult, bool Nothrow>
auto Atomic<ValueType, UseLogger>::apply(auto&& function, auto&& condition_function, auto timeout) &&
-> DeepBase_::template ApplyReturnType_
<
decltype(function), decltype(*this), ReturnFunctionResult,
decltype(condition_function), decltype(timeout), Nothrow
> requires DeepBase_::template ApplyConstraint_
<decltype(function), decltype(*this), decltype(condition_function), decltype(timeout)>
{
return apply_<ReturnFunctionResult, Nothrow>
(
std::move(*this), std::forward<decltype(function)>(function),
std::forward<decltype(condition_function)>(condition_function), timeout
);
}
template <DecayedType ValueType, bool UseLogger>
auto Atomic<ValueType, UseLogger>::wait(auto&& condition_function) const&
-> DeepBase_::template WaitReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template WaitConstraint_<decltype(condition_function)>
{return wait_(*this, std::forward<decltype(condition_function)>(condition_function));}
template <DecayedType ValueType, bool UseLogger>
auto Atomic<ValueType, UseLogger>::wait(auto&& condition_function) &
-> DeepBase_::template WaitReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template WaitConstraint_<decltype(condition_function)>
{return wait_(*this, std::forward<decltype(condition_function)>(condition_function));}
template <DecayedType ValueType, bool UseLogger>
auto Atomic<ValueType, UseLogger>::wait(auto&& condition_function) &&
-> DeepBase_::template WaitReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template WaitConstraint_<decltype(condition_function)>
{return wait_(std::move(*this), std::forward<decltype(condition_function)>(condition_function));}
template <DecayedType ValueType, bool UseLogger> template <bool Nothrow>
auto Atomic<ValueType, UseLogger>::wait(auto&& condition_function, auto timeout) const&
-> DeepBase_::template WaitReturnType_
<decltype(*this), decltype(condition_function), decltype(timeout), Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), decltype(timeout)>
{return wait_<Nothrow>(*this, std::forward<decltype(condition_function)>(condition_function), timeout);}
template <DecayedType ValueType, bool UseLogger> template <bool Nothrow>
auto Atomic<ValueType, UseLogger>::wait(auto&& condition_function, auto timeout) &
-> DeepBase_::template WaitReturnType_
<decltype(*this), decltype(condition_function), decltype(timeout), Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), decltype(timeout)>
{return wait_<Nothrow>(*this, std::forward<decltype(condition_function)>(condition_function), timeout);}
template <DecayedType ValueType, bool UseLogger> template <bool Nothrow>
auto Atomic<ValueType, UseLogger>::wait(auto&& condition_function, auto timeout) &&
-> DeepBase_::template WaitReturnType_
<decltype(*this), decltype(condition_function), decltype(timeout), Nothrow>
requires DeepBase_::template WaitConstraint_<decltype(condition_function), decltype(timeout)>
{
return wait_<Nothrow>
(std::move(*this), std::forward<decltype(condition_function)>(condition_function), timeout);
}
template <DecayedType ValueType, bool UseLogger> template <bool Const> template <bool OtherConst>
Atomic<ValueType, UseLogger>::Guard<Const>::Guard(const Guard<OtherConst>& other)
requires (Const || !OtherConst)
: Lock_{other.Lock_}, Value_{other.Value_} {}
template <DecayedType ValueType, bool UseLogger> template <bool Const>
Atomic<ValueType, UseLogger>::Guard<Const>::Guard
(decltype(Lock_)&& lock, decltype(Value_) value, CalledBy<detail_::AtomicBase<ValueType, UseLogger>>)
: Lock_{std::move(lock)}, Value_{value} {}
template <DecayedType ValueType, bool UseLogger> template <bool Const>
Atomic<ValueType, UseLogger>::Guard<Const>::~Guard()
{Value_->ConditionVariable_.notify_all();}
template <DecayedType ValueType, bool UseLogger> template <bool Const>
std::conditional_t<Const, const ValueType&, ValueType&>
Atomic<ValueType, UseLogger>::Guard<Const>::operator*() const&
{return Value_->Value_;}
template <DecayedType ValueType, bool UseLogger> template <bool Const>
std::conditional_t<Const, const ValueType*, ValueType*>
Atomic<ValueType, UseLogger>::Guard<Const>::operator->() const&
{return &Value_->Value_;}
template <DecayedType ValueType, bool UseLogger> template <bool Const>
std::conditional_t<Const, const ValueType&, ValueType&>
Atomic<ValueType, UseLogger>::Guard<Const>::value() const&
{return Value_->Value_;}
template <DecayedType ValueType, bool UseLogger> auto Atomic<ValueType, UseLogger>::lock() const&
-> DeepBase_::template LockReturnType_<decltype(*this)> requires DeepBase_::template LockConstraint_<>
{return lock_(*this);}
template <DecayedType ValueType, bool UseLogger> auto Atomic<ValueType, UseLogger>::lock() &
-> DeepBase_::template LockReturnType_<decltype(*this)> requires DeepBase_::template LockConstraint_<>
{return lock_(*this);}
template <DecayedType ValueType, bool UseLogger>
auto Atomic<ValueType, UseLogger>::lock(auto&& condition_function) const&
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template LockConstraint_<decltype(condition_function)>
{return lock_(*this, condition_function);}
template <DecayedType ValueType, bool UseLogger>
auto Atomic<ValueType, UseLogger>::lock(auto&& condition_function) &
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(condition_function)>
requires DeepBase_::template LockConstraint_<decltype(condition_function)>
{return lock_(*this, condition_function);}
template <DecayedType ValueType, bool UseLogger> template <bool Nothrow>
auto Atomic<ValueType, UseLogger>::lock(auto&& condition_function, auto timeout) const&
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(timeout), Nothrow>
requires DeepBase_::template LockConstraint_<decltype(condition_function), decltype(timeout)>
{return lock_<Nothrow>(*this, condition_function, timeout);}
template <DecayedType ValueType, bool UseLogger> template <bool Nothrow>
auto Atomic<ValueType, UseLogger>::lock(auto&& condition_function, auto timeout) &
-> DeepBase_::template LockReturnType_<decltype(*this), decltype(timeout), Nothrow>
requires DeepBase_::template LockConstraint_<decltype(condition_function), decltype(timeout)>
{return lock_<Nothrow>(*this, condition_function, timeout);}
}

View File

@@ -0,0 +1,10 @@
# pragma once
namespace biu
{
template <typename AllowedType> class CalledBy
{
protected: CalledBy() = default;
friend AllowedType;
};
}

View File

@@ -0,0 +1,66 @@
# pragma once
# include <regex>
# include <fmt/format.h>
# include <magic_enum.hpp>
namespace biu
{
std::size_t hash(auto&&... objs);
[[gnu::always_inline]] void unused(auto&&...);
using uint128_t = __uint128_t;
inline namespace literals
{
using namespace std::literals;
using namespace fmt::literals;
std::regex operator""_re(const char* str, std::size_t len);
}
inline namespace stream_operators { using namespace magic_enum::iostream_operators; }
struct CaseInsensitiveStringLessComparator
{
template <typename String> constexpr bool operator()(const String& s1, const String& s2) const;
};
namespace detail_
{
template <typename T> struct RemoveMemberPointerHelper { using Type = T; };
template <typename Class, typename Member> struct RemoveMemberPointerHelper<Member Class::*>
{ using Type = Member; };
}
template <typename MemberPointer> using RemoveMemberPointer
= typename detail_::RemoveMemberPointerHelper<MemberPointer>::Type;
[[noreturn]] void block_forever();
namespace detail_
{
template <typename From, typename To> struct MoveQualifiersHelper
{
protected: static constexpr bool Const_ = std::is_const_v<From>;
protected: static constexpr bool Volatile_ = std::is_volatile_v<From>;
protected: static constexpr bool Reference_ = std::is_reference_v<From>;
protected: static constexpr bool Lvalue_ = std::is_lvalue_reference_v<From>;
protected: using NoCvrefType_ = std::remove_cvref_t<To>;
protected: using NoCvType_
= std::conditional_t<Reference_, std::conditional_t<Lvalue_, NoCvrefType_&, NoCvrefType_&&>, NoCvrefType_>;
protected: using NoConstType_ = std::conditional_t<Volatile_, volatile NoCvType_, NoCvType_>;
public: using Type = std::conditional_t<Const_, const NoConstType_, NoConstType_>;
};
}
template <typename From, typename To> using MoveQualifiers
= typename detail_::MoveQualifiersHelper<From, To>::Type;
namespace detail_
{
template <typename T, typename Fallback = void> struct FallbackIfNoTypeDeclaredHelper { using Type = Fallback; };
template <typename T, typename Fallback> requires requires { typename T::Type; }
struct FallbackIfNoTypeDeclaredHelper<T, Fallback> { using Type = typename T::Type; };
template <typename T, typename Fallback> requires requires {typename T::type;}
struct FallbackIfNoTypeDeclaredHelper<T, Fallback> { using Type = typename T::type; };
}
template <typename T, typename Fallback = void> using FallbackIfNoTypeDeclared
= typename detail_::FallbackIfNoTypeDeclaredHelper<T, Fallback>::Type;
}

View File

@@ -0,0 +1,24 @@
# pragma once
# include <boost/functional/hash.hpp>
# include <biu/common.hpp>
namespace biu
{
inline void unused(auto&&...) {}
inline std::size_t hash(auto&&... objs)
{
std::size_t result = 0;
(boost::hash_combine(result, objs), ...);
return result;
}
template <typename String> inline constexpr bool CaseInsensitiveStringLessComparator::operator()
(const String& s1, const String& s2) const
{
return std::lexicographical_compare
(
s1.begin(), s1.end(), s2.begin(), s2.end(),
[](char c1, char c2){return std::tolower(c1) < std::tolower(c2);}
);
}
}

View File

@@ -0,0 +1,47 @@
# pragma once
# include <concepts>
# include <tuple>
# include <type_traits>
# include <complex>
namespace biu
{
template <typename T> concept DecayedType = std::same_as<std::decay_t<T>, T>;
namespace detail_::specialization_of_detail_
{
template <typename Tuple> struct DropFirstMemberOfTupleHelper;
template <typename First, typename... Others> struct DropFirstMemberOfTupleHelper<std::tuple<First, Others...>>
{using Type = std::tuple<Others...>;};
template <typename ProvidedArgs, typename ActualArgs> consteval bool check_provided_args();
template <typename Class, template <typename...> typename Template> struct SpecializationOfHelper
{template <typename... ProvidedArgs> consteval static bool check_provided_args();};
template <template <typename...> typename Template, typename... ActualArgs>
struct SpecializationOfHelper<Template<ActualArgs...>, Template>
{template <typename... ProvidedArgs> consteval static bool check_provided_args();};
}
template <typename Class, template <typename...> typename Template, typename... ProvidedArgs>
concept SpecializationOf
= detail_::specialization_of_detail_::SpecializationOfHelper<std::decay_t<Class>, Template>
::template check_provided_args<ProvidedArgs...>();
template <typename T> concept CompletedType = sizeof(T) == sizeof(T);
template <typename From, typename To> concept ImplicitlyConvertibleTo = std::is_convertible<From, To>::value;
template <typename To, typename From> concept ImplicitlyConvertibleFrom = std::is_convertible<From, To>::value;
template <typename From, typename To> concept ExplicitlyConvertibleTo = std::is_constructible<To, From>::value;
template <typename To, typename From> concept ExplicitlyConvertibleFrom = std::is_constructible<To, From>::value;
template <typename From, typename To> concept ConvertibleTo
= ImplicitlyConvertibleTo<From, To> || ExplicitlyConvertibleTo<From, To>;
template <typename From, typename To> concept ConvertibleFrom = ConvertibleTo<From, To>;
template <typename Function, auto... Args> concept ConstevalInvokable
= requires() {typename std::type_identity_t<int[(Function()(Args...), 1)]>;};
template <typename T> concept Enumerable = std::is_enum_v<T>;
template <typename Function, typename Result, typename... Args> concept InvocableWithResult
= std::is_invocable_r_v<Result, Function, Args...>;
template <typename T> concept Arithmetic = std::is_arithmetic<T>::value || SpecializationOf<T, std::complex>;
}

View File

@@ -0,0 +1,34 @@
# pragma once
# include <tuple>
# include <biu/concepts.hpp>
namespace biu
{
template <typename ProvidedArgs, typename ActualArgs> consteval bool
detail_::specialization_of_detail_::check_provided_args()
{
if constexpr (std::tuple_size_v<ProvidedArgs> == 0)
return true;
else if constexpr (std::tuple_size_v<ActualArgs> == 0)
return false;
else if constexpr
(std::same_as<std::tuple_element_t<0, ProvidedArgs>, std::tuple_element_t<0, ActualArgs>>)
return check_provided_args
<
typename DropFirstMemberOfTupleHelper<ProvidedArgs>::Type,
typename DropFirstMemberOfTupleHelper<ActualArgs>::Type
>();
else
return false;
}
template <typename Class, template <typename...> typename Template> template <typename... ProvidedArgs> consteval
bool detail_::specialization_of_detail_::SpecializationOfHelper<Class, Template>::check_provided_args()
{ return false; }
template <template <typename...> typename Template, typename... ActualArgs> template <typename... ProvidedArgs>
consteval bool detail_::specialization_of_detail_::SpecializationOfHelper
<Template<ActualArgs...>, Template>::check_provided_args()
{
return specialization_of_detail_::check_provided_args
<std::tuple<ProvidedArgs...>, std::tuple<ActualArgs...>>();
}
}

View File

@@ -0,0 +1,54 @@
# pragma once
# include <vector>
# include <span>
# include <Eigen/Dense>
# include <biu/concepts.hpp>
namespace biu
{
namespace detail_::eigen
{
// user-specified size of destination container: dynamic, unspecified(use default), or fixed
constexpr std::size_t dynamicSize = std::dynamic_extent, unspecifiedSize = std::dynamic_extent - 1;
static_assert(std::dynamic_extent == std::numeric_limits<std::size_t>::max());
// supported types of standard containers
template <typename T, typename Scalar> struct SpecializationOfArrayHelper : std::false_type {};
template <typename Scalar, std::size_t N>
struct SpecializationOfArrayHelper<std::array<Scalar, N>, Scalar> : std::true_type {};
template <typename Scalar, std::size_t N>
struct SpecializationOfArrayHelper<std::array<Scalar, N>, void> : std::true_type {};
template <typename T, typename Scalar = void> concept SpecializationOfArray =
SpecializationOfArrayHelper<T, Scalar>::value;
template <typename T, typename Scalar> concept StandardContainer =
SpecializationOf<T, std::vector, Scalar> || SpecializationOfArray<T, Scalar>;
// helper operator| to specify the size of the destination container
// usage: some_value | toEigen<Row, Col>
template <std::size_t Row, std::size_t Col> struct ToEigenHelper {};
template <std::size_t Row = unspecifiedSize, std::size_t Col = unspecifiedSize>
inline constexpr ToEigenHelper<Row, Col> toEigen;
// convert 1D standard container to Eigen::Vector
// if no size is specified, convert std::vector to dynamic-size Eigen::Vector,
// std::array to fixed-size Eigen::Vector;
// if size is std::dynamic_extent, always convert to dynamic-size Eigen::Vector
// if size is specified as a number, convert to fixed-size Eigen::Vector if specified size equals the size of the
// input, otherwise throw an error
template <template <int N> typename Callback, std::size_t ToSize> auto deduce_eigen_size(auto&& container);
template <Arithmetic T, StandardContainer<T> From, std::size_t ToSize> auto operator|
(const From&, const ToEigenHelper<ToSize, unspecifiedSize>&);
// convert 2D standard container to Eigen::Matrix
// the same rules as above apply
// besides, all rows must have the same size, otherwise throw an error
template
<
Arithmetic T, StandardContainer<T> FromPerRow, StandardContainer<FromPerRow> From,
std::size_t ToRow, std::size_t ToCol
>
auto operator|(const From&, const ToEigenHelper<ToRow, ToCol>&);
// TODO: implement fromEigen
}
inline namespace eigen { using detail_::eigen::toEigen; using detail_::eigen::operator|; }
}

View File

@@ -0,0 +1,29 @@
# pragma once
# include <biu/eigen.hpp>
// TODO: fix biu::logger
// # include <biu/logger.hpp>
# include <range/v3/view.hpp>
namespace biu
{
namespace detail_::eigen
{
template <template <int N> typename Callback, std::size_t ToSize> auto deduce_eigen_size(auto&& from)
{
if constexpr (ToSize == dynamicSize)
return Callback<Eigen::Dynamic>()(from.data(), from.size());
else if constexpr (ToSize == unspecifiedSize)
if constexpr (SpecializationOfArray<decltype(from)>)
return Callback<from.size()>()(from.data());
else
return Callback<Eigen::Dynamic>()(from.data(), from.size());
else
if (from.size() != ToSize)
// TODO: use biu::logger
throw std::invalid_argument("biu::toEigen: size mismatch");
else
return Callback<ToSize>()(from.data());
}
// TODO: implement 2D case
}
}

View File

@@ -0,0 +1,72 @@
# pragma once
# include <variant>
# include <experimental/memory>
# include <fmt/ostream.h>
# include <biu/string.hpp>
# include <biu/concepts.hpp>
namespace biu
{
template <typename T, typename Char = char> concept Formattable = fmt::is_formattable<T, Char>::value;
namespace detail_
{
template <typename Char, Char... c> struct FormatLiteralHelper : protected BasicStaticString<Char, c...>
{template <typename... Param> std::basic_string<Char> operator()(Param&&... param) const;};
}
namespace literals
{template <typename Char, Char... c> consteval detail_::FormatLiteralHelper<Char, c...> operator""_f();}
namespace detail_
{
template <typename T> concept OptionalWrap
= SpecializationOf<T, std::optional> || SpecializationOf<T, std::shared_ptr>
|| SpecializationOf<T, std::weak_ptr> || SpecializationOf<T, std::unique_ptr>
|| SpecializationOf<T, std::experimental::observer_ptr>;
template <typename Wrap> struct UnderlyingTypeOfOptionalWrap;
template <typename Wrap> requires requires() {typename Wrap::value_type;}
struct UnderlyingTypeOfOptionalWrap<Wrap>
{using Type = std::remove_cvref_t<typename Wrap::value_type>;};
template <typename Wrap> requires requires() {typename Wrap::element_type;}
struct UnderlyingTypeOfOptionalWrap<Wrap>
{using Type = std::remove_cvref_t<typename Wrap::element_type>;};
template <typename T> struct FormatterReuseProxy
{
constexpr auto parse(fmt::format_parse_context& ctx)
-> std::invoke_result_t<decltype(&fmt::format_parse_context::begin), fmt::format_parse_context>;
};
template <typename T>
requires (!SpecializationOf<T, std::weak_ptr> && std::default_initializable<fmt::formatter<T>>)
struct FormatterReuseProxy<T> : fmt::formatter<T> {};
}
}
namespace std
{
template <typename Char, typename... Ts> requires (sizeof...(Ts) > 0) basic_ostream<Char>& operator<<
(basic_ostream<Char>& os, const variant<Ts...>& value);
}
namespace fmt
{
using namespace biu::stream_operators;
template <typename Char, biu::detail_::OptionalWrap Wrap> struct formatter<Wrap, Char>
: biu::detail_::FormatterReuseProxy<typename biu::detail_::UnderlyingTypeOfOptionalWrap<Wrap>::Type>
{
template <typename FormatContext> auto format(const Wrap& wrap, FormatContext& ctx)
-> std::invoke_result_t<decltype(&FormatContext::out), FormatContext>;
};
template <typename Char, biu::Enumerable T> struct formatter<T, Char>
{
bool full = false;
constexpr auto parse(fmt::format_parse_context& ctx)
-> std::invoke_result_t<decltype(&fmt::format_parse_context::begin), fmt::format_parse_context>;
template <typename FormatContext> auto format(const T& value, FormatContext& ctx)
-> std::invoke_result_t<decltype(&FormatContext::out), FormatContext>;
};
template <typename Char, typename... Ts> struct formatter<std::variant<Ts...>, Char>
: basic_ostream_formatter<Char> {};
}

View File

@@ -0,0 +1,122 @@
# pragma once
# include <nameof.hpp>
# include <biu/format.hpp>
namespace biu
{
template <typename Char, Char... c> template <typename... Param>
std::basic_string<Char> detail_::FormatLiteralHelper<Char, c...>::operator() (Param&&... param) const
{return fmt::format(BasicStaticString<Char, c...>::StringView, std::forward<Param>(param)...);}
template <typename Char, Char... c> consteval
detail_::FormatLiteralHelper<Char, c...> literals::operator""_f()
{return {};}
template <typename T> constexpr
auto detail_::FormatterReuseProxy<T>::parse(fmt::format_parse_context& ctx)
-> std::invoke_result_t<decltype(&fmt::format_parse_context::begin), fmt::format_parse_context>
{
if (ctx.begin() != ctx.end() && *ctx.begin() != '}')
throw fmt::format_error
(
"{} do not support to be format, so the wrapper should not have any format syntax."_f
(nameof::nameof_full_type<T>())
);
return ctx.begin();
}
}
namespace std
{
template <typename Char, typename... Ts> requires (sizeof...(Ts) > 0)
basic_ostream<Char>& operator<<(basic_ostream<Char>& os, const variant<Ts...>& value)
{
using namespace biu::literals;
auto try_print = [&]<typename T>
{
if (holds_alternative<T>(value))
{
if constexpr (biu::Formattable<T, Char>)
os << "({}: {})"_f(nameof::nameof_full_type<T>(), get<T>(value));
else
os << "({}: {})"_f(nameof::nameof_full_type<T>(), "non-null unformattable value");
}
};
(try_print.template operator()<Ts>(), ...);
return os;
}
}
namespace fmt
{
template <typename Char, biu::detail_::OptionalWrap Wrap> template <typename FormatContext>
auto formatter<Wrap, Char>::format(const Wrap& wrap, FormatContext& ctx)
-> std::invoke_result_t<decltype(&FormatContext::out), FormatContext>
{
using namespace biu::literals;
using namespace biu::stream_operators;
using value_t = biu::detail_::UnderlyingTypeOfOptionalWrap<Wrap>::Type;
auto format_value_type = [&, this](const value_t& value)
{
if constexpr (!biu::Formattable<value_t, Char>)
return format_to(ctx.out(), "non-null unformattable value");
else if constexpr (std::default_initializable<formatter<value_t>>)
biu::detail_::FormatterReuseProxy<value_t>::format(value, ctx);
else
format_to(ctx.out(), "{}", value);
};
format_to(ctx.out(), "(");
if constexpr (biu::SpecializationOf<Wrap, std::optional>)
{
if (wrap)
format_value_type(*wrap);
else
format_to(ctx.out(), "null");
}
else if constexpr (biu::SpecializationOf<Wrap, std::weak_ptr>)
{
if (auto shared = wrap.lock())
{
format_to(ctx.out(), "{} ", ptr(shared.get()));
format_value_type(*shared);
}
else
format_to(ctx.out(), "null");
}
else
{
if (wrap)
{
format_to(ctx.out(), "{} ", ptr(wrap.get()));
format_value_type(*wrap);
}
else
format_to(ctx.out(), "null");
}
return format_to(ctx.out(), ")");
}
template <typename Char, biu::Enumerable T> constexpr
auto formatter<T, Char>::parse(format_parse_context& ctx)
-> std::invoke_result_t<decltype(&format_parse_context::begin), format_parse_context>
{
auto it = ctx.begin();
if (it != ctx.end() && *it == 'f')
{
full = true;
it++;
}
if (it != ctx.end() && *it != '}')
throw format_error{"syntax error."};
return it;
}
template <typename Char, biu::Enumerable T> template <typename FormatContext>
auto formatter<T, Char>::format(const T& value, FormatContext& ctx)
-> std::invoke_result_t<decltype(&FormatContext::out), FormatContext>
{
if (full)
return format_to(ctx.out(), "{}::{}", nameof::nameof_type<T>(), nameof::nameof_enum(value));
else
return format_to(ctx.out(), "{}", nameof::nameof_enum(value));
}
}

View File

@@ -0,0 +1,103 @@
# pragma once
# include <map>
# include <boost/stacktrace.hpp>
# include <biu/atomic/nolog.hpp>
namespace biu
{
class Logger
{
// All the member function corresponding to stacktrace should be inlined
// All the public function (including public function of member class) should be thread safe.
public: Logger() = delete;
// Setup output stream and log level in a thread-safe way
public: enum class Level
{
None,
Error,
Access,
Info,
Debug
};
protected: struct LoggerConfigType_
{
std::experimental::observer_ptr<std::ostream> Stream;
std::shared_ptr<std::ostream> StreamStorage;
Logger::Level Level;
};
protected: static Atomic<std::optional<LoggerConfigType_>, false> LoggerConfig_;
public: static void init(std::experimental::observer_ptr<std::ostream> stream, Level level);
public: static void init(std::shared_ptr<std::ostream> stream, Level level);
// Send a telegram message if token and chat id are set, all the functions are thread-safe
protected: static Atomic<std::optional<std::pair<std::string, std::string>>, false> TelegramConfig_;
public: static void telegram_init(const std::string& token, const std::string& chat_id);
public: static void telegram_notify(const std::string& message);
public: static void telegram_notify_async(const std::string& message);
// Monitor the lifetime of an object
// usage: struct my_class : protected Logger::ObjectMonitor<my_class> {}
public: template <typename T> class ObjectMonitor
{
protected: const std::chrono::time_point<std::chrono::steady_clock> CreateTime_;
// call log<Debug>("create {type} at {address}.");
protected: [[gnu::always_inline]] ObjectMonitor();
// call log<Debug>("destroy {type} at {address} after {duration} ms.");
protected: [[gnu::always_inline]] virtual ~ObjectMonitor();
};
template <typename T> friend class ObjectMonitor;
// List of objects that is being monitored by ObjectMonitor, {address, type}
protected: static Atomic<std::multimap<const void*, std::string_view>, false> Objects_;
public: template <typename FinalException> class Exception : public std::exception
{
protected: const std::string Message_;
protected: const boost::stacktrace::stacktrace Stacktrace_;
public: explicit Exception(const std::string& message);
public: const char* what() const noexcept final {return Message_.c_str();}
};
// Monitor the start and end of a function, as well as corresponding thread.
// This object should be construct at the beginning of the function, and should never be passed to another
// function or thread.
public: class Guard
{
protected: thread_local static unsigned Indent_;
protected: const std::chrono::time_point<std::chrono::steady_clock> StartTime_;
// if sizeof...(Param) > 0, call log<Debug>("begin function with {arguments}.");
// else call log<Debug>("begin function.");
public: template <typename... Param> [[gnu::always_inline]] explicit Guard(Param&&... param);
// call log<Debug>("end function after {duration} ms.")
public: [[gnu::always_inline]] virtual ~Guard();
// call log<Debug>("reached after {duration} ms.")
public: [[gnu::always_inline]] void operator()() const;
// call log<Debug>("return {return} after {duration} ms.")
public: template <typename T> [[gnu::always_inline]] T rtn(T&& value) const;
// print the following message if LoggerConfig_ is set and the level is higher than the level of the
// LoggerConfig_
// [ {time} {thread} {indent} {filename}:{line} {function_name} ] {message}
public: template <Level L> [[gnu::always_inline]] void log(const std::string& message) const;
public: template <typename FinalException> [[gnu::always_inline]] void print_exception
(
const std::string& type, const std::string& message, const boost::stacktrace::stacktrace& stacktrace,
CalledBy<Exception<FinalException>>
) const;
};
friend class Guard;
// list of threads which is being monitored by Guard and number of Guard created in this thread so far
protected: static Atomic<std::map<std::size_t, std::size_t>, false> Threads_;
};
}

View File

@@ -0,0 +1,143 @@
# pragma once
# define BOOST_STACKTRACE_USE_BACKTRACE
# include <fmt/chrono.h>
# include <biu/logger.hpp>
# include <biu/common.hpp>
# include <biu/format.hpp>
namespace biu
{
template <typename T> Logger::ObjectMonitor<T>::ObjectMonitor()
: CreateTime_{std::chrono::steady_clock::now()}
{
Guard guard;
guard.log<Level::Debug>("create {} at {}."_f(nameof::nameof_full_type<T>(), fmt::ptr(this)));
auto&& lock = Objects_.lock();
lock->emplace(this, nameof::nameof_full_type<T>());
}
template <typename T> Logger::ObjectMonitor<T>::~ObjectMonitor()
{
Guard guard;
guard.log<Level::Debug>("destroy {} at {} after {} ms."_f
(
nameof::nameof_full_type<T>(), fmt::ptr(this),
std::chrono::duration_cast<std::chrono::milliseconds>
(std::chrono::steady_clock::now() - CreateTime_).count()
));
auto&& lock = Objects_.lock();
auto range = lock->equal_range(this);
for (auto it = range.first; it != range.second; it++)
if (it->second == nameof::nameof_full_type<T>())
{
lock->erase(it);
return;
}
guard.log<Level::Error>
("{} {} not found in Logger::Objects."_f(fmt::ptr(this), nameof::nameof_full_type<T>()));
}
template <typename FinalException> Logger::Exception<FinalException>::Exception(const std::string& message)
{
Logger::Guard log{message};
log.print_exception(nameof::nameof_full_type<FinalException>(), message, Stacktrace_);
}
template <typename... Param> inline Logger::Guard::Guard(Param&&... param)
: StartTime_{std::chrono::steady_clock::now()}
{
Indent_++;
auto&& lock = Threads_.lock();
auto thread_id = std::hash<std::thread::id>{}(std::this_thread::get_id());
if (lock->contains(thread_id))
lock.value()[thread_id]++;
else
lock->emplace(thread_id, 1);
if constexpr (sizeof...(Param) > 0)
{
std::stringstream ss;
std::vector<std::string> params = {"{}"_f(std::forward<Param>(param))...};
ss << "begin function with {";
for (auto& param : params)
ss << param << ", ";
ss.seekp(-2, ss.cur);
ss << "}.";
log<Level::Debug>(ss.str());
}
else
log<Level::Debug>("begin function.");
}
inline Logger::Guard::~Guard()
{
log<Level::Debug>("end function after {} ms."_f(std::chrono::duration_cast<std::chrono::milliseconds>
(std::chrono::steady_clock::now() - StartTime_).count()));
Indent_--;
auto&& lock = Threads_.lock();
auto thread_id = std::hash<std::thread::id>{}(std::this_thread::get_id());
if (lock->contains(thread_id))
{
lock.value()[thread_id]--;
if (lock.value()[thread_id] == 0)
lock->erase(thread_id);
}
else [[unlikely]]
log<Level::Debug>("{:08x} not found in Logger::Threads."_f
(std::hash<std::thread::id>{}(std::this_thread::get_id()) % std::numeric_limits<std::uint64_t>::max()));
}
inline void Logger::Guard::operator()() const
{
log<Level::Debug>("reached after {} ms."_f
(
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - StartTime_).count()
));
}
template <typename T> inline T Logger::Guard::rtn(T&& value) const
{
log<Level::Debug>("return {} after {} ms."_f
(
std::forward<T>(value),
std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - StartTime_).count()
));
return std::forward<T>(value);
}
template <Logger::Level L> inline void Logger::Guard::log(const std::string& message) const
{
if (auto&& lock = LoggerConfig_.lock(); *lock && lock.value()->Level >= L)
{
static_assert(std::same_as<std::size_t, std::uint64_t>);
auto time = std::chrono::system_clock::now();
boost::stacktrace::stacktrace stack;
*lock.value()->Stream << "[ {:%Y-%m-%d %H:%M:%S}:{:03} {:08x} {:04} {}:{} {} ] {}\n"_f
(
time,
std::chrono::time_point_cast<std::chrono::milliseconds>(time).time_since_epoch().count() % 1000,
std::hash<std::thread::id>{}(std::this_thread::get_id())
% std::numeric_limits<std::uint64_t>::max(),
Indent_,
stack[0].source_file().empty() ? "??"s : stack[0].source_file(),
stack[0].source_line() == 0 ? "??"s : "{}"_f(stack[0].source_line()),
stack[0].name(),
message
) << std::flush;
}
}
template <typename FinalException> inline void Logger::Guard::print_exception
(
const std::string& type, const std::string& message, const boost::stacktrace::stacktrace& stacktrace,
CalledBy<Exception<FinalException>>
) const
{
log<Level::Error>("{}: {}"_f(type, message));
if (auto&& lock = LoggerConfig_.lock(); *lock && lock.value()->Level >= Logger::Level::Error)
{
static_assert(std::same_as<std::size_t, std::uint64_t>);
for (auto frame : stacktrace)
*lock.value()->Stream << "\tfrom {}:{} {}\n"_f
(
frame.source_file().empty() ? "??"s : frame.source_file(),
frame.source_line() == 0 ? "??"s : "{}"_f(frame.source_line()),
frame.name()
);
*lock.value()->Stream << std::flush;
}
}
}

View File

@@ -0,0 +1,18 @@
# pragma once
# include <memory>
# include <type_traits>
namespace biu
{
// store a reference to an lvalue, or a value (instead of a reference) copy or moved from an rvalue
template <typename T> class SmartRef
{
protected: std::unique_ptr<T> Ptr_;
protected: T& Ref_;
public: SmartRef(T& val);
public: template <typename... Us> requires (std::is_constructible_v<T, Us...>) SmartRef(Us&&... val);
public: T& operator*();
public: T* operator->();
};
}

View File

@@ -0,0 +1,13 @@
# pragma once
# include <utility>
# include <biu/smartref.hpp>
namespace biu
{
template <typename T> inline SmartRef<T>::SmartRef(T& val) : Ref_(val) {}
template <typename T> template <typename... Us> requires (std::is_constructible_v<T, Us...>)
inline SmartRef<T>::SmartRef(Us&&... val)
: Ptr_(std::make_unique<T>(std::forward<Us>(val)...)), Ref_(*Ptr_) {}
template <typename T> inline T& SmartRef<T>::operator*() {return Ref_;}
template <typename T> inline T* SmartRef<T>::operator->() {return &Ref_;}
}

View File

@@ -0,0 +1,111 @@
# pragma once
# include <regex>
# include <array>
# include <string>
# include <string_view>
# include <iostream>
# include <concurrencpp/concurrencpp.h>
# include <biu/concepts.hpp>
# include <biu/smartref.hpp>
namespace biu
{
// Store a string in a static member of a class; or, use a class to represent a string.
template <DecayedType Char, Char... c> struct BasicStaticString
{
static constexpr std::array<Char, sizeof...(c)> Array{c...};
static constexpr std::basic_string_view<Char> StringView{Array.data(), sizeof...(c)};
};
template <char... c> using StaticString = BasicStaticString<char, c...>;
inline namespace stream_operators
{
template <typename Char, Char... c>
std::basic_ostream<Char>& operator<<(std::basic_ostream<Char>& os, BasicStaticString<Char, c...>);
}
inline namespace literals
{ template <typename Char, Char... c> consteval BasicStaticString<Char, c...> operator""_ss(); }
namespace detail_
{
template <typename C, typename T> struct SpecializationOfBasicStaticStringHelper : std::false_type {};
template <typename C, C... c>
struct SpecializationOfBasicStaticStringHelper<C, BasicStaticString<C, c...>> : std::true_type {};
template <typename C, C... c>
struct SpecializationOfBasicStaticStringHelper<void, BasicStaticString<C, c...>> : std::true_type {};
template <typename T, typename C> concept SpecializationOfBasicStaticString
= SpecializationOfBasicStaticStringHelper<std::decay_t<C>, std::decay_t<T>>::value;
}
template <typename T, typename C = void> concept SpecializationOfBasicStaticString
= detail_::SpecializationOfBasicStaticString<T, C>
&& detail_::SpecializationOfBasicStaticString<T, void>;
template <typename T> concept SpecializationOfStaticString = SpecializationOfBasicStaticString<T, char>;
// Store a string in a fixed-size array
template <DecayedType Char, std::size_t N> struct BasicFixedString
{
Char Data[N];
constexpr static const std::size_t Size = N - 1;
constexpr BasicFixedString(const Char (&str)[N]);
};
template <std::size_t N> using FixedString = BasicFixedString<char, N>;
inline namespace stream_operators
{
template <typename Char, std::size_t N> std::basic_ostream<Char>& operator<<
(std::basic_ostream<Char>& os, const BasicFixedString<Char, N>& str);
}
inline namespace literals { template <BasicFixedString FS> constexpr decltype(FS) operator""_fs(); }
namespace detail_
{
template <typename C, typename T> struct SpecializationOfBasicFixedStringHelper : std::false_type {};
template <typename C, std::size_t N>
struct SpecializationOfBasicFixedStringHelper<C, BasicFixedString<C, N>> : std::true_type {};
template <typename C, std::size_t N>
struct SpecializationOfBasicFixedStringHelper<void, BasicFixedString<C, N>> : std::true_type {};
template <typename T, typename C> concept SpecializationOfBasicFixedString
= SpecializationOfBasicFixedStringHelper<std::decay_t<C>, std::decay_t<T>>::value;
}
template <typename T, typename C = void> concept SpecializationOfBasicFixedString
= detail_::SpecializationOfBasicFixedString<T, C>
&& detail_::SpecializationOfBasicFixedString<T, void>;
template <typename T> concept SpecializationOfFixedString = SpecializationOfBasicFixedString<T, char>;
// Store a string with at most N characters
template <DecayedType Char, std::size_t N> struct BasicVariableString
{
Char Data[N];
std::size_t Size;
constexpr static const std::size_t MaxSize = N - 1;
template <std::size_t M> requires (M<=N) constexpr BasicVariableString(const Char (&str)[M]);
};
template <std::size_t N> using VariableString = BasicVariableString<char, N>;
inline namespace stream_operators
{
template <typename Char, std::size_t N> std::basic_ostream<Char>& operator<<
(std::basic_ostream<Char>& os, const BasicVariableString<Char, N>& str);
}
namespace detail_
{
template <typename C, typename T> struct SpecializationOfBasicVariableStringHelper : std::false_type {};
template <typename C, std::size_t N>
struct SpecializationOfBasicVariableStringHelper<C, BasicVariableString<C, N>> : std::true_type {};
template <typename C, std::size_t N>
struct SpecializationOfBasicVariableStringHelper<void, BasicVariableString<C, N>> : std::true_type {};
template <typename T, typename C> concept SpecializationOfBasicVariableString
= SpecializationOfBasicVariableStringHelper<std::decay_t<C>, std::decay_t<T>>::value;
}
template <typename T, typename C = void> concept SpecializationOfBasicVariableString
= detail_::SpecializationOfBasicVariableString<T, C>
&& detail_::SpecializationOfBasicVariableString<T, void>;
template <typename T> concept SpecializationOfVariableString = SpecializationOfBasicVariableString<T, char>;
namespace string
{
// Find specific content in a string. Return unmatched content before the match and the match result every
// time. If match reached the end, the second returned value will be std::sregex_iterator().
concurrencpp::generator<std::pair<std::string_view, std::sregex_iterator>> find
(SmartRef<const std::string> data, SmartRef<const std::regex> regex);
// Use a regex to find all matches and replace them with a callback function
std::string replace
(const std::string& data, const std::regex& regex, std::function<std::string(const std::smatch&)> function);
}
}

View File

@@ -0,0 +1,30 @@
# pragma once
# include <biu/string.hpp>
namespace biu
{
template <typename Char, Char... c> inline std::basic_ostream<Char>& stream_operators::operator<<
(std::basic_ostream<Char>& os, BasicStaticString<Char, c...>)
{ return os << std::basic_string_view{c...}; }
template <typename Char, Char... c> consteval BasicStaticString<Char, c...> literals::operator""_ss()
{ return {}; }
template <DecayedType Char, std::size_t N> constexpr
BasicFixedString<Char, N>::BasicFixedString(const Char (&str)[N])
{ std::copy_n(str, N, Data); }
template <typename Char, std::size_t N> std::basic_ostream<Char>& stream_operators::operator<<
(std::basic_ostream<Char>& os, const BasicFixedString<Char, N>& str)
{ return os << std::basic_string_view<Char>(str.Data, str.Size); }
template <BasicFixedString FS> constexpr decltype(FS) literals::operator""_fs()
{ return FS; }
template <DecayedType Char, std::size_t N> template <std::size_t M> requires (M<=N) constexpr
BasicVariableString<Char, N>::BasicVariableString(const Char (&str)[M]) : Size(M)
{
std::fill(Data, Data + N, '\0');
std::copy_n(str, M, Data);
}
template <typename Char, std::size_t N> std::basic_ostream<Char>& stream_operators::operator<<
(std::basic_ostream<Char>& os, const BasicVariableString<Char, N>& str)
{ return os << std::basic_string_view<Char>(str.Data, str.Size); }
}

View File

@@ -0,0 +1,14 @@
# include <future>
# include <utility>
# include <biu.hpp>
namespace biu
{
std::regex literals::operator""_re(const char* str, std::size_t len)
{ return std::regex{str, len}; }
void block_forever()
{
std::promise<void>().get_future().wait();
std::unreachable();
}
}

View File

@@ -0,0 +1,36 @@
# include <tgbot/tgbot.h>
# include <biu.hpp>
namespace biu
{
Atomic<std::optional<typename Logger::LoggerConfigType_>, false> Logger::LoggerConfig_;
void Logger::init(std::experimental::observer_ptr<std::ostream> stream, Level level)
{
auto&& lock = LoggerConfig_.lock();
lock->emplace(stream, nullptr, level);
}
void Logger::init(std::shared_ptr<std::ostream> stream, Level level)
{
auto&& lock = LoggerConfig_.lock();
lock->emplace(std::experimental::make_observer(stream.get()), stream, level);
}
Atomic<std::optional<std::pair<std::string, std::string>>, false> Logger::TelegramConfig_;
void Logger::telegram_init(const std::string& token, const std::string& chat_id)
{TelegramConfig_ = std::make_pair(token, chat_id);}
void Logger::telegram_notify(const std::string& message)
{
if (auto&& lock = TelegramConfig_.lock(); *lock)
{
TgBot::Bot bot{lock.value()->first};
bot.getApi().sendMessage(lock.value()->first, message);
}
}
void Logger::telegram_notify_async(const std::string& message)
{std::thread{Logger::telegram_notify, message}.detach();}
Atomic<std::multimap<const void*, std::string_view>, false> Logger::Objects_;
thread_local unsigned Logger::Guard::Indent_ = 0;
Atomic<std::map<std::size_t, std::size_t>, false> Logger::Threads_;
}

View File

@@ -0,0 +1,53 @@
# include <fmt/chrono.h>
# include <biu.hpp>
namespace biu
{
concurrencpp::generator<std::pair<std::string_view, std::sregex_iterator>> string::find
(SmartRef<const std::string> data, SmartRef<const std::regex> regex)
{
Logger::Guard log;
std::string::const_iterator unmatched_prefix_begin = data->cbegin(), unmatched_prefix_end;
std::sregex_iterator regit;
while (true)
{
if (regit == std::sregex_iterator{})
regit = std::sregex_iterator{data->begin(), data->end(), *regex};
else
regit++;
if (regit == std::sregex_iterator{})
{
unmatched_prefix_end = data->cend();
log.log<Logger::Level::Debug>("distance: {}"_f(std::distance(unmatched_prefix_begin, unmatched_prefix_end)));
}
else
unmatched_prefix_end = (*regit)[0].first;
co_yield
{
std::string_view
{
&*unmatched_prefix_begin,
static_cast<std::size_t>(std::distance(unmatched_prefix_begin, unmatched_prefix_end))
},
regit
};
if (regit == std::sregex_iterator{})
break;
unmatched_prefix_begin = (*regit)[0].second;
}
}
std::string string::replace
(const std::string& data, const std::regex& regex, std::function<std::string(const std::smatch&)> function)
{
Logger::Guard log;
std::string result;
for (auto matched : find(data, regex))
{
result.append(matched.first);
if (matched.second != std::sregex_iterator{})
result.append(function(*matched.second));
}
return result;
}
}

View File

@@ -0,0 +1,11 @@
{ stdenv, src }: stdenv.mkDerivation
{
name = "blurred-wallpaper";
inherit src;
phases = [ "installPhase" ];
installPhase =
''
mkdir -p $out/share/plasma/wallpapers/a2n.blur
cp -r $src/* $out/share/plasma/wallpapers/a2n.blur
'';
}

View File

@@ -0,0 +1,22 @@
{ stdenvNoCC, texlive, src }: stdenvNoCC.mkDerivation (finalAttrs:
{
name = "citation-style-language";
inherit src;
passthru =
{
pkgs = [ finalAttrs.finalPackage ];
tlDeps = with texlive; [ latex ];
tlType = "run";
};
nativeBuildInputs = [ texlive.combined.scheme-full ];
dontConfigure = true;
dontBuild = true;
installPhase =
''
runHook preInstall
export TEXMFHOME=$out
l3build install
runHook postInstall
'';
})

View File

@@ -1,18 +1,6 @@
{ stdenv, fetchFromGitHub, cmake }: stdenv.mkDerivation rec
{ stdenv, cmake, src }: stdenv.mkDerivation
{
pname = "concurrencpp";
version = "0.1.7";
src = fetchFromGitHub
{
owner = "David-Haim";
repo = "concurrencpp";
rev = "v.${version}";
sha256 = "4qT29YVjKEWcMrI5R5Ps8aD4grAAgz5VOxANjpp1oTo=";
};
name = "concurrencpp";
inherit src;
nativeBuildInputs = [ cmake ];
postInstall =
''
mv $out/include/concurrencpp-${version}/concurrencpp $out/include
rm -rf $out/include/concurrencpp-${version}
'';
}

View File

@@ -0,0 +1,12 @@
diff --git a/lib/static_thread_pool.cpp b/lib/static_thread_pool.cpp
index 989a6a9..0b91b9c 100644
--- a/lib/static_thread_pool.cpp
+++ b/lib/static_thread_pool.cpp
@@ -12,6 +12,7 @@
#include <cassert>
#include <mutex>
#include <chrono>
+#include <utility>
namespace
{

View File

@@ -0,0 +1,7 @@
{ stdenv, cmake, src }: stdenv.mkDerivation
{
name = "cppcoro";
inherit src;
nativeBuildInputs = [ cmake ];
patches = [ ./cppcoro-include-utility.patch ];
}

View File

@@ -0,0 +1,13 @@
{ stdenv, src }: stdenv.mkDerivation
{
name = "date";
inherit src;
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out
cp -r $src/{include,src} $out
runHook postInstall
'';
}

View File

@@ -1,29 +1,88 @@
{ lib, pkgs }: with pkgs;
inputs: 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 {};
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
typora = inputs.pkgs.callPackage ./typora {};
vesta = inputs.pkgs.callPackage ./vesta {};
rsshub = inputs.pkgs.callPackage ./rsshub { src = inputs.topInputs.rsshub; };
misskey = inputs.pkgs.callPackage ./misskey { nodejs = inputs.pkgs.nodejs_21; src = inputs.topInputs.misskey; };
mk-meili-mgn = inputs.pkgs.callPackage ./mk-meili-mgn {};
vaspkit = inputs.pkgs.callPackage ./vaspkit { inherit (inputs.localLib) attrsToList; };
v-sim = inputs.pkgs.callPackage ./v-sim { src = inputs.topInputs.v-sim; };
concurrencpp = inputs.pkgs.callPackage ./concurrencpp { src = inputs.topInputs.concurrencpp; };
eigengdb = inputs.pkgs.python3Packages.callPackage ./eigengdb {};
nodesoup = inputs.pkgs.callPackage ./nodesoup { src = inputs.topInputs.nodesoup; };
matplotplusplus = inputs.pkgs.callPackage ./matplotplusplus
{ inherit nodesoup glad; src = inputs.topInputs.matplotplusplus; };
zpp-bits = inputs.pkgs.callPackage ./zpp-bits { src = inputs.topInputs.zpp-bits; };
eigen = inputs.pkgs.callPackage ./eigen { src = inputs.topInputs.eigen; };
nameof = inputs.pkgs.callPackage ./nameof { src = inputs.topInputs.nameof; };
pslist = inputs.pkgs.callPackage ./pslist {};
glad = inputs.pkgs.callPackage ./glad {};
chromiumos-touch-keyboard = inputs.pkgs.callPackage ./chromiumos-touch-keyboard {};
yoga-support = inputs.pkgs.callPackage ./yoga-support {};
tgbot-cpp = inputs.pkgs.callPackage ./tgbot-cpp { src = inputs.topInputs.tgbot-cpp; };
citation-style-language = inputs.pkgs.callPackage ./citation-style-language
{ src = inputs.topInputs.citation-style-language; };
mirism = inputs.pkgs.callPackage ./mirism
{
openmp = llvmPackages.openmp;
openmpi = pkgs.openmpi.override { cudaSupport = false; };
inherit cppcoro nameof tgbot-cpp date;
nghttp2 = inputs.pkgs.callPackage "${inputs.topInputs."nixpkgs-23.05"}/pkgs/development/libraries/nghttp2"
{ enableAsioLib = true; };
};
vaspkit = callPackage ./vaspkit { attrsToList = (import ../lib lib).attrsToList; };
# "12to11" = callPackage ./12to11 {};
huginn = callPackage ./huginn {};
v_sim = callPackage ./v_sim {};
concurrencpp = callPackage ./concurrencpp { stdenv = gcc13Stdenv; };
cppcoro = inputs.pkgs.callPackage ./cppcoro { src = inputs.topInputs.cppcoro; };
date = inputs.pkgs.callPackage ./date { src = inputs.topInputs.date; };
esbonio = inputs.pkgs.python3Packages.callPackage ./esbonio {};
pix2tex = inputs.pkgs.python3Packages.callPackage ./pix2tex {};
pyreadline3 = inputs.pkgs.python3Packages.callPackage ./pyreadline3 {};
torchdata = inputs.pkgs.python3Packages.callPackage ./torchdata {};
torchtext = inputs.pkgs.python3Packages.callPackage ./torchtext { inherit torchdata; };
win11os-kde = inputs.pkgs.callPackage ./win11os-kde { src = inputs.topInputs.win11os-kde; };
fluent-kde = inputs.pkgs.callPackage ./fluent-kde { src = inputs.topInputs.fluent-kde; };
blurred-wallpaper = inputs.pkgs.callPackage ./blurred-wallpaper { src = inputs.topInputs.blurred-wallpaper; };
slate = inputs.pkgs.callPackage ./slate { src = inputs.topInputs.slate; };
nvhpc = inputs.pkgs.callPackage ./nvhpc {};
lmod = inputs.pkgs.callPackage ./lmod { src = inputs.topInputs.lmod; };
vasp = rec
{
source = inputs.pkgs.callPackage ./vasp/source.nix {};
gnu = inputs.pkgs.callPackage ./vasp/gnu
{
inherit (inputs.pkgs.llvmPackages) openmp;
inherit wannier90 additionalCommands;
hdf5 = inputs.pkgs.hdf5.override { mpiSupport = true; fortranSupport = true; };
};
gnu-mkl = inputs.pkgs.callPackage ./vasp/gnu-mkl
{
inherit (inputs.pkgs.llvmPackages) openmp;
inherit wannier90 additionalCommands;
hdf5 = inputs.pkgs.hdf5.override { mpiSupport = true; fortranSupport = true; };
};
nvidia = inputs.pkgs.callPackage ./vasp/nvidia
{ inherit lmod nvhpc wannier90 additionalCommands; hdf5 = hdf5-nvhpc; };
intel = inputs.pkgs.callPackage ./vasp/intel
{ inherit lmod oneapi wannier90 additionalCommands; hdf5 = hdf5-oneapi; };
amd = inputs.pkgs.callPackage ./vasp/amd
{ inherit aocc aocl wannier90 additionalCommands; hdf5 = hdf5-aocc; openmpi = openmpi-aocc; gcc = gcc-pie; };
wannier90 = inputs.pkgs.callPackage
"${inputs.topInputs.nixpkgs-unstable}/pkgs/by-name/wa/wannier90/package.nix" {};
hdf5-nvhpc = inputs.pkgs.callPackage ./vasp/hdf5-nvhpc { inherit lmod nvhpc; inherit (inputs.pkgs.hdf5) src; };
hdf5-oneapi = inputs.pkgs.callPackage ./vasp/hdf5-oneapi { inherit lmod oneapi; inherit (inputs.pkgs.hdf5) src; };
hdf5-aocc = inputs.pkgs.callPackage ./vasp/hdf5-aocc
{ inherit (inputs.pkgs.hdf5) src; inherit aocc; openmpi = openmpi-aocc; gcc = gcc-pie; };
openmpi-aocc = inputs.pkgs.callPackage ./vasp/openmpi-aocc { inherit aocc; gcc = gcc-pie; };
gcc-pie = inputs.pkgs.wrapCC (inputs.pkgs.gcc.cc.overrideAttrs (prev:
{ configureFlags = prev.configureFlags ++ [ "--enable-default-pie" ];}));
additionalCommands = let uid = inputs.config.nixos.user.uid.gb; in
''[ "$(${inputs.pkgs.coreutils}/bin/id -u)" -eq ${builtins.toString uid} ] && exit 1'';
};
oneapi = inputs.pkgs.callPackage ./oneapi {};
mumax = inputs.pkgs.callPackage ./mumax { src = inputs.topInputs.mumax; };
aocc = inputs.pkgs.callPackage ./aocc {};
aocl = inputs.pkgs.callPackage ./aocl {};
kylin-virtual-keyboard = inputs.pkgs.libsForQt5.callPackage ./kylin-virtual-keyboard
{ src = inputs.topInputs.kylin-virtual-keyboard; };
biu = inputs.pkgs.callPackage ./biu { inherit nameof; };
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}
"${inputs.pkgs.remarshal}/bin/yaml2json ${builtins.toFile "content.yaml" content} $out"));
}

View File

@@ -0,0 +1,6 @@
{ lib, stdenv, cmake, src }: stdenv.mkDerivation
{
name = "eigen";
inherit src;
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,11 @@
{ lib, fetchPypi, buildPythonPackage }: buildPythonPackage rec
{
pname = "esbonio";
version = "0.16.4";
src = fetchPypi
{
inherit pname version;
sha256 = "1MBNBLCEBD6HtlxEASc4iZaXYyNdih2MIHoxK84jMdI=";
};
doCheck = false;
}

View File

@@ -0,0 +1,22 @@
{ lib, stdenv, src }: stdenv.mkDerivation
{
name = "fluent-kde";
inherit src;
installPhase =
''
mkdir -p $out/share/aurorae/themes
cp -r $src/aurorae/* $out/share/aurorae/themes
mkdir -p $out/share/color-schemes
cp -r $src/color-schemes/*.colors $out/share/color-schemes
mkdir -p $out/share/Kvantum
cp -r $src/Kvantum/Fluent* $out/share/Kvantum
mkdir -p $out/share/plasma/desktoptheme
cp -r $src/plasma/desktoptheme/* $out/share/plasma/desktoptheme
mkdir -p $out/share/plasma/layout-templates
cp -r $src/plasma/layout-templates/* $out/share/plasma/layout-templates
mkdir -p $out/share/plasma/look-and-feel
cp -r $src/plasma/look-and-feel/com.github.vinceliuice.Fluent* $out/share/plasma/look-and-feel
mkdir -p $out/share/wallpapers
cp -r $src/wallpaper/* $out/share/wallpapers
'';
}

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

@@ -1,29 +0,0 @@
{ 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,17 @@
{
stdenv, src, wrapQtAppsHook,
qtbase, gsettings-qt, pkg-config, kwindowsystem, fcitx5-qt, qmake, wrapGAppsHook, glib
}: stdenv.mkDerivation
{
name = "kylin-virtual-keyboard";
inherit src;
buildInputs = [ qtbase gsettings-qt kwindowsystem fcitx5-qt ];
nativeBuildInputs = [ wrapQtAppsHook pkg-config qmake wrapGAppsHook glib ];
qmakeFlags = [ "PREFIX=/" ];
installFlags = [ "INSTALL_ROOT=$(out)" ];
postInstall =
''
mv $out/usr/* $out
rm -rf $out/usr
'';
}

View File

@@ -0,0 +1,14 @@
{
stdenv, src,
tcl,
procps, bc, lua
}:
stdenv.mkDerivation
{
name = "lmod";
inherit src;
buildInputs = [ tcl ];
nativeBuildInputs = [ procps bc (lua.withPackages (ps: with ps; [ luaposix ])) ];
configurePhase = ''./configure --prefix=$out/share'';
postUnpack = "patchShebangs .";
}

View File

@@ -0,0 +1,18 @@
{
stdenv, src, cmake, pkg-config, substituteAll,
gnuplot, libjpeg, libtiff, zlib, libpng, lapack, blas, fftw, opencv, nodesoup, cimg, glfw, libGL, python3, glad
}: stdenv.mkDerivation
{
name = "matplotplusplus";
inherit src;
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,29 @@
{
lib, stdenv, requireFile,
boost, nghttp2, brotli, nameof, cppcoro, tgbot-cpp, libbacktrace, fmt, date
}: stdenv.mkDerivation rec
{
name = "mirism";
# nix-store --query --hash $(nix store add-path . --name 'mirism')
src = requireFile
{
inherit name;
sha256 = "0f50pvdafhlmrlbf341mkp9q50v4ld5pbx92d2w1633f18zghbzf";
hashMode = "recursive";
message = "Source file not found.";
};
buildInputs = [ boost nghttp2.dev brotli nameof cppcoro tgbot-cpp libbacktrace fmt date ];
buildPhase =
''
runHook preBuild
make ng01 beta
runHook postBuild
'';
installPhase =
''
runHook preInstall
mkdir -p $out/bin
cp build/{ng01,beta} $out/bin
runHook postInstall
'';
}

View File

@@ -1,43 +1,38 @@
{
lib, stdenv, mkPnpmPackage, fetchFromGitHub, nodejs_20, writeShellScript, buildFHSEnv,
bash, cypress, vips, pkg-config
lib, stdenv, mkPnpmPackage, fetchurl, nodejs, writeShellScript, buildFHSEnv,
bash, cypress, vips, pkg-config, src, libtensorflow
}:
let
pname = "misskey";
version = "13.14.2";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "misskey";
rev = "e02ecb3819f6f05352d43b64ae59fa1bd683e2e0";
hash = "sha256-zsYM67LYUn+bI6kbdW9blftxw5TUxCdzlfaOOEgZz+Q=";
fetchSubmodules = true;
};
name = "misskey";
originalPnpmPackage = mkPnpmPackage
{
inherit pname version src;
nodejs = nodejs_20;
inherit name src nodejs;
copyPnpmStore = true;
extraIntegritySha256."https://github.com/aiscript-dev/aiscript-languageserver/releases/download/0.1.5/aiscript-dev-aiscript-languageserver-0.1.5.tgz" = "1mhnwa8h48bc21f0zv8q93aphiqz9i70r7m4xsa4sd1mlncfgyl7";
};
startScript = writeShellScript "misskey"
''
export PATH=${lib.makeBinPath [ bash nodejs_20 nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress ]}:$PATH
export PATH=${lib.makeBinPath [ bash nodejs nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress ]}:$PATH
export CYPRESS_RUN_BINARY="${cypress}/bin/Cypress"
export NODE_ENV=production
pnpm run migrateandstart
'';
in
stdenv.mkDerivation
stdenv.mkDerivation rec
{
inherit version src pname;
nativeBuildInputs =
[ bash nodejs_20 nodejs_20.pkgs.typescript nodejs_20.pkgs.pnpm nodejs_20.pkgs.gulp cypress vips pkg-config ];
inherit src name;
buildInputs =
[
bash nodejs nodejs.pkgs.typescript nodejs.pkgs.pnpm nodejs.pkgs.gulp cypress vips pkg-config
];
nativeBuildInputs = buildInputs;
CYPRESS_RUN_BINARY = "${cypress}/bin/Cypress";
NODE_ENV = "production";
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
export npm_config_nodedir=${nodejs_20}
export npm_config_nodedir=${nodejs}
pnpm config set reporter append-only
runHook preConfigure
@@ -67,4 +62,8 @@ in
mkdir -p $out/files
runHook postInstall
'';
passthru =
{
inherit originalPnpmPackage startScript;
};
}

View File

@@ -0,0 +1,22 @@
{ buildGoModule, cudatoolkit, src, config, cudaCapabilities ? config.cudaCapabilities, gcc, makeWrapper }:
# TODO: use addDriverRunpath
buildGoModule
{
name = "mumax";
inherit src;
vendorHash = null;
nativeBuildInputs = [ cudatoolkit gcc makeWrapper ];
CUDA_CC = builtins.concatStringsSep " " cudaCapabilities;
CPATH = "${cudatoolkit}/include";
LIBRARY_PATH = "${cudatoolkit}/lib/stubs";
doCheck = false;
postInstall =
''
rm $out/bin/{doc,test}
for i in $out/bin/*; do
if [ -f $i ]; then
wrapProgram $i --prefix LD_LIBRARY_PATH ":" "/run/opengl-driver/lib:${cudatoolkit}/lib"
fi
done
'';
}

View File

@@ -0,0 +1,13 @@
{ lib, stdenv, src }: stdenv.mkDerivation
{
name = "nameof";
inherit src;
phases = [ "installPhase" ];
installPhase =
''
runHook preInstall
mkdir -p $out
cp -r $src/include $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,7 @@
{ stdenv, src, cmake, pkg-config, cairo, pcre2, xorg }: stdenv.mkDerivation
{
name = "nodesoup";
inherit src;
buildInputs = [ cairo pcre2.dev xorg.libXdmcp.dev ];
nativeBuildInputs = [ cmake pkg-config ];
}

View File

@@ -0,0 +1,43 @@
{
version ? "24.1",
stdenvNoCC, fetchurl, buildFHSEnv,
gfortran, flock
}:
let
versions =
{
"24.1" = "1n0x1x7ywvr3623ylvrjagayn44mbvfas3c3062p7y3asmgjx697";
"23.1" = "1xg933f4n1bw39y1x1vrjrbzpx36sbmjgvi332hfck3dbx0n982m";
};
releaseName = version:
let versions = builtins.splitVersion version;
in "nvhpc_20${builtins.elemAt versions 0}_${builtins.concatStringsSep "" versions}_Linux_x86_64_cuda_multi";
builder = buildFHSEnv
{
name = "builder";
targetPkgs = pkgs: with pkgs; [ coreutils ];
extraBwrapArgs = [ "--bind" "$out" "$out" ];
};
in stdenvNoCC.mkDerivation
{
pname = "nvhpc";
inherit version;
src = fetchurl
{
url = "https://developer.download.nvidia.com/hpc-sdk/${version}/${releaseName version}.tar.gz";
sha256 = versions.${version};
};
dontFixup = true;
dontBuild = true;
buildInputs = [ gfortran flock ];
installPhase =
''
export NVHPC_SILENT=true
export NVHPC_INSTALL_TYPE=single
export NVHPC_INSTALL_DIR=$out/share/nvhpc
# $out should exist before bwrap
mkdir -p $out
${builder}/bin/builder ./install
'';
requiredSystemFeatures = [ "gccarch-exact-${stdenvNoCC.hostPlatform.gcc.arch}" "big-parallel" ];
}

View File

@@ -0,0 +1,90 @@
{
version ? "2024.0",
stdenvNoCC, fetchurl, buildFHSEnv,
ncurses
}:
let
versions =
{
"2022.2" =
{
basekit =
{
id = "18673";
version = "2022.2.0.262";
sha256 = "03qx6sb58mkhc7iyc8va4y1ihj6l3155dxwmqj8dfw7j2ma7r5f6";
components =
[
"intel.oneapi.lin.dpcpp-ct"
"intel.oneapi.lin.dpcpp_dbg"
"intel.oneapi.lin.dpl"
"intel.oneapi.lin.tbb.devel"
"intel.oneapi.lin.ccl.devel"
"intel.oneapi.lin.dpcpp-cpp-compiler"
"intel.oneapi.lin.dpl"
"intel.oneapi.lin.mkl.devel"
];
};
hpckit =
{
id = "18679";
version = "2022.2.0.191";
sha256 = "0swz4w9bn58wwqjkqhjqnkcs8k8ms9nn9s8k7j5w6rzvsa6817d2";
};
};
"2024.0" =
{
basekit =
{
id = "163da6e4-56eb-4948-aba3-debcec61c064";
version = "2024.0.1.46";
sha256 = "1sp1fgjv8xj8qxf8nv4lr1x5cxz7xl5wv4ixmfmcg0gyk28cjq1g";
};
hpckit =
{
id = "67c08c98-f311-4068-8b85-15d79c4f277a";
version = "2024.0.1.38";
sha256 = "06vpdz51w2v4ncgk8k6y2srlfbbdqdmb4v4bdwb67zsg9lmf8fp9";
};
};
};
builder = buildFHSEnv
{
name = "builder";
targetPkgs = pkgs: with pkgs; [ coreutils zlib ];
extraBwrapArgs = [ "--bind" "$out" "$out" ];
runScript = "sh";
};
componentString = components: if components == null then "--components default" else
" --components " + (builtins.concatStringsSep ":" components);
in stdenvNoCC.mkDerivation rec
{
pname = "oneapi";
inherit version;
basekit = fetchurl
{
url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/${versions.${version}.basekit.id}/"
+ "l_BaseKit_p_${versions.${version}.basekit.version}_offline.sh";
sha256 = versions.${version}.basekit.sha256;
};
hpckit = fetchurl
{
url = "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/${versions.${version}.hpckit.id}/"
+ "l_HPCKit_p_${versions.${version}.hpckit.version}_offline.sh";
sha256 = versions.${version}.hpckit.sha256;
};
phases = [ "installPhase" ];
nativeBuildInputs = [ ncurses ];
installPhase =
''
mkdir -p $out
${builder}/bin/builder ${basekit} -a --silent --eula accept --install-dir $out/share/intel \
${componentString versions.${version}.basekit.components or null}
${builder}/bin/builder ${hpckit} -a --silent --eula accept --install-dir $out/share/intel \
${componentString versions.${version}.hpckit.components or null}
${builder}/bin/builder $out/share/intel/modulefiles-setup.sh --output-dir=$out/share/intel/modulefiles \
--ignore-latest
'';
dontFixup = true;
requiredSystemFeatures = [ "gccarch-exact-${stdenvNoCC.hostPlatform.gcc.arch}" "big-parallel" ];
}

View File

@@ -1,28 +0,0 @@
{
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,32 @@
{
lib, fetchFromGitHub, buildPythonPackage,
# general dependencies:
tqdm, munch, torch, opencv, requests, einops, transformers, tokenizers, numpy, pillow, pyyaml, pandas, timm,
albumentations,
# gui
pyqt6, pyqt6-webengine, pyside6, pynput, screeninfo,
# api
streamlit, fastapi, uvicorn, python-multipart,
# training
# python-Levenshtein, torchtext, imagesize
# highlight
pygments
}: buildPythonPackage
{
name = "pix2tex";
src = fetchFromGitHub
{
owner = "lukas-blecher";
repo = "LaTeX-OCR";
rev = "1781514fb8c92ea9f94057295fdae0e683f4648e";
hash = "sha256-I3B8eH7zV2zIogDt9znkEzp4EeBjY6NfI4jsl+v/8aM=";
};
patches = [ ./remove-version-requires.patch ];
propagatedBuildInputs =
[
tqdm munch torch opencv requests einops transformers tokenizers numpy pillow pyyaml pandas timm albumentations
pyqt6 pyqt6-webengine pyside6 pynput screeninfo
streamlit fastapi uvicorn python-multipart
pygments
];
}

View File

@@ -0,0 +1,13 @@
diff --git a/setup.py b/setup.py
index 29b26cb..511012f 100644
--- a/setup.py
+++ b/setup.py
@@ -64,7 +64,7 @@ setuptools.setup(
'Pillow>=9.1.0',
'PyYAML>=5.4.1',
'pandas>=1.0.0',
- 'timm==0.5.4',
+ 'timm>=0.5.4',
'albumentations>=0.5.2',
'pyreadline3>=3.4.1; platform_system=="Windows"',
],

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,14 @@
{
lib, fetchFromGitHub, buildPythonPackage
}: buildPythonPackage rec
{
pname = "pyreadline3";
version = "3.4.1";
src = fetchFromGitHub
{
owner = "pyreadline3";
repo = "pyreadline3";
rev = "v${version}";
hash = "sha256-02/gkx955NupVKXSu/xBQQtY4SEP4zxbNQYg1oQ/nGY=";
};
}

View File

@@ -1,23 +1,15 @@
{
lib, stdenv, mkPnpmPackage, fetchFromGitHub, nodejs, writeShellScript,
chromium, bash
lib, stdenv, mkPnpmPackage, nodejs, writeShellScript,
chromium, bash, src
}:
let
pname = "rsshub";
version = "20230829";
src = fetchFromGitHub
{
owner = "DIYgod";
repo = "RSSHub";
rev = "afcf9774260dc6505263cf0428970e890f2f7b1d";
hash = "sha256-BQFE0Z5DsFTf0tylQ0NN89hCdXT/Y2M+YPa/10ccOVg=";
};
originalPnpmPackage = mkPnpmPackage { inherit pname version src nodejs; };
name = "rsshub";
originalPnpmPackage = mkPnpmPackage { inherit name src nodejs; };
nodeModules = originalPnpmPackage.nodeModules.overrideAttrs { PUPPETEER_SKIP_DOWNLOAD = true; };
rsshub-unwrapped = stdenv.mkDerivation
{
inherit version src;
pname = "${pname}-unwrapped";
inherit src;
name = "${name}-unwrapped";
configurePhase =
''
export HOME=$NIX_BUILD_TOP # Some packages need a writable HOME
@@ -44,9 +36,9 @@ let
export CHROMIUM_EXECUTABLE_PATH=chromium
pnpm start
'';
in stdenv.mkDerivation rec
in stdenv.mkDerivation
{
inherit pname version;
inherit name;
phases = [ "installPhase" ];
installPhase =
''

View File

@@ -1,15 +0,0 @@
{ 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,10 @@
{ stdenv, src }: stdenv.mkDerivation
{
name = "slate";
src = "${src}/Slate.tar.gz";
installPhase =
''
mkdir -p $out/share/yakuake/skins/Slate
cp -r * $out/share/yakuake/skins/Slate
'';
}

View File

@@ -1,15 +0,0 @@
{
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,8 @@
{ stdenv, src, cmake, pkg-config, boost, openssl, zlib, curl }: stdenv.mkDerivation rec
{
name = "tgbot-cpp";
inherit src;
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [ boost openssl zlib curl.dev ];
propagatedBuildInputs = buildInputs;
}

View File

@@ -0,0 +1,20 @@
{
lib, fetchFromGitHub, buildPythonPackage,
torch, urllib3, requests, cmake, pkg-config, ninja
}: buildPythonPackage rec
{
pname = "torchdata";
version = "0.7.1";
src = fetchFromGitHub
{
owner = "pytorch";
repo = "data";
rev = "v${version}";
hash = "sha256-SOeu+mI4p2tHX0YyctrDBcrz2/zYcwH9GGJ+6ytRmjQ=";
fetchSubmodules = true;
};
dontUseCmakeConfigure = true;
pyproject = true;
propagatedBuildInputs = [ torch urllib3 requests ];
nativeBuildInputs = [ cmake pkg-config ninja ];
}

View File

@@ -0,0 +1,20 @@
{
lib, fetchFromGitHub, buildPythonPackage,
tqdm, requests, torch, numpy, torchdata, cmake
}: buildPythonPackage rec
{
pname = "torchtext";
version = "0.16.1";
src = fetchFromGitHub
{
owner = "pytorch";
repo = "text";
rev = "v${version}";
hash = "sha256-4a33AWdd1VZwRL5vTawo0yplpw+qcNMetbfE1h1kafE=";
fetchSubmodules = true;
};
dontUseCmakeConfigure = true;
pyproject = true;
propagatedBuildInputs = [ tqdm requests torch numpy torchdata ];
nativeBuildInputs = [ cmake ];
}

View File

@@ -1,42 +0,0 @@
{ 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

@@ -1,14 +0,0 @@
{ 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 ];
}

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