Compare commits

...

299 Commits

Author SHA1 Message Date
chn
3895c35f5e packages.ufo: 编写例子的前两步 2024-09-04 15:14:33 +08:00
chn
1c4a3eea53 packages.ufo: add a test 2024-09-03 15:10:46 +08:00
chn
d67b60ded3 blog: 整理 2024-09-03 12:13:37 +08:00
chn
2d7974e256 packages.server: add compsize wrapper 2024-09-03 10:41:10 +08:00
chn
840f4a2c76 services.rsshub: add bilibili cookie 2024-09-03 07:57:36 +08:00
chn
e01eac40bd update rsshub 2024-09-03 07:16:13 +08:00
chn
09f2c713a0 fix build 2024-09-03 00:50:17 +08:00
chn
fe6ebb5e27 blog: 一些整理 2024-09-03 00:48:16 +08:00
chn
c75ec60995 modules.user: persistent subuidgid config 2024-09-02 23:14:25 +08:00
chn
e87911fef0 blog: correct emoji 2024-09-02 22:39:24 +08:00
chn
7367cae759 Revert "packages.firefox: add default-pwa profile"
This reverts commit 6fc2c61ca1.
2024-09-02 21:47:26 +08:00
chn
6fc2c61ca1 packages.firefox: add default-pwa profile 2024-09-02 21:14:56 +08:00
chn
57cdcaada2 services.postgresql: lower buffer 2024-09-02 13:20:12 +08:00
chn
651b1870af user.chn: use zsh 2024-09-02 13:18:50 +08:00
chn
e44d0f192a add note 2024-09-02 13:12:45 +08:00
chn
8180bb4792 packages.desktop: auto add wallpaper 2024-09-02 12:34:50 +08:00
chn
5d7dcd28de devices.vps7: change ip 2024-09-02 12:04:51 +08:00
chn
5e9b1fd039 devices.vps7: shrink disk size 2024-09-02 11:12:57 +08:00
chn
3350ee8680 services.rsshub: add restartTriggers 2024-09-02 01:11:10 +08:00
chn
bb598f6fa4 users.chn: add sops 2024-09-02 01:03:44 +08:00
chn
66cf4fedf5 services.vps7: add twitter auth token 2024-09-01 23:03:07 +08:00
chn
dab7902309 services.slurm: auto resume node after drain 2024-09-01 17:36:18 +08:00
chn
c5a3789e16 users.chn.konsole: fix 2024-09-01 17:25:51 +08:00
chn
16983ecbfb packages.firefox: move firefox configuration to global 2024-09-01 17:23:17 +08:00
chn
d2b5f8dda8 packages.firefox: enable pwa 2024-09-01 16:42:37 +08:00
chn
4e823d30b9 users.zzn: fix ssh key 2024-09-01 10:06:23 +08:00
chn
e38a8c277d devices.xmupc1: add zzn 2024-09-01 00:00:00 +08:00
chn
0e1aef2bf0 devices.xmupc1: add doc 2024-08-31 23:57:15 +08:00
chn
0058d1902d users: add zzn 2024-08-31 23:57:03 +08:00
chn
313fd7b9dc packages.nushell: add bin to PATH 2024-08-31 00:53:01 +08:00
chn
c348e95af4 system.networking: disable fallback dns 2024-08-30 21:20:09 +08:00
chn
2a36d775ae packages.nushell: enable zoxide 2024-08-30 20:10:39 +08:00
chn
fc25522bd0 packages.nushell: add git alias 2024-08-30 19:09:07 +08:00
chn
295c8c957c packages.nushell: fix 2024-08-30 18:56:56 +08:00
chn
e655e97a78 devices.xmupc2: remove p5000 2024-08-30 15:40:14 +08:00
chn
34c90841d0 packages.hpcstat: fix 2024-08-30 14:59:09 +08:00
chn
822c3ef607 users: add hjp wp 2024-08-30 14:41:16 +08:00
chn
910f4d64c1 move xmupc2 2024-08-30 14:03:55 +08:00
chn
c6609aacfa packages.nushell: init 2024-08-30 10:47:30 +08:00
chn
a4126c2a22 Revert "system.kernel: remove amdgpu patch"
This reverts commit fdbf027236.
2024-08-29 21:08:26 +08:00
chn
a90a841563 add btrfs patch 2024-08-29 20:51:36 +08:00
chn
fdbf027236 system.kernel: remove amdgpu patch 2024-08-29 20:43:42 +08:00
chn
38dd23b9ef fix yubikey-detector 2024-08-29 18:35:48 +08:00
chn
27334e1620 users.chn: set theme 2024-08-29 17:28:24 +08:00
chn
c1a114fee6 packages.desktop: add klassy 2024-08-29 16:44:45 +08:00
chn
7bd3eeb3b0 Revert "device.pc: use nvidia"
This reverts commit ed79903647.
2024-08-29 14:38:38 +08:00
chn
b12d519fd5 services.rsshub: fix 2024-08-29 11:41:25 +08:00
chn
5bc06f6c00 fix build 2024-08-29 08:52:53 +08:00
chn
bce6b96f8a Merge branch 'next' into production 2024-08-29 08:48:40 +08:00
chn
5ba427851e services.synapse: disable registration 2024-08-28 21:01:35 +08:00
chn
dcaaf5fa4f services.gitea: 注册需要手动确认 2024-08-28 18:43:01 +08:00
chn
ed79903647 device.pc: use nvidia 2024-08-28 08:46:07 +08:00
chn
6002e7f6df devices.pc: remove zen specialization 2024-08-28 08:39:43 +08:00
chn
4dffbaf2d4 fix build 2024-08-28 08:33:52 +08:00
chn
38df611978 Revert "users.zqq: add ssh key"
This reverts commit c7f7a46c2d.

Revert "users.zqq: init"

This reverts commit a682c67fac.
2024-08-27 12:54:43 +08:00
chn
67217e164b update everything 2024-08-27 00:55:41 +08:00
chn
4fa6352e27 devices.surface: disable unl0kr 2024-08-26 20:52:59 +08:00
chn
f32914efa7 packages.desktop: add whisper 2024-08-26 20:46:54 +08:00
chn
f94c5fe631 system.initrd: enable ipv6 2024-08-26 12:37:14 +08:00
chn
310bd3b2b7 packages.sbatch-tui: fix 2024-08-26 10:40:18 +08:00
chn
62c798d73f packages.server: add hugo 2024-08-25 13:19:36 +08:00
chn
6c0b4d5caa devices.vps4: enable xray 2024-08-25 11:19:58 +08:00
chn
41fbbf3d52 blog: init 2024-08-25 10:04:02 +08:00
chn
63d5f339ea packages.hpcstat: add support for default queue 2024-08-24 17:05:41 +08:00
chn
0470c1041c packages.biu: enable other components 2024-08-24 14:10:55 +08:00
chn
655e683b02 packages.biu: 完成 Atomic 2024-08-23 17:23:28 +08:00
chn
295153fa64 packages.ufo: fix build 2024-08-23 09:31:33 +08:00
chn
45a1c4520b packages.biu: do not check if NDEBUG 2024-08-22 22:49:21 +08:00
chn
7a152011f0 packages.ufo: use biu 2024-08-22 22:43:25 +08:00
chn
0d75fc01d4 packages.biu: add hdf5 2024-08-22 21:03:20 +08:00
chn
89b04882c1 packages.biu: add sequence 2024-08-22 20:39:34 +08:00
chn
5dd03880c1 packages.biu: 完成 eigen 转换 2024-08-22 20:10:04 +08:00
chn
aa026f332e packages.desktop: plasma disable auto suspend 2024-08-22 13:53:07 +08:00
chn
2ef7d23a4e Revert "packages.desktop: add maliit-keyboard"
This reverts commit d75e195136.
2024-08-22 10:26:05 +08:00
chn
d75e195136 packages.desktop: add maliit-keyboard 2024-08-22 10:11:23 +08:00
chn
0763319f0d devices.xmupc1: add tunnel guide 2024-08-21 20:04:40 +08:00
chn
c7f7a46c2d users.zqq: add ssh key 2024-08-21 19:09:24 +08:00
chn
49f5c72e90 Revert "devices.vps6: add forward to xmupc1 and xmupc2"
This reverts commit ffbdad9cd7.
2024-08-21 19:03:04 +08:00
chn
ffbdad9cd7 devices.vps6: add forward to xmupc1 and xmupc2 2024-08-21 18:31:59 +08:00
chn
a682c67fac users.zqq: init 2024-08-21 17:57:07 +08:00
chn
a618d4c1e7 Revert "devices.xmupc2: add archive directories"
This reverts commit 9429674b54.
2024-08-21 17:53:33 +08:00
chn
dff42c3ab7 update misskey 2024-08-21 10:38:36 +08:00
chn
aade294318 services.writefreely: init 2024-08-21 10:19:15 +08:00
chn
56dce415c3 devices.pc: change busId 2024-08-20 18:07:42 +08:00
chn
26896b20e0 devices.nas: fix 2024-08-20 15:35:33 +08:00
chn
b5019a144e hardware.gpu: fix 2024-08-20 12:03:54 +08:00
chn
73dec27855 services.nextcloud: fix 2024-08-19 21:25:43 +08:00
chn
6168d570aa hardware.gpu: add gpu tools 2024-08-19 20:08:11 +08:00
chn
39beeb7519 devices.surface: install 2024-08-19 14:40:48 +08:00
chn
652126a6f0 Revert "services.wireguard: 整理"
This reverts commit 06dde69ced.
2024-08-19 09:39:48 +08:00
chn
06dde69ced services.wireguard: 整理 2024-08-19 09:39:34 +08:00
chn
e7e5bb9ba4 packages.biu: fix eigen 2024-08-18 23:34:51 +08:00
chn
3a11512c53 devices.pc: add windows boot entry 2024-08-18 12:56:49 +08:00
chn
3003f79c22 devices.surface: disable vasp 2024-08-18 12:26:00 +08:00
chn
cd5f61f5cc devices.pc: add zen specialisation 2024-08-17 23:37:40 +08:00
chn
869e993cc2 fix libreoffice 2024-08-17 22:52:55 +08:00
chn
18a1fa529c devices.pc: add generic specialisation 2024-08-17 22:36:31 +08:00
chn
b6b3d106c2 fix kernel bug 2024-08-17 17:57:33 +08:00
chn
d65b5a2768 devices.pc: nvidia switch to production 2024-08-17 16:33:32 +08:00
chn
37b9df52a5 Revert "devices.pc: remove cachyos configuration"
This reverts commit fa4aec5641.
2024-08-17 15:02:45 +08:00
chn
933bf44edc hardware.cpus: remove iommu workaround 2024-08-17 14:39:25 +08:00
chn
e5ae5a3980 Revert "devices.pc: kernel add lantian patch"
This reverts commit 57aeb9a12e.
2024-08-17 14:39:00 +08:00
chn
57aeb9a12e devices.pc: kernel add lantian patch 2024-08-17 13:56:27 +08:00
chn
7edb72b51f fix grub 2024-08-17 12:50:14 +08:00
chn
44eb056f49 fix grub 2024-08-17 12:14:02 +08:00
chn
e408f9c488 system.kernel: add amdgpu patch 2024-08-17 10:38:21 +08:00
chn
ffdd9e63c5 system.catppuccin: disable grub theme 2024-08-17 10:32:51 +08:00
chn
38f600277c Revert "devices: remove surface, add steamdeck"
This reverts commit fba6519bc6.
2024-08-17 08:30:40 +08:00
chn
a293326f9d hardware.gpu: fix nvidia hibernation 2024-08-17 08:07:09 +08:00
chn
afe2f17526 packages.desktop: fix powerdevil settings 2024-08-17 07:37:59 +08:00
chn
9d4c89cf17 fix build 2024-08-16 17:17:12 +08:00
chn
13184ce627 packages.git-lfs-transfer: fix 2024-08-16 08:10:26 +08:00
chn
513ca90a80 update everything 2024-08-15 12:23:07 +08:00
chn
296487607b hardware.gpu: do not use open driver explicitly 2024-08-15 12:11:02 +08:00
chn
fa4aec5641 devices.pc: remove cachyos configuration 2024-08-15 12:02:18 +08:00
chn
cdb6b37080 flake: fix 2024-08-14 09:59:31 +08:00
chn
39af3963a5 packages.nvhpc: update 2024-08-14 09:56:00 +08:00
chn
8918a99d2c packages.steam: add openssl_1_1 2024-08-14 09:06:29 +08:00
chn
a6ebc8e7cb system: enable all locales 2024-08-13 23:50:16 +08:00
chn
13e5485863 packages.biu: add Eigen serialization 2024-08-13 23:44:54 +08:00
chn
c03d217f73 packages.ufo: fix 2024-08-11 18:01:46 +08:00
chn
536de32207 packages.server: add ffsend 2024-08-07 23:27:04 +08:00
chn
31ac9ee496 devices.vps7: switch to xanmod 2024-08-07 19:15:51 +08:00
chn
45812e5bc9 Revert "system.gui: remove KWIN_DRM_DISABLE_TRIPLE_BUFFERING"
This reverts commit 91a88141ad.
2024-08-05 15:01:09 +08:00
chn
91a88141ad system.gui: remove KWIN_DRM_DISABLE_TRIPLE_BUFFERING 2024-08-05 11:11:06 +08:00
chn
f97e9325fa hardware.steamdeck: fix bios update 2024-08-04 23:12:37 +08:00
chn
d6928c035f setvices.vaultwarden: fix 2024-08-04 15:38:08 +08:00
chn
7bc00c77a3 system: disable binfmt envfs nix-ld by default 2024-08-04 14:43:14 +08:00
chn
3e50d2b57b packages.steam: fix 2024-08-04 14:43:06 +08:00
chn
137f83ed38 packages.steam: add proton-ge 2024-08-04 09:47:28 +08:00
chn
97f6eed32c update misskey 2024-08-03 23:14:07 +08:00
chn
db8d826825 整理 packages 2024-08-03 17:52:26 +08:00
chn
0187a236bb devices.nas: remove root1 root2 2024-08-03 16:35:43 +08:00
chn
51b9ca5023 packages: add sleepy-launcher 2024-08-02 19:52:42 +08:00
chn
b46932524c hardware.steamdeck: use prerelease decky-loader 2024-08-02 17:54:57 +08:00
chn
41b2c08f48 system: disable ipfs for now 2024-08-02 17:18:08 +08:00
chn
d6de265cbb packages: move some packages to desktop-extra 2024-08-02 09:18:56 +08:00
chn
d1331c6b0c devices.steamdeck: fix aagl 2024-08-01 23:48:44 +08:00
chn
dc7e408200 packages.plasma: disable auto-suspend 2024-08-01 19:53:24 +08:00
chn
88e21a4d99 packages: move aagl to desktop-extra 2024-08-01 19:40:23 +08:00
chn
47ebaec698 fix steam cjk font 2024-08-01 19:39:12 +08:00
chn
ae61dfb1d9 hardware.steamdeck: enable touch screen support 2024-08-01 19:31:27 +08:00
chn
f5bf3bff8f devices.steamdeck: install 2024-08-01 11:29:10 +08:00
chn
699c76ccc4 packages.hpcstat: update doc 2024-08-01 01:27:22 +08:00
chn
4bde656017 system.initrd: add unl0kr support 2024-08-01 00:37:37 +08:00
chn
570befc1f5 move local/pkgs -> packages 2024-08-01 00:25:23 +08:00
chn
aa70bbe0e4 move local/lib -> lib.nix 2024-08-01 00:21:18 +08:00
chn
bb5d5229a5 system.nixpkgs: fix 2024-07-31 12:55:06 +08:00
chn
12e6b1e42e system.nixpkgs: fix 2024-07-31 10:55:51 +08:00
chn
aca32969c1 devices.nas: remove gui 2024-07-31 10:44:21 +08:00
chn
7a468bc611 fix some warnings 2024-07-31 08:59:06 +08:00
chn
113b5468d1 fix steamdeck support 2024-07-31 08:36:29 +08:00
chn
2e42bbabf2 fix steamdeck 2024-07-30 23:29:25 +08:00
chn
4fe4a96807 update nixpkgs 2024-07-30 23:08:37 +08:00
chn
fba6519bc6 devices: remove surface, add steamdeck 2024-07-30 23:05:48 +08:00
chn
5348faf83b localPackages.vasp.hdf5-nvhpc: fix 2024-07-30 16:21:05 +08:00
chn
76b5c5dd16 localPackages.mumax: fix 2024-07-30 08:46:26 +08:00
chn
21f3e095e6 packages.desktop-extra: fix 2024-07-30 08:28:56 +08:00
chn
9185cf65cb system.kernel: fix 2024-07-30 08:28:52 +08:00
chn
6e16e52064 services.snapper: fix 2024-07-29 22:49:27 +08:00
chn
245e4897c6 packages.workstation: fix 2024-07-29 22:43:13 +08:00
chn
7c53d4c351 services.ollama: fix 2024-07-29 22:05:11 +08:00
chn
167ed596d8 hardware.sound: fix 2024-07-29 14:43:59 +08:00
chn
c5a318a918 update everything 2024-07-29 13:36:18 +08:00
chn
5ca6cc05f3 devices.pc: add advanced uefi settings 2024-07-25 22:54:41 +08:00
chn
247c1d945a packages.ssh: fix surface 2024-07-25 22:34:56 +08:00
chn
2d45e5c9f5 packages.desktop-extra: add onedrive 2024-07-25 21:45:00 +08:00
chn
2df2bfd0cf packages.server: add libva-utils 2024-07-25 21:44:01 +08:00
chn
bb558e5447 add mingwW64Static 2024-07-25 18:21:34 +08:00
chn
086281c6ad localPackages.winjob: try to fix unix socket binding 2024-07-25 18:13:42 +08:00
chn
a39966adab devices.nas: add nat 2024-07-25 15:40:19 +08:00
chn
f294f7e11b devices.nas: fix kvm network 2024-07-25 14:33:09 +08:00
chn
0d6d1f43e6 localPackages.winjob: 尝试 grpc 2024-07-25 14:31:29 +08:00
chn
9b8a0ce08a devices.nas: enable docker and kvm 2024-07-24 22:59:20 +08:00
chn
a6a629e657 devices.nas: enable xrdp 2024-07-24 22:58:10 +08:00
chn
ae4774d118 localPackages.winjob: implement read owner of file on Windows 2024-07-24 21:27:13 +08:00
chn
8c6a25906d services.meilisearch: fix 2024-07-24 13:19:35 +08:00
chn
a032f5b147 devices.nas: remove unused services 2024-07-24 13:15:01 +08:00
chn
a8d2014cf2 Revert "devices: remove surface"
This reverts commit 7bac949a8e.
2024-07-24 09:19:26 +08:00
chn
0abc2fb74e move nas to home 2024-07-24 09:15:17 +08:00
chn
c2d94b197c system.nixpkgs: fix c-blosc build 2024-07-23 21:53:46 +08:00
chn
fb9dc40813 devices.pc: remove root2 2024-07-23 17:48:53 +08:00
chn
77ce521f88 devices.nas: use desktop-fat package set 2024-07-22 21:48:03 +08:00
chn
aac97bbf09 packages.server: add rr 2024-07-22 11:40:22 +08:00
chn
4e72a44d4e devices.nas: move hpcstat to xmupc1 2024-07-22 10:35:14 +08:00
chn
946ff559c0 update aagl 2024-07-20 09:14:56 +08:00
chn
13d7bc7c66 services.beesd & xray: lower log level 2024-07-20 09:00:50 +08:00
chn
7bac949a8e devices: remove surface 2024-07-20 08:54:02 +08:00
chn
fdbc7d0931 packages: move some packages from workstation to desktop-extra 2024-07-20 08:54:02 +08:00
chn
8fec364ae6 Revert "devices.pc.beesd: set loadAverage to 8"
This reverts commit 3d05e92553cde8b48020bd79549558334059409b.
2024-07-20 08:54:02 +08:00
chn
575b49c6cb packages.git: fix 2024-07-20 08:54:02 +08:00
chn
a35a65d54b devices.surface: change wallpaper 2024-07-20 08:54:02 +08:00
chn
3156219ae0 packages.git: workaround for lfs ssh multiplexing 2024-07-20 08:54:02 +08:00
chn
d8c236a6e7 localPackages.git-lfs-transfer: init 2024-07-20 08:54:02 +08:00
chn
ced74597d6 fix yubikey-touch-detector 2024-07-20 08:54:02 +08:00
chn
8a5cf1a721 devices.pc.beesd: set loadAverage to 8 2024-07-20 08:54:02 +08:00
chn
b19602c33f deivces.pc: remove linwei-stuff and lammps-SiC 2024-07-20 08:54:02 +08:00
chn
d48e55e280 services.ollama: init 2024-07-20 08:53:56 +08:00
chn
135df14fff services.fz-new-order: remove manager 2024-07-11 21:58:28 +08:00
chn
52cd11dd2b 整理打包 2024-07-11 19:31:59 +08:00
chn
b9f287e089 add note 2024-07-11 16:18:33 +08:00
chn
bffe5b809d disable ccache for cuda 2024-07-10 07:33:14 +08:00
chn
4753943bbe Merge branch 'production' into next 2024-07-09 23:49:16 +08:00
chn
2d91bd4ea0 system.gui: try to fix kde 2024-07-09 23:38:30 +08:00
chn
8270fa73df add todo 2024-07-09 20:43:47 +08:00
chn
a1097b60e9 user.chn.plasma.theme: disable kinetic scrolling 2024-07-09 20:21:28 +08:00
chn
f8aca249b8 add todo 2024-07-09 19:49:52 +08:00
chn
1d581eb756 fix ccache 2024-07-09 17:30:26 +08:00
chn
414685c95a system.nixpkgs: enable ccache for chromium 2024-07-08 23:48:22 +08:00
chn
745d7613b8 system.nix: remove some nix daemon resource limit 2024-07-08 21:18:34 +08:00
chn
0d61d71fdb fix dev 2024-07-08 21:17:39 +08:00
chn
84bdee3f93 system.nixpkgs: disable contentAddressedByDefault 2024-07-07 23:28:18 +08:00
chn
99e4e9da89 fix u2f 2024-07-07 15:42:26 +08:00
chn
34a82e7a53 devices.xmupc2: add archive directories 2024-07-07 14:56:04 +08:00
chn
ba270a2830 add todo 2024-07-06 10:37:45 +08:00
chn
4c6f25118d Revert "devices.pc: disable native build"
This reverts commit 0026ff0382.
2024-07-06 10:31:05 +08:00
chn
42484394f1 system.nixpkgs: enable content-addressed store only on native 2024-07-06 09:12:38 +08:00
chn
24405876d1 fix build 2024-07-05 20:26:16 +08:00
chn
0026ff0382 devices.pc: disable native build 2024-07-05 20:08:21 +08:00
chn
a9eda967cf update everything 2024-07-05 20:04:35 +08:00
chn
93c6869896 try to fix amdgpu 2024-07-05 18:59:50 +08:00
chn
24f3d75f4b devices.pc: add archive dir 2024-07-05 16:17:57 +08:00
chn
bc7561ed10 localPackages.misskey: fix 2024-07-05 15:17:57 +08:00
chn
2929d620a4 fix build 2024-07-05 09:29:55 +08:00
chn
6de39f3eba Merge branch 'production' into next 2024-07-04 22:50:46 +08:00
chn
21b4246800 localPackages.sbatch: fix 2024-07-04 17:44:01 +08:00
chn
c9626a0c57 packages.ssh: add vps4 2024-07-04 17:35:53 +08:00
chn
90cb6117aa init winjob 2024-07-04 17:28:39 +08:00
chn
af98c9a312 localPackages.biu: giveup support for win32
localPackages.winjob: init
2024-07-04 14:07:12 +08:00
chn
1c1793dd62 devices.vps4: enable znver2 optimization 2024-07-04 13:24:38 +08:00
chn
9b5ccd0747 fix initrd ssh 2024-07-04 11:02:47 +08:00
chn
ca299e0346 try to setup winjob develop env 2024-07-03 22:22:14 +08:00
chn
34e55061a2 localPackages.hpcstat: 删除重复依赖 2024-07-03 16:59:55 +08:00
chn
ec2540a628 localPackages.hpcstat: ssh command add time limit 2024-07-03 16:17:38 +08:00
chn
fef4d06de1 localPackages.biu: exec allow set time limit 2024-07-03 16:06:38 +08:00
chn
0e4f1d06a9 localPackages.hpcstat: add lock only when connect to db 2024-07-03 16:03:24 +08:00
chn
88a399769f localPackages.biu: exec allow set time limit 2024-07-03 14:54:06 +08:00
chn
56e14750fe fix 2024-07-03 13:48:37 +08:00
chn
30c5d93685 update everything 2024-07-03 13:42:15 +08:00
chn
a519d7426f update aagl 2024-07-03 12:53:43 +08:00
chn
a89fe55896 system.initrd: fix network 2024-07-03 11:52:57 +08:00
chn
ed349970c2 devices.pcvm: fix 2024-07-03 10:03:04 +08:00
chn
5c9774e906 system.initrd: Enable sulogin on boot failure 2024-07-03 09:58:40 +08:00
chn
76414e846e add pcvm 2024-07-03 07:49:52 +08:00
chn
00e693b7c8 devices.pc: remove nvidia workaround 2024-07-02 13:25:01 +08:00
chn
e6a5cd695e fix initrd ssh and ssh cve 2024-07-02 13:24:01 +08:00
chn
e3c2861cf5 devices.pc: use xanmod by default 2024-07-01 02:41:09 +08:00
chn
01eee80cd2 devices.vps6.xray: add user 2024-06-30 18:44:25 +08:00
chn
4d69011483 devices.pc: Add a second root partition 2024-06-30 10:34:01 +08:00
chn
09cbc8cecd 整理flake 2024-06-29 21:39:16 +08:00
chn
52c6f7b599 remove fluent-kde 2024-06-29 19:00:35 +08:00
chn
952735986d remove win11os-kde 2024-06-29 18:59:42 +08:00
chn
617759b885 remove emacs 2024-06-29 18:58:03 +08:00
chn
c9fed73dcb remove deploy-rs 2024-06-29 18:56:38 +08:00
chn
8bdef9e7f5 devices.pc: add some workaround 2024-06-28 22:51:02 +08:00
chn
ea4670fde6 devices.surface: fix iptsd 2024-06-28 18:56:20 +08:00
chn
4f26f648f0 Revert "devices.surface: remove iptsd config"
This reverts commit 959ca6c9b6.
2024-06-28 18:52:27 +08:00
chn
959ca6c9b6 devices.surface: remove iptsd config 2024-06-28 18:08:40 +08:00
chn
babb01cd42 packages.desktop: remove catppuccin-gtk 2024-06-28 17:06:26 +08:00
chn
1ef3245e52 users.chn: set catppuccin 2024-06-28 16:52:56 +08:00
chn
2f096af374 packages.desktop: add catppuccino theme 2024-06-28 16:25:35 +08:00
chn
af2f8ddb3e services.gitea: fix 2024-06-28 12:51:20 +08:00
chn
2723044b35 write setup script 2024-06-27 19:03:37 +08:00
chn
4a6d58e6a2 devices.vps4: set secrets 2024-06-27 17:40:52 +08:00
chn
93d2999523 fix whalebird 2024-06-27 16:36:12 +08:00
chn
1ded318fed devices.pc: some workaround 2024-06-26 22:02:22 +08:00
chn
be69db5925 update chaotic 2024-06-26 21:19:17 +08:00
chn
5791b79245 temp 2024-06-26 21:08:46 +08:00
chn
094df77b5b packages.desktop-extra: add whalebird 2024-06-26 15:22:13 +08:00
chn
c9778ac500 use breeze theme 2024-06-26 15:11:48 +08:00
chn
3078090edf remove unused themes 2024-06-26 15:01:21 +08:00
chn
3767de3c2a devices.pc: change wifi card 2024-06-26 14:53:27 +08:00
chn
6fc897d5b2 packages.desktop: add whitesur theme 2024-06-26 14:44:42 +08:00
chn
0575ba1cc4 update nixos-hardware 2024-06-26 09:58:53 +08:00
chn
96b58c16fe Revert "user.chn: switch theme to Fluent"
This reverts commit f209baaa0f.
2024-06-25 17:32:29 +08:00
chn
32e1004a2d Revert "system: do not auto mount ipfs"
This reverts commit 85b4404e7a.
2024-06-25 17:32:01 +08:00
chn
85b4404e7a system: do not auto mount ipfs 2024-06-25 17:12:22 +08:00
chn
f209baaa0f user.chn: switch theme to Fluent 2024-06-25 14:31:55 +08:00
chn
46583151f4 devices.pc: disable xrdp 2024-06-25 14:13:13 +08:00
chn
01b766e5ee devices.vps4: setup 2024-06-25 14:03:58 +08:00
chn
6f5a077821 devices.vps6/vps7: add generic specialisation 2024-06-25 09:34:09 +08:00
chn
bc244352b8 devices.vps7: switch to znver2 2024-06-25 06:55:40 +08:00
chn
2be529f590 services.xray: fix 2024-06-24 23:32:31 +08:00
chn
843abfbef9 resolve warnings 2024-06-24 10:48:36 +08:00
chn
e376302c52 hardware.cpus: split config 2024-06-24 10:23:59 +08:00
chn
af8426d40c Merge branch 'production' into next 2024-06-23 19:56:41 +08:00
chn
428d12b7b9 system: enable kubo 2024-06-23 19:41:33 +08:00
chn
47c77e8ce1 system.nixpkgs: fix build 2024-06-23 12:16:01 +08:00
chn
4a1f12adbb packages.vscode: fix plugins 2024-06-23 11:37:49 +08:00
chn
fc0500c547 system.nixpkgs: add electron_28 to permittedInsecurePackages 2024-06-23 11:36:04 +08:00
chn
632e3baae9 system.nixpkgs: remove old electron 2024-06-23 11:35:19 +08:00
chn
c36216802c remove nixpkgs-unstable 2024-06-23 11:33:51 +08:00
chn
98f6fef8fe packages.desktop: remove kwin explicit-sync patch 2024-06-23 11:31:29 +08:00
chn
721c34262b fix build 2024-06-22 18:03:44 +08:00
chn
b56f73d426 update nixpkgs 2024-06-22 16:17:43 +08:00
chn
c4355be79d system.nixpkgs: enable contentAddressedByDefault 2024-06-22 16:12:08 +08:00
chn
21f822e5aa system.nix: enable ca-derivations 2024-06-22 16:04:24 +08:00
chn
2e68c70773 update everything 2024-06-22 16:03:30 +08:00
chn
153687806b packages.ssh: add internal.jykang 2024-06-20 21:00:09 +08:00
323 changed files with 4362 additions and 3880 deletions

1
.gitattributes vendored
View File

@@ -2,3 +2,4 @@
*.icm filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text
*.efi filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored
View File

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

View File

@@ -1,6 +1,7 @@
keys: # cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
- &chn age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
- &pc age1ffvr5pqd2lfj24e3fh53s92z6h76fda3du4y4k6r3yjumdwvpfgqzj033a
- &vps4 age1yvrl4y0r6yzcxzzkgfwshlrtsjt8uuya6rfwks09pnft7esfcyvqmrtm5q
- &vps6 age164tyqklwhdm57tfm5u863mdt2xrzrrzac4py8a0j9y6kzqcjy9zsp073t6
- &vps7 age137x7csalutwvfygvvzpemlsywvdxj3j4z93a50z2sjx03w6zau8q3r5902
- &surface age1ck5vzs0xqx0jplmuksrkh45xwmkm2t05m2wyq5k2w2mnkmn79fxs6tvl3l
@@ -8,12 +9,18 @@ keys: # cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
- &xmupc1 age1hnarptkze0ujpp05dqr8uma04cxg9zqcx68qgpks5uf5l6rpk5gqhh8wxg
- &xmupc2 age1l4stuz0vr7gs7pqwjrmezam44702jp2vmqaqyxw0l0r42kf9updq4dfhrw
- &pi3b age1yjgswvexp0x0de0sw4u6hamruzeluxccmx2enxazl6pwhhsr2s9qlxdemq
- &pcvm age1jmu4jym0e0xkq5shx2g7ef4xzre94vaxy2n4fcn0kp94dtlupdxqkzyyp7
creation_rules:
- path_regex: devices/pc/.*$
key_groups:
- age:
- *chn
- *pc
- path_regex: devices/vps4/.*$
key_groups:
- age:
- *chn
- *vps4
- path_regex: devices/vps6/.*$
key_groups:
- age:
@@ -49,3 +56,8 @@ creation_rules:
- age:
- *chn
- *pi3b
- path_regex: devices/pcvm/.*$
key_groups:
- age:
- *chn
- *pcvm

4
blog/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/themes
/public
/.hugo_build.lock
/resources/_gen

View File

@@ -0,0 +1,5 @@
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++

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

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

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

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

View File

@@ -0,0 +1,7 @@
---
weight: 1
bookFlatSection: true
title: "Example Site"
---
{{< callout emoji="​🏗️" >}} 施工中 {{< /callout >}}

View File

@@ -0,0 +1,5 @@
---
title: Blog
---
我得在这里写点什么

View File

@@ -0,0 +1,49 @@
---
title: Helloworld
date: 2024-08-24T20:13:59+08:00
draft: false
summary: 为什么不问问神奇海螺呢?
math: true
---
# 一级标题
## 二级标题
### 三级标题
hello world!
* 无序列表1
* 无序列表2
* 无序列表3
1. 有序列表1
2. 有序列表2
3. 有序列表3
> 这是一个引用
> 写了两行
如果段与段之间
没有空行
会怎样?
```c++
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
```
这是一个行内代码`printf("Hello, World!\n");`,和行内公式 $E=mc^2$。
$$
\int_{-\infty}^{+\infty} e^{-x^2} \dd x = \sqrt{\pi}
$$
**这是粗体文本***这是斜体文本*。
[这是一个链接](https://www.example.com)

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

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

13
blog/default.nix Normal file
View File

@@ -0,0 +1,13 @@
{ stdenv, hextra, hugo }: stdenv.mkDerivation
{
name = "blog";
src = ./.;
nativeBuildInputs = [ hugo ];
configurePhase =
''
mkdir themes
ln -s ${hextra} themes/hextra
'';
buildPhase = "hugo";
installPhase = "cp -r public $out";
}

132
blog/hugo.yaml Normal file
View File

@@ -0,0 +1,132 @@
baseURL: https://blog.chn.moe/
theme: hextra
enableRobotsTXT: true
enableGitInfo: false
enableEmoji: true
hasCJKLanguage: true
# services:
# googleAnalytics:
# ID: G-MEASUREMENT_ID
outputs:
home: [ html ]
page: [ html ]
section: [ html, rss ]
defaultContentLanguage: zh-cn
languages:
zh-cn:
languageName: 简体中文
languageCode: zh-CN
weight: 1
title: My New Hugo Site
en:
languageName: English
weight: 2
title: My New Hugo Site
contentDir: content/en
# Needed for mermaid/katex shortcodes
markup:
goldmark:
renderer:
unsafe: true
highlight:
noClasses: false
enableInlineShortcodes: true
menu:
main:
- name: Search
weight: 1
params:
type: search
sidebar:
- identifier: more
name: More
params:
type: separator
weight: 1
- identifier: welcome
name: 欢迎页
pageRef: /
weight: 2
- identifier: about
name: 关于本站
pageRef: /about
weight: 3
- identifier: contact
name: 联系我
pageRef: /contact
weight: 4
params:
description: Modern, responsive, batteries-included Hugo theme for creating beautiful static websites.
navbar:
displayTitle: true
displayLogo: true
logo:
path: images/logo.svg
dark: images/logo-dark.svg
# width: 40
# height: 20
# link: /
width: wide
page:
# full (100%), wide (90rem), normal (1280px)
width: normal
theme:
# light | dark | system
default: system
displayToggle: true
footer:
enable: true
displayCopyright: true
displayPoweredBy: true
width: normal
displayUpdatedDate: true
dateFormat: "January 2, 2006"
search:
enable: true
type: flexsearch
flexsearch:
# index page by: content | summary | heading | title
index: content
# full | forward | reverse | strict
# https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search
tokenize: forward
editURL:
enable: true
base: "https://github.com/imfing/hextra/edit/main/exampleSite/content"
blog:
list:
displayTags: true
# date | lastmod | publishDate | title | weight
sortBy: date
sortOrder: desc # or "asc"
highlight:
copy:
enable: true
# hover | always
display: hover
comments:
# TODO: enable cusdis
enable: false
type: giscus
# https://giscus.app/
giscus:
repo: imfing/hextra
repoId: R_kgDOJ9fJag
category: General
categoryId: DIC_kwDOJ9fJas4CY7gW
# mapping: pathname
# strict: 0
# reactionsEnabled: 1
# emitMetadata: 0
# inputPosition: top
# lang: en
math: true

View File

@@ -4,6 +4,8 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJ/jzUQ6QuAjnAryvpWk7TReS6pnHxhEXY9RonojKk
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCtnVhZQsJfbs2w9hFZkx4qDhIs++7no+6r5TifP3Dq7epJYd2QYx4dI66XxTNhKxZjN6a4Xn5nFlYLtQJXOvzBLC8IBf1W5GCH0k/jqzzskS0/Ix/70HzcBwJk8ihWDkyON5Ki1BRCx34RNxth1BIxWyc5QT+lou+D92x8iAu/uOvmcAL3Ua0OlZwxw03hLp/PpS4ZnUqFjc2JVtarY7eQu/i3RwOZUaK6nT2EL8RObzk4xnieqsU5PWwA3voVjetqZaDQ+P7dimQXz/FaucroKxCNyTiy1oG4fdQpm2UDrH6ZfPvdQLYrtet6FQabXOxhV7MuR3jYtxZjs1kDVZIseIZ6IwjetaUoMxvIouRfYjOSIEo9Ek9o0+Yhku4r0uWmPDrymWugU1raMmlRxSUwdlzW+C7mQwtGbs/MG4MN4GWkM6id5DKlY2vYKUfrTzmhY1swCtzKq20fjvyX8qhJdcytgVlOrBZnPje6Qd55sI0RjdgJrBsxT2SYquez7U8= yjq@xmupc1
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDn1pfGen7kjPTHsbb8AgrUJWOeFPHK5S4M97Lcj3tvdcjZi2SXN6PwHQfh8/xGhZbTLPz/40S9O9/Dn30xkUTfnONirKt790jp7VEbOtPnjQPOd/KRNWlS3VV0BELuq5p633Mi13rP6JZtdKmU2uSkvvaUBfCppy3JaWv/B7HLJ48f8IzkdiT1px3dN1eQ4SFoHOiVG0ci5TGG6wfMdoAAnM9R1aXI4gDxnYjLYujpaNZ4hBOta/6ZK/PV0JufoXdIAZjubgk1Hv04XHXLR2Z0UhRM6x7UrZIOdM/LlnKmcVk408ZKEj/9m1xRyDsNoZ24CF++cmnwfBHrp9I5nvDI7xOTdZlOhzkiiPM3f4i6s2Qjdv4vpZ6AeE3Qt1LVQyAr67b4UMjHuYqSi2KgyCO6My2Ov2eRoS74EKcb8ejJv3O+XInmYUgDgTgDFT3CgQgK2DG45HiV6nOkaE/6iKx2JSOiYZTFc7TRcePfXF9JQD7dXFde6qm3EbIVyJIpCJ8= zem@xmupc1
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCW2fx1Sim7X2i/e/RBPEl1q/XbV7wa9pmZfnRINHIv24MCUgtNZ5GHEEW7dvzrQBeRj3I7CAyK8fbuhv/l8HuDtjxJJ1fmcBp9UG5vfpb/UTxayJxHBRrwokp2JL7HKVviI6d8FcNa/T0CMoUNYXnel6dE3B78k9Q0dDxlOGS1MzgsP3Pn66lm0ww9FRAVHe+KkhFmwyQ1VHUxHgK4QjCIt7+9+PJE7fK0aVWBsR309pui7Pbm6mgd4d6mwiBeVvxsNGnI4DsO1hz4N2GapuQy19PDiG7A4H41Z5RYQnv/3XTy4TBXOFQm77v6pyGkCmG6BGnRdvMB6C0hWPJvudbsA/BNp4ApL7/CrwTdLp1z6ToAOLvKrUQAM+hcbJimnFVMXqz7iSYg99XTnzue7ncecp19XiaDJbM47bGXcT4nTO5XaiMYi2xGAHIrij5GIuFF5ymKYSp5ejb1VucMdKlaaAmS10+wdUcuT7tzX/IuVr5aqg2dsxT5aJCRhZ1k2V0= xly@xmuhpc
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMRpyIU8ZuYTa0LvsVHmJZ1FA7Lbp4PObjkwo+UcpCP8 wp@xmupc1
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGRZp8xp9hVO7e/6eflQsnFZj853IRVywc97cTevnWbg hjp@xmupc1
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmJoiGO5YD3lbbIOJ99Al2xxm6QS9q+dTCTtlALjYI5f9ICGZJT8PEGlV9BBNCRQdgb3i2LBzQi90Tq1oG6/PcTV3Mto2TawLz5+2+ym29eIq1QIhVTLmZskK815FpawWqxY6+xpGU3vP1WjrFBbhGtl+CCaN+P2TWNkrR8FjG2144hdAlFfEEqfQC+TXbsyJCYoExuxGDJo8ae0JGbz9w1A1UbjnHwKnoxvirTFEbw9IHJIcTdUwuQKOrwydboCOqeaHt74+BnnCOZhpYqMDacrknHITN4GfFFzbs6FsE8NAwFk6yvkNXXzoe60iveNXtCIYuWjG517LQgHAC5BdaPgqzYNg+eqSul72e+jjRs+KDioNqvprw+TcBBO1lXZ2VQFyWyAdV2Foyaz3Wk5qYlOpX/9JLEp6H3cU0XCFR25FdXmjQ4oXN1QEe+2akV8MQ9cWhFhDcbY8Q1EiMWpBVC1xbt4FwE8VCTByZOZsQ0wPVe/vkjANOo+brS3tsR18= 00@xmuhpc
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxcIWDQxVyIRqCGR4uWtrh4tLc025+q6du2GVsox8IzmBFkjNY8Au5GIMP5BKRstxFdg3f/wam8krckUN9rv5+OHB9U8HGz77Xs0FktqRVNMaDPdptePZQJ9A9eW3kkFDfQnORJtiVcEWfUBS3pi0QFOHylnG27YyC/Vjx9tjvtJWKsQEVTFJbFHPdi+G7lHTpqIGx+/a2JN9O6uVujXXYvjSVXsd+CWB9VMZMvYCIz2Ecb6RqR3brj4FhRRl8zyCj+J4ACYFdGWL98fTab2uPHbpVeKrefFFA43JOD/4zwBx/uw7MAQAq0GunTV3FpBfIAQHWgftf2fSlbz20oPjCwdYn9ZuGJOBUroryex7AKZmnSYM3biLHcctQfZtxqVPEU3W/62MUsI/kZb9RcF24JRksMoS2XWTiv2HFf5ijQGLXXOjqiTlGncwiKf65DwkDBsSxzgbXk5Uo86viq6UITFXPx/RytU+SUiN4Wb7wcBTjt/+tyQd1uqc7+3DCDXk= 01@xmuhpc

View File

@@ -10,12 +10,11 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/13BC-F0C9" = "/boot/efi";
vfat."/dev/disk/by-uuid/627D-1FAA" = "/boot";
btrfs =
{
"/dev/disk/by-uuid/0e184f3b-af6c-4f5d-926a-2559f2dc3063"."/boot" = "/boot";
"/dev/mapper/nix"."/nix" = "/nix";
"/dev/mapper/root1" =
"/dev/mapper/root3" =
{
"/nix/rootfs" = "/nix/rootfs";
"/nix/persistent" = "/nix/persistent";
@@ -30,8 +29,6 @@ inputs:
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/a47f06e1-dc90-40a4-89ea-7c74226a5449".mapper = "root3";
"/dev/disk/by-uuid/b3408fb5-68de-405b-9587-5e6fbd459ea2".mapper = "root4";
"/dev/disk/by-uuid/a779198f-cce9-4c3d-a64a-9ec45f6f5495" = { mapper = "nix"; ssd = true; };
@@ -39,10 +36,9 @@ inputs:
delayedMount = [ "/" "/nix" ];
};
swap = [ "/nix/swap/swap" ];
rollingRootfs.waitDevices = [ "/dev/mapper/root2" "/dev/mapper/root3" "/dev/mapper/root4" ];
rollingRootfs.waitDevices = [ "/dev/mapper/root4" ];
};
initrd.sshd.enable = true;
grub.installDevice = "efi";
nixpkgs.march = "silvermont";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
networking = { hostname = "nas"; networkd = {}; };
@@ -51,17 +47,14 @@ inputs:
services =
{
snapper.enable = true;
samba = { enable = true; hostsAllowed = "192.168. 127."; shares = { home.path = "/home"; root.path = "/"; }; };
sshd = {};
xray.client = { enable = true; dnsmasq.hosts."git.nas.chn.moe" = "127.0.0.1"; };
groupshare = {};
smartd.enable = true;
beesd.instances =
{
root = { device = "/"; hashTableSizeMB = 4096; threads = 4; };
nix = { device = "/nix"; hashTableSizeMB = 128; };
};
nginx = { enable = true; applications.webdav.instances."local.webdav.chn.moe" = {}; };
wireguard =
{
enable = true;
@@ -69,10 +62,7 @@ inputs:
publicKey = "xCYRbZEaGloMk7Awr00UR3JcDJy4AzVp4QvGNoyEgFY=";
wireguardIp = "192.168.83.4";
};
hpcstat = {};
gitea = { enable = true; hostname = "git.nas.chn.moe"; ssh = { hostname = "office.chn.moe"; port = 5440; }; };
};
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
};
}

View File

@@ -2,26 +2,8 @@ xray-client:
uuid: ENC[AES256_GCM,data:97aX07G5FPumdWcDxnYOs6fRgljXWuwyNXGg1d7zdbUUfNnb,iv:+wAC/DZXsg+evYFA4DMfLw5Ut3ExQl1RgZ/2AsNQDpo=,tag:ebD77muITHof+FQMydWobg==,type:str]
acme:
token: ENC[AES256_GCM,data:OrYgBRU1VPpkpDzYMFHINfPSHsXEKABdZOcgiAiBJKcreBoaSVHUvg==,iv:XIeZPJhzmUi5ZHKBCYN5UA9HWH1K+26SvcIWVrHAYDA=,tag:3F93syLBZjcHwnRRkUEjlw==,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]
gb: ENC[AES256_GCM,data:jIR3EVdATYUgWmW4J8RdURJRmDBC84t0S/c2EzWwtFMtjgKlqg52fIfQ66i7RnIYRAoF+s4Ex0aLSejWgzQ69NA/AF0AIS7Y/Q==,iv:mvTCTP0E74QlvM8TcY4o49G5kNGs5HFx3YUrj6mCrwM=,tag:LXfIOyAB10XuHA6Cg7LBeQ==,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]
telegram:
token: ENC[AES256_GCM,data:NK9Eq3jUaMVNyPyqiXEkrc4m81c2CBg3p9TjpD8TQgKRYs2uxT9lsSrLMi02Rw==,iv:N2mjY9n7QuLD2PG4gNl79c933GTCCfw35XxluiLSuOA=,tag:ZLreEQoV+O0yhHw0CM00aQ==,type:str]
chat: ENC[AES256_GCM,data:XJi6HftAygFH,iv:ea2m41/YXp0VyxR9U84xMCHdknZBhP2QUiX6zsipaFc=,tag:+/Y2bvUwrQsLVGUZp0Imwg==,type:str]
hpcstat:
key: ENC[AES256_GCM,data:3bMieouWGMEw8eu6z55TX66NAGiF/O5dRtnDTjDtNC3fmR4PTn+FreMZuA9+AjTPUm2GsS9esC6tULIzh+qTflnSrxqtTdKAbfqY6o8pPPpDJ9WWm4f/g3x8PnvlsyQDYCZ0MYKYg3cc6n60moCzv1WWlVsT8QUMTXQL3yb36vVzo4ELea4Gf2UkpfYKX89gFDtJK78srh7rj8rwoDiBs1qVUUnIBABUDLxoyC3Rym5yevrCJeFD+8AlIAIaMc62Kslw0lCCKKSaXGsFpppFYFwUTedi595eISEr4tIuPXVd4EECQchsYg+tInphIXebp/5rzXQM37yQEymImNRiMcxDWGR0B8Nq9XO+I5T8VOIb6xXCtvEeY2Z8nPfmUn9UHfvYzqFv3it5TCcd9J4SeBa2LVW8+YCIO/KitznL49O5SGAJUONIkcwMUhUuXQUFe/vnc+g8+yqB5ltCZtHWCOY2pCdmQpBRaZq55fcde5FNhxt3J8zCbu++oIn+ERSHadMIGMuGgGqzG6XDQJZN,iv:cbPCnNi2gX1gZIdcQd7HR3c/JEsWj3nv+x+OQ0bDs40=,tag:olrGr6t2Si39wl/1rR81ig==,type:str]
postgresql:
gitea: ENC[AES256_GCM,data:qssnsnlaEKwEnLbnpX+XDs7JK/2DdK1cxD6U2NddpCPnwfOinP2cuc1HLnteWQfYZXTuYM3VOXDEXQB9CexILA==,iv:+TVoTuqmxIsTlNPngMBBWgIvP5EQD5ROHZI4u0mSJGE=,tag:6X8hewc5a6C6nbuD5WozCQ==,type:str]
mail:
bot: ENC[AES256_GCM,data:ugfBeRM4Ks7j+V4lLOqHrA==,iv:QwXeSrfw+TTN5N42DaaA7YgpaIJX/E+kTv9p6eWSxEk=,tag:fLUDBhsvCbOiYqhq9TCzmw==,type:str]
sops:
kms: []
gcp_kms: []
@@ -46,8 +28,8 @@ sops:
by9Rd0U0bzNiK21BQTNxN1RuQ09DQVkKJmSlzV5ppEkZFljsS17ZWmoI++fz4tJh
kTdoAStG1zsKASHyZTsmdm3RBDO3qV1KhQC2gC7d4EiwNZngxOOZJg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-10T08:52:02Z"
mac: ENC[AES256_GCM,data:gKEZ0bxn+xCu7wPRCRpacErzqdajw4zNalUwZvldUP+Ygdq6KOMgjxvm3hy7GIBlhK2MLgps3X3sjdrUW1A7Tx5wiPtrqddVo5qiubZcuWqNO4SSoM2x/VxtHbKcZQMaNdIHXx3TUFjQ0tcsMuDBNNUZ192JJUDE/DaDyxTklq4=,iv:sZ98srsM68h59R9HHeh7gXdUBN2JtoWx+PhU1nsHgk0=,tag:N7211a4Jrp6AdPKhQCz65g==,type:str]
lastmodified: "2024-07-24T05:14:57Z"
mac: ENC[AES256_GCM,data:9xKBuoVeotcZfiqsKg+iXxOc5BV9kGVvR5f9Anu6DauBceYIBxgeVCDU3dRUPz67MkOK/n2w9+gLchQxUyK8G4ECRTESL+GKpZslNVThb2j6vswLXNBHqsQCoQBlYOiKw5ZM1gpdYJPni8qpsdGvTwc5JkW+FH6v1BdZWaUhc3U=,iv:SyLiMXsQhS+8FFlSMXiD9ETD+mIsz6mePXnJzBODK5g=,tag:YpiU58lJ5Nb78EMyEmJdbw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

BIN
devices/pc/bios/Bootx64.efi LFS Normal file

Binary file not shown.

BIN
devices/pc/bios/DisplayEngine.efi LFS Normal file

Binary file not shown.

BIN
devices/pc/bios/SetupBrowser.efi LFS Normal file

Binary file not shown.

BIN
devices/pc/bios/UiApp.efi LFS Normal file

Binary file not shown.

View File

@@ -10,29 +10,20 @@ inputs:
{
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" = "/"; };
};
vfat."/dev/disk/by-uuid/7A60-4232" = "/boot";
btrfs."/dev/mapper/root1" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
decrypt.auto =
{
"/dev/disk/by-uuid/4c73288c-bcd8-4a7e-b683-693f9eed2d81" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/4c73288c-bcd8-4a7e-b683-693f9eed2d81" = { mapper = "root1"; ssd = true; };
"/dev/disk/by-uuid/4be45329-a054-4c20-8965-8c5b7ee6b35d" =
{ mapper = "swap"; ssd = true; before = [ "root" ]; };
{ mapper = "swap"; ssd = true; before = [ "root1" ]; };
};
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = {};
};
grub =
{
# TODO: install windows
# windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
installDevice = "efi";
};
grub.windowsEntries."7AF0-D2F2" = "Windows";
nix =
{
marches =
@@ -55,7 +46,13 @@ inputs:
};
nixpkgs =
{ march = "znver4"; cuda = { enable = true; capabilities = [ "8.9" ]; forwardCompat = false; }; };
kernel = { variant = "cachyos"; patches = [ "cjktty" "hibernate-progress" ]; };
kernel =
{
variant = "xanmod-latest";
patches = [ "hibernate-progress" "amdgpu" ];
modules.modprobeConfig =
[ "options iwlwifi power_save=0" "options iwlmvm power_scheme=1" "options iwlwifi uapsd_disable=1" ];
};
networking.hostname = "pc";
sysctl.laptop-mode = 5;
gui.enable = true;
@@ -66,11 +63,10 @@ inputs:
gpu =
{
type = "amd+nvidia";
nvidia = { prime.busId = { amd = "6:0:0"; nvidia = "1:0:0"; }; dynamicBoost = true; driver = "beta"; };
nvidia = { prime.busId = { amd = "5:0:0"; nvidia = "1:0:0"; }; dynamicBoost = true; driver = "latest"; };
};
legion = {};
};
packages.packageSet = "workstation";
virtualization =
{
waydroid.enable = true;
@@ -139,17 +135,32 @@ inputs:
memoryMB = 90112;
gpus."4060" = 1;
};
xrdp = { enable = true; hostname = [ "pc.chn.moe" ]; };
ollama = {};
};
bugs = [ "xmunet" "backlight" "amdpstate" ];
};
boot.kernelParams =
[
"acpi_osi=!" ''acpi_osi="Windows 2015"''
"mt7921e.disable_aspm=y" # 避免休眠恢复后无 wifi似乎有时还是有问题
"amdgpu.sg_display=0" # 混合模式下避免外接屏幕闪烁,和内置外接屏幕延迟
"acpi.ec_no_wakeup" # 睡眠时避免开盖唤醒,似乎没有用
];
boot =
{
kernelParams = [ "acpi_osi=!" ''acpi_osi="Windows 2015"'' ];
loader.grub =
{
extraFiles =
{
"DisplayEngine.efi" = ./bios/DisplayEngine.efi;
"SetupBrowser.efi" = ./bios/SetupBrowser.efi;
"UiApp.efi" = ./bios/UiApp.efi;
"EFI/Boot/Bootx64.efi" = ./bios/Bootx64.efi;
};
extraEntries =
''
menuentry 'Advanced UEFI Firmware Settings' {
insmod fat
insmod chain
chainloader @bootRoot@/EFI/Boot/Bootx64.efi
}
'';
};
};
# 禁止鼠标等在睡眠时唤醒
services.udev.extraRules = ''ACTION=="add", ATTR{power/wakeup}="disabled"'';
networking.extraHosts = "74.211.99.69 mirism.one beta.mirism.one ng01.mirism.one";
@@ -159,7 +170,7 @@ inputs:
hideMounts = true;
users.chn.directories = builtins.map
(dir: { directory = "repo/${dir}"; user = "chn"; group = "chn"; mode = "0755"; })
[ "lammps-SiC" "BPD-paper" "kurumi-asmr" "linwei-stuff" "BPD-paper-old" ];
[ "BPD-paper" "kurumi-asmr" "BPD-paper-old" "SiC-20240705" ];
};
specialisation =
{
@@ -172,11 +183,6 @@ inputs:
};
system.nixos.tags = [ "nvidia" ];
};
xanmod.configuration =
{
nixos.system.kernel.variant = inputs.lib.mkForce "xanmod-latest";
system.nixos.tags = [ "xanmod" ];
};
};
};
}

View File

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

View File

@@ -10,13 +10,13 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/CE84-E0D8" = "/boot/efi";
# TODO: reparition
vfat."/dev/disk/by-uuid/CE84-E0D8" = "/boot";
btrfs."/dev/disk/by-uuid/61f51d93-d3e5-4028-a903-332fafbfd365" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; };
};
rollingRootfs = {};
};
grub.installDevice = "efi";
networking = { hostname = "pcarm"; networkd = {}; };
nixpkgs.arch = "aarch64";
kernel.variant = "nixos";

28
devices/pcvm/default.nix Normal file
View File

@@ -0,0 +1,28 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount =
{
# TODO: reparition
vfat."/dev/disk/by-uuid/AE90-1DD1" = "/boot";
btrfs."/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
decrypt.auto."/dev/disk/by-uuid/a9e4a508-3f0b-492e-b932-e2019be28615" = { mapper = "root"; ssd = true; };
rollingRootfs = {};
};
kernel.variant = "xanmod-latest";
networking.hostname = "pcvm";
initrd.sshd.enable = true;
};
hardware.cpus = [ "amd" ];
services.sshd = {};
};
};
}

39
devices/pcvm/secrets.yaml Normal file
View File

@@ -0,0 +1,39 @@
hello: ENC[AES256_GCM,data:7xCy5PqPVdUNIdzqaGQLsPA88mAfRt6T57LjFDwOaTlhdejLPrBdyN4=,iv:dM0QWDpylPjnbtdNrjV8LHISNi/U718+xooFm0qTcbI=,tag:d5HbLG7yF3QRz7nP+4aeiA==,type:str]
example_key: ENC[AES256_GCM,data:K5SD4k9jL5r4ZSUwNQ==,iv:mJrZshT0PKmT7OJE/ZBUWzq1Gc6xXymFbypxwQtQJq8=,tag:I4+AyMh+AVpmWa1fdIJpyA==,type:str]
#ENC[AES256_GCM,data:vHj6+kNand8d1AzgXTaOMQ==,iv:j6b3SDqzVgY8U/puEm9UcpJYGK84gF/YIXzRbG0radQ=,tag:yzfXKHReJ0++3fhk2ztbBA==,type:comment]
example_array:
- ENC[AES256_GCM,data:vRjjfVSy8g5mBZVM/oU=,iv:C+HE4Q157eNhEmcDJSMJINfMgztf6XfELCjotg8q3XU=,tag:JSQDItdYbCCs65tmbeR6tg==,type:str]
- ENC[AES256_GCM,data:xzfN6WiT8r8YcWtS+H4=,iv:btlOvqrn0pITT3rCTIjgS2b5TrfNKym0yPEnE7bJDqg=,tag:Wf40b8zBhrv452OKodkU+w==,type:str]
example_number: ENC[AES256_GCM,data:akqZ12u1wl4Zww==,iv:hS3NBWI7o6dZLtsIsoVHYdtyqpUmbQrpMHPhRRzEd18=,tag:1voFm4LuupWJMGP3xd0k4A==,type:float]
example_booleans:
- ENC[AES256_GCM,data:wWEU8w==,iv:rf8uwo+sP9YFyPmoxROVVmrx+q6Yr0PIOWznM96w9XY=,tag:nVJdD1Z7U8zVRBxs8gLvQQ==,type:bool]
- ENC[AES256_GCM,data:gVe51tg=,iv:eOJ2TOWStHpckNyYx2UdLcipshFpjcWtEids5c+Q8bs=,tag:0iSjlC/TgNfl7ZtXmttgaQ==,type:bool]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyTGliaUlvOVlxejZhSDZi
YU96S0VPOE5Ldk56WlJjTzBSRm9oYnBoQ0NBCnhJWmg3KzUrT1VyemRiSWtQeklS
UFFFTjdod0g1d1EvYWJoOElJSjIrWTgKLS0tIDlaQnJOMTZRUms4am1mQjV5MzFJ
QlhKL1ltY2lGZGU0clhIRTRsSW5BOTgK4gKbhvF1bV/YdKOxzqrecHPDAKPOd81V
YnWgLpP6h+zycx80iqwsfqiQJdPyDrfhB43ksn2oxsX0qXtLI9j9TQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1jmu4jym0e0xkq5shx2g7ef4xzre94vaxy2n4fcn0kp94dtlupdxqkzyyp7
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzRU1IRXZkbFQ4elgydTlv
VlRVKzJIWDVCZk5xaTd0Y2JXS2l0Mi85Zm1jCnNkS0NETm5SaG9WUE9Mb3RtbE5B
YTRmWHNXTk9hZHNBT0FxT1RNNnFMNEkKLS0tIGRWNWpLcDVtOEdGZHFPT3paeVo2
QWsreTlaVW5Bd2lZb3JZeTdjcG9WQlEKy3p4QnjPrJtfaueLKBzMz7VZ9QfrTer1
lEP8mInFprR65LtpoKabsTWQwkzURzB/OdbKSYG2o6Rlqy9L3d5eBw==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-07-02T23:46:35Z"
mac: ENC[AES256_GCM,data:OncqYSgPSoge5Nw6eh0A4cm0KXSQhmSpGIu5WSv38LdMto5fNLIK2VRIwaXfq9nyf10bxNN7xSADj2GPhMiwlHM8nIQXtxdlWsZfEOc/qOWM8nz+9DPKtKGD6RZcDLDRhNTDxzPXGWIuY1tDKQpUlt/iDlymSskcqSrdTfBqCGk=,iv:NesxRr6FXXApE8aafnAV3x6hwCoAxoEly/QkcyAQ8Pw=,tag:3o37dr4vKLqEENIdj8RHXw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

View File

@@ -10,14 +10,14 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/ABC6-6B3E" = "/boot/efi";
# TODO: reparition
vfat."/dev/disk/by-uuid/ABC6-6B3E" = "/boot";
btrfs."/dev/disk/by-uuid/c459c6c0-23a6-4ef2-945a-0bfafa9a45b6" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; };
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
networking = { hostname = "pi3b"; networkd = {}; };
nixpkgs.arch = "aarch64";
kernel.variant = "nixos";

View File

@@ -11,38 +11,40 @@ inputs:
{
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" = "/"; };
};
vfat."/dev/disk/by-uuid/4596-D670" = "/boot";
btrfs."/dev/mapper/root1" = { "/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" ]; };
"/dev/disk/by-uuid/eda0042b-ffd5-47d1-b828-4cf99d744c9f" = { mapper = "root1"; ssd = true; };
"/dev/disk/by-uuid/41d83848-f3dd-4b2f-946f-de1d2ae1cbd4" = { mapper = "swap"; ssd = true; };
};
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" ]; githubToken.enable = true; };
kernel = { variant = "xanmod-lts"; patches = [ "cjktty" "lantian" "surface" "hibernate-progress" ]; };
kernel = { variant = "xanmod-lts"; patches = [ "surface" "hibernate-progress" ]; };
networking.hostname = "surface";
gui.enable = true;
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
packages.packageSet = "desktop-extra";
virtualization = { docker.enable = true; waydroid.enable = true; };
services =
{
snapper.enable = true;
sshd = {};
xray.client.enable = true;
xray.client =
{
enable = true;
dnsmasq.hosts = builtins.listToAttrs (builtins.map
(name: { inherit name; value = "0.0.0.0"; })
[
"log-upload.mihoyo.com" "uspider.yuanshen.com" "ys-log-upload.mihoyo.com"
"dispatchcnglobal.yuanshen.com"
]);
};
firewall.trustedInterfaces = [ "virbr0" ];
wireguard =
{
@@ -54,13 +56,13 @@ inputs:
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
};
bugs = [ "xmunet" "suspend-hibernate-no-platform" ];
packages.vasp = null;
};
environment.systemPackages = with inputs.pkgs; [ maliit-keyboard maliit-framework ];
powerManagement.resumeCommands = ''${inputs.pkgs.systemd}/bin/systemctl restart iptsd'';
services.iptsd.config =
{
Touch = { DisableOnPalm = true; DisableOnStylus = true; Overshoot = 0.5; };
Contacts = { Neutral = "Average"; NeutralValue = 100; };
Contacts = { Neutral = "Average"; NeutralValue = 10; };
};
};
}

View File

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

View File

@@ -12,19 +12,25 @@ inputs:
{
btrfs =
{
"/dev/disk/by-uuid/24577c0e-d56b-45ba-8b36-95a848228600"."/boot" = "/boot";
"/dev/disk/by-uuid/403fe853-8648-4c16-b2b5-3dfa88aee351"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
decrypt.manual =
{
enable = true;
devices."/dev/disk/by-uuid/bf7646f9-496c-484e-ada0-30335da57068" = { 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";
grub.installDevice = "/dev/disk/by-path/pci-0000:00:04.0";
nixpkgs.march = "znver2";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd.sshd.enable = true;
networking = { hostname = "vps4"; networkd = {}; };
kernel.variant = "cachyos-server";
kernel.variant = "xanmod-latest";
};
services =
{
@@ -32,6 +38,7 @@ inputs:
sshd = {};
fail2ban = {};
beesd.instances.root = { device = "/"; hashTableSizeMB = 64; };
xray.server = { serverName = "xserver.vps4.chn.moe"; userNumber = 4; };
};
};
};

View File

@@ -1,58 +1,25 @@
acme:
cloudflare.ini: ENC[AES256_GCM,data:X1v1QuOZemIuxldd1bzIvbUsq+8HMGLh91zUB+fnrxaW40z0OQh9L1rF/0Nj3gmUmgT4KEV7nkHFYYpZBp4/Kyc=,iv:fQmbhx9wV3l+DVPaBrAyJbTCsS3q3s5F9Go1F7pZ2pQ=,tag:P4vuruX460YSOUsx6zGHXQ==,type:str]
frp:
token: ENC[AES256_GCM,data:T8b1ku4HNCNSJ+33QgIt1GILFA4wTu3Qd0rDqHPVgdqsGo0R90k0u8z+dElSO7q9PapTqUbZ,iv:hwnMu6JxfYLgw4TyhujX5dI2IAytgZh+Bexhgta6ATQ=,tag:lqgwvXlS/jGPxasmk5Vh3w==,type:str]
xray-server:
clients:
#ENC[AES256_GCM,data:DXEC,iv:SZ1AhmK6fWQ/HGDk97kDUcRN84zQMp99eiz4SpRhig8=,tag:Fkdf28ZvB8XKCxSYdjuuHw==,type:comment]
user0: ENC[AES256_GCM,data:rJ00sfe/oJSry6Ixn4Bn+p41syqsOrdWv6fRGVCwPvn/unMY,iv:htTvFMvhIRkORA/gIU8J7CgA+tOncYQWh7sUh+F6XDs=,tag:VrSJBD7ti9WtSLHoWjMClw==,type:str]
#ENC[AES256_GCM,data:OVgDU+zqcQ==,iv:8KuEqBuL5Ca6pUOFFA+vySJx/h3BhGAAC0CgnxiW46o=,tag:TY1MajSSy2RjKVI2SSAAFw==,type:comment]
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: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: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:D5xiJW0Oyg==,iv:9a/6myiT9Crf/fff6ZkXj/obW2k95cABUNqQdPmcwcc=,tag:chs8BA8YtVkM9m3Ey9ETlA==,type:comment]
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]
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]
private-key: ENC[AES256_GCM,data:ts/LRGFAsYqvGvkvlxUI42IW1a8cGsSkpZhMDd3QVceRKvhPb1SRDaXoSw==,iv:6xX9xFIFUNlLBZ6CPBOz9JbHpvC4+QG9ZaCZcWdl12c=,tag:DYIa+QTV8vyl1l7OKKykTw==,type:str]
#ENC[AES256_GCM,data:d7cv,iv:RHzGIDLuuKejCTQ5YlNNITkCS3VoprsqH/kHckdpAv0=,tag:3cYw7uyUmXALo3v7SiqLJA==,type:comment]
user0: ENC[AES256_GCM,data:o2wxpSzoqsPxs6grgYRLtPutMVwSqtzUWBrj7+7QuWWd1a1z,iv:2/5SxXq8Iw4J/LzBeclHbkrZXHitguip0WN+MINym8s=,tag:v/3oly53ORM9XAwbOzp06g==,type:str]
#ENC[AES256_GCM,data:0nHZmEPPaw==,iv:BtOZ8/U0yg3fthHrwerNQX3+KD/H9+fcUylYGnZqiIM=,tag:DkFGSFfq//LmWfg6DGm1aA==,type:comment]
user1: ENC[AES256_GCM,data:7ev7GuKLeJbPReMy0FnX02fLv5nNCpxdzfnQyAA+/IviwDMQ,iv:YbESsyIAiEAyvrHnj9A4lITX7NtRkuRhCrTv6hoG9Qs=,tag:8uledxLXqpXXLBh+cczm4g==,type:str]
#ENC[AES256_GCM,data:3KN/1hzeR2I=,iv:iaqJJD6iURTUlIL8e8P7fsAzJYo+y3NGZXgWmPX+4ao=,tag:e8g/JgVrMrWJamUMpiv2pQ==,type:comment]
user2: ENC[AES256_GCM,data:58PnLCwDayOYinsPCYPeMvuKiF7b4tZtbmEJFWEl+2Nu6HL2,iv:hSv3jCtkLm4rrm/4+ot10CBhobGwtnK5db5wR1S/XrU=,tag:SQbynYp8pDSqj4tAK6JBMQ==,type:str]
#ENC[AES256_GCM,data:uTZDsA==,iv:6cxvQycfji/x+DW1CnO45r+yNTLwkhYkiJwDaSpUCwo=,tag:8pMw+sYeOyZBN1idHoM9+g==,type:comment]
user3: ENC[AES256_GCM,data:WCVr0ylGm2SHtOGulb8TD/cI2xJXrbvY1d6+STXGxf0d0izb,iv:vhNshb38AVpwKCFRwUVruCQ0SxhHrOmwQ+IoQZeUj1k=,tag:OfdIjRrTAuVZBOEXTtnrQQ==,type:str]
private-key: ENC[AES256_GCM,data:akNIeVp2bfKvnzlS6KLAdqAo7qsGfPatzCZpN1tNRLhRVXmJCcUDVSmVoA==,iv:2Rny8ioDJ2x+NR+n7/Aluv7JZ+Om3MuJKsXiwONYntg=,tag:a3xubIr7hpVjRiHjFL/q5Q==,type:str]
acme:
token: ENC[AES256_GCM,data:JBeN7SVxKGOe6er0eS7/v8YrXdv0nCK/KZc8Ygq0G7FIGu4hO662kg==,iv:rf59MgUCYlAA5h18wtdWoUyb2VPB13OPuJjz1VsI2dU=,tag:ViPrwduD8aWf8i8vmBG78A==,type:str]
nginx:
#ENC[AES256_GCM,data:85LrqdTMIhSa,iv:mIQPYz8VPd5AxeMCQEdTGMD0Iqa5QEAa5+8JVFaj3JM=,tag:TcZd7S3WRPpEV9lHI1fzbw==,type:comment]
#ENC[AES256_GCM,data:rVTLpe3uIQ5LArPnEY8N8kjtHq8kZddbqR+nyUaia72Y7PWEfHzy6wgx3Q==,iv:AZEufH3zfVL0XbUh3CQZGYcx6zIMFV4tF+jHf73IplU=,tag:B/UbtQh5dGrctNih2uoO8w==,type:comment]
#ENC[AES256_GCM,data:InzwjKl3R4SJSXTz5u1Pt0kf2HYEtKfSkJO0cbPhhXADNp2/Tn0nwQJFy9EzpMvK9mw8+l5LadbY0tIwmTVvV5yxUQo78HcgXWInfp/zJ+GG1L/RQOHck74lEA==,iv:UBMRYPd0loOQBs3mNyndiKPu72aRA8HbOKWDfUWPQg8=,tag:t/ONqdwpWcbo/2vy5TOjlA==,type:comment]
#ENC[AES256_GCM,data:HTinhnsAbVujUOuLIVT/CkvdtTN9Nk7wZKZ5SyrPC+vZ/cB9E10FffMYLQ==,iv:Clby9A7MIUSknNFkzKuWEDL0yUW/ctd6KShCIEYrDZA=,tag:CJKORoXrspDjRmaSHUnlqw==,type:comment]
#ENC[AES256_GCM,data:cwAb68VgebTwCCeAFUbOG0CUAuggfRnLNv9NWldJN+E9NY4WKxs12Nz7yX/vtelcqqJ2TOUL78uAR88Nzavv7VtCTZRivWjRG6GvAUyRdv8lAZo=,iv:PScTSTCuVnsoZlvyTVL+ZgqqEm4m2/fUqWzPwE+PvuY=,tag:1jeRsHqgMheXbcnhRicsnw==,type:comment]
#ENC[AES256_GCM,data:V5XRrTvyeezkcJqw1/BhhZz5K/egpl+PtNwjAGELjWRp7IqDfRsInxBKEg==,iv:LdOTkL22HvaNbiUi6hG8o0ownfZ22OKFGxCuGPqG8xU=,tag:/06I/mLzBlgS489iuwFTuw==,type:comment]
#ENC[AES256_GCM,data:i9PXzaO1od7HimP/6vxYfh30SxFbdXRDcnXujH3VrvngFcWaVcXgigncp3cboi6RoERSZ6yakxviVyEBIS4v0qRfombj2UtJg8N3Kg==,iv:aohIMhAYfZhlGDrcEvi+Qc16nF8ZgrPUGhWj/7nl8Fs=,tag:o70qsk/2cAbZgbVBwfl3Ew==,type:comment]
maxmind-license: ENC[AES256_GCM,data:sESU6uK9EYLido9/0sXO2Zw1SjuKmxPh4r3giJcaG7068gn1kByjsA==,iv:htnFgnLrH35zSvmlRAdoRDLFIpKroKO5dW9TNK9soUc=,tag:6pJuc54SrKP5n0kJJ7fGyA==,type:str]
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]
wireguard:
privateKey: ENC[AES256_GCM,data:4DKPPqQkjb33rQzFIz863A2arDRQA9AivWFBaWTf0xXDX4hWvJFiIlJQfvE=,iv:0R2TH3CMxHgwVjojzjE2Gnp8SXonmBDLWF7hB33NiX0=,tag:vgtV8JkuCdspleN/SvgIqQ==,type:str]
detectAuth:
chn: ENC[AES256_GCM,data:lQHDpv8/Yl5/nycHoeTnCw==,iv:ernNxRpcTOSAllDpqRFVFg3qEw/slEEPPXDFq1AhNL0=,tag:2AVALUf9cDyOgCqI9wwgQQ==,type:str]
led: ENC[AES256_GCM,data:zyCiiH21,iv:iEYyNClDsCpWE2oNjt2NqQZ88xOOlMr0yycjKTPdmlw=,tag:kQfbshXfTBA5PtUAgpgCcA==,type:str]
chat: ENC[AES256_GCM,data:pXu0WPWmvUzvl2expDpQPqWwi1A4abg72npsaYXDXRcg6aVU0Ec+tgM2+uz2hT9rh3mNoBxadYXDc/zeOL1UCg==,iv:iln5UGGBK2s5pGS03PtolWTkx6KrnYBAWCFnI0V2Bag=,tag:EahTDoPIBkgWnp4MOoTCmw==,type:str]
maxmind-license: ENC[AES256_GCM,data:8OioibcXQ9IZ0OQhJ/zHSBQjfdHzkoqwUx5zR8Zq0atNw6SSf7vKrg==,iv:z6WTI2yeqP0h7EqKG114nRQpFVJlNzZspgS6gIFtpt4=,tag:a0dBt9pXJnncBiSKt9dsAQ==,type:str]
telegram:
token: ENC[AES256_GCM,data:Si6yTh48HpA8OkkkvgHwtJYFhF8tW3oaQbldjwBc09QJxp9AoKgASMnZtbDZYA==,iv:GrNyZXjaZMviSjy/LGHHrYTr5PFvDkCXmT3MU4+SLpc=,tag:YifB1tKFLqsgXB/YLqYK4w==,type:str]
chat: ENC[AES256_GCM,data:ydPky0W4ZWqn,iv:uWQrZDz2GCxiKRaijM89Npt0fQeSNHbQzDefkZCkUAE=,tag:OJQwV/889Vp2/4wjbN41JA==,type:str]
sops:
kms: []
gcp_kms: []
@@ -62,23 +29,23 @@ sops:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1QXc4NzREZHlhMDV2WXlM
a2I4d1pjWm9Xd2gzUDUwZ1ZSTkFGR1ZQNDJzCmJwcWFxRWNNVGxTNno2b1NxNktO
aHhINXBjdmE3alFGYk9kUHZ1UzdJUk0KLS0tIFdKMDlvb1Z2Qi8xRjl0MXpKMDMz
cVVNdDRDNmtHZlJEcVRXR1FLVkZrMWcKn2iTHH7/52fJNXcbDFbzOxNAaiQRA0nO
we74EeNzcaaQwuEmBQPKxd/g7/kjhnHzTkoX3OneXMd/gBZMn2knXw==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNamN1TytweDd3blJsR2ZH
ZmlocFZjT3ZaUjlVbG1vVSt4a2s2SjJIaGtRCjRneDV6cHYwdGJOY1BDVS9DeDVC
cDdNbUdtSGRHNU1yZFpPc1MzRS92ME0KLS0tIFpmamNmTFYrRGRqbTFVSzBhUlNa
VllXdzZ3bEc3UFY0YjZRKzBUcGgyVkUKqI1ojiLbF87alAkEwyrm8wuW2fLbmj8d
YBIpoDCZ7AwR5uHWQAtl7BWJV1zab+rA3zvaf2BsrVA1A+RWOtYT/Q==
-----END AGE ENCRYPTED FILE-----
- recipient: age164tyqklwhdm57tfm5u863mdt2xrzrrzac4py8a0j9y6kzqcjy9zsp073t6
- recipient: age1yvrl4y0r6yzcxzzkgfwshlrtsjt8uuya6rfwks09pnft7esfcyvqmrtm5q
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBycEw1bXA4QUZkUzJ0Z3pM
Z0xHam5SLzRGV21XYUtxTFh1VnhQUk1NbzAwCkU1Z3VTR1FtZ05GOWNDOENlZTgz
SitzYXo2Q2VEaGtLTGE2UGRoUDkxN28KLS0tIHhRS2Y1cnQreC9Fc2FLdGR1ZXdJ
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWWitsSnRVSzJDZG9ZSE5I
bmt2NEFDanR3aFJyYVNnU1NlUldRb2RUVXhNClQrTkgzR1dPNWp3endZTUl5SmRs
dEtkSWk4aWJEc2hhbWlXZkxpNGhacFUKLS0tIGZNSG43R0NKYmdFMzdXbmJjSExJ
Ri9hM3NRTkM4Q1lDdmdPemEweEFBUmcKNLL5qH+JeFWX0GovkPFVVAnz+4tmfG6/
1jN8YqbMIxf5/L8tauXPf0iIiHa6pUcjtDZPr/OEmeXebmF6Bh9u9Q==
-----END AGE ENCRYPTED FILE-----
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]
lastmodified: "2024-08-25T03:19:55Z"
mac: ENC[AES256_GCM,data:v6yb7ZYcnPw/8SqEJnSWzmlE17PenjnBH2X8HZp+kIDXzNFyNvD19FcbCBZjwyjBLvN1ZF4M9FS7Y4+CvvMrN/4JcFufcY/V1NrOd8IZisfAT5N3WuopPee4IN9WEyPVOsbFnesZo6/wJKuqlV1UR8UZxCd3/wHXob9Lkz45cBw=,iv:XKIUiRfP0lj8V/Z1HbvhBankdcAjQqM8Way6TWjJJMY=,tag:PLYsVj6BmR132oWsxEKnfg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
version: 3.9.0

View File

@@ -36,7 +36,7 @@ inputs:
{
snapper.enable = true;
sshd = {};
xray.server = { serverName = "vps6.xserver.chn.moe"; userNumber = 19; };
xray.server = { serverName = "vps6.xserver.chn.moe"; userNumber = 20; };
frpServer = { enable = true; serverName = "frp.chn.moe"; };
nginx =
{
@@ -53,14 +53,13 @@ inputs:
(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"
"send" "kkmeeting" "api" "git" "grafana" "vikunja" "write" "blog"
]));
applications =
{
element.instances."element.chn.moe" = {};
synapse-admin.instances."synapse-admin.chn.moe" = {};
catalog.enable = true;
blog.enable = true;
main.enable = true;
nekomia.enable = true;
};
@@ -81,5 +80,10 @@ inputs:
beesd.instances.root = { device = "/"; hashTableSizeMB = 64; };
};
};
specialisation.generic.configuration =
{
nixos.system.nixpkgs.march = inputs.lib.mkForce null;
system.nixos.tags = [ "generic" ];
};
};
}

View File

@@ -42,6 +42,8 @@ xray-server:
user17: ENC[AES256_GCM,data:gQInIcNFxJuCSsMDGq4yTp5JdMMmJRy1tY3PGLoLuuIXWV0a,iv:ya4n9Z7T9/bxeHqi5QqwJprEzDMsT6X0BuEXRS67wWk=,tag:RcjQfAHv8uc3PgN5c4bySA==,type:str]
#ENC[AES256_GCM,data:h7E4P6BiGjktYg==,iv:DhkK3NNppBqo3sXt9U7kbgfaBPYcSEX2hu6VOAesDiE=,tag:XoVbZklwCmU1EBhv0ujcSw==,type:comment]
user18: ENC[AES256_GCM,data:dssxPEv8srXydunolaaDAYYo+BOXhp2PoqidOWH3z6NYBpyB,iv:WCLcMMwQJiHZBwreQpaOZp2saXvjBwgYUqSf7HQhMgA=,tag:5jsAVcgAgO+7JhBINz6tzQ==,type:str]
#ENC[AES256_GCM,data:qGsMmWrUIzVdHw==,iv:DXayEA5zquwOzm+TqECYNHM98r0WSzcP3gA8zkzdPy4=,tag:OKTx12RqP9VxJQOnrBLkmw==,type:comment]
user19: ENC[AES256_GCM,data:+Mh15DR9xvFAwks86iuHEA9FpObKWTSuVOEzUDpBUS/h0hOz,iv:zYIkic2bibvwCBpomnJ9465mda1rbm3RERBZY9twXuc=,tag:bwdL6DAGgkGYhYFI2C4A+A==,type:str]
private-key: ENC[AES256_GCM,data:ts/LRGFAsYqvGvkvlxUI42IW1a8cGsSkpZhMDd3QVceRKvhPb1SRDaXoSw==,iv:6xX9xFIFUNlLBZ6CPBOz9JbHpvC4+QG9ZaCZcWdl12c=,tag:DYIa+QTV8vyl1l7OKKykTw==,type:str]
nginx:
#ENC[AES256_GCM,data:85LrqdTMIhSa,iv:mIQPYz8VPd5AxeMCQEdTGMD0Iqa5QEAa5+8JVFaj3JM=,tag:TcZd7S3WRPpEV9lHI1fzbw==,type:comment]
@@ -85,8 +87,8 @@ sops:
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-06-18T11:57:30Z"
mac: ENC[AES256_GCM,data:63Bxo5BTq/CyLE90e3nkaJ0A7nvgZHlocSuZixurNXzr5Ow7X+KOxM6fOCSLt7NpGiSxu5a3jJi/piNIvYEHyflhWEqdJuC6mYdVp35U0WezcKwkwwdP+Nvx+nf6m2JHdZ4d2uGOM+Er4f59TSAI+dB5GeT4KZ1PJy9Ai/pr6cs=,iv:rx1c3iCtp+Nti2tzrvWe6vLoKfX10LXd2q+1HTKlQEA=,tag:FIAp+yEM2O+wJrWiNRAfow==,type:str]
lastmodified: "2024-06-30T10:43:57Z"
mac: ENC[AES256_GCM,data:Mg/DZghIkaWM5KEjk5zg3S0L5qPa8/rkc2ooSjA1ewzbDhTKls2tzv7fQqLx2WQtcJiKkoVx22UkiL0AzBwJdCr3473vx93ajTVK9HNu3jqXmuzSiv2iVS21EX9tyBNiL6uWlVAtlVfMMs69PEUF+EJIYY5TkVVPaQjzEebwo5w=,iv:tFON7RVSnNNHo5U4dRuMGDhH5iPGShW9uoda+apiIjI=,tag:3nG/u7vaChFBHoDsLLb23w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1

View File

@@ -26,11 +26,10 @@ inputs:
rollingRootfs = {};
};
grub.installDevice = "/dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0";
nixpkgs.march = "broadwell";
nixpkgs.march = "znver2";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd.sshd.enable = true;
networking = { hostname = "vps7"; networkd = {}; };
kernel.variant = "cachyos-server";
};
services =
{
@@ -46,14 +45,14 @@ inputs:
matrix = { port = 8009; redisPort = 6380; slidingSyncPort = 9001; };
};
vaultwarden.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 1024; loadAverage = 4; };
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
photoprism.enable = true;
nextcloud = {};
freshrss.enable = true;
send.enable = true;
huginn.enable = true;
fz-new-order = {};
nginx.applications = { kkmeeting.enable = true; webdav.instances."webdav.chn.moe" = {}; };
nginx.applications = { kkmeeting.enable = true; webdav.instances."webdav.chn.moe" = {}; blog = {}; };
httpapi.enable = true;
gitea = { enable = true; ssh = {}; };
grafana.enable = true;
@@ -64,12 +63,18 @@ inputs:
peers = [ "vps6" ];
publicKey = "n056ppNxC9oECcW7wEbALnw8GeW7nrMImtexKWYVUBk=";
wireguardIp = "192.168.83.2";
listenIp = "95.111.228.40";
listenIp = "144.126.144.62";
};
vikunja.enable = true;
chatgpt = {};
xray.server = { serverName = "xserver.vps7.chn.moe"; userNumber = 4; };
writefreely = {};
};
};
specialisation.generic.configuration =
{
nixos.system.nixpkgs.march = inputs.lib.mkForce null;
system.nixos.tags = [ "generic" ];
};
};
}

View File

@@ -35,6 +35,8 @@ rsshub:
youtube-client-id: ENC[AES256_GCM,data:dPo4+HsfXHdxrgF9F0qJmOGcSHDCn2KIkHx3ZYZU94iv8ImiPI9dTRfoz0zq8UIN7rwIKidQu9GxCRrg9aXk34pc35SXzEh8JQ==,iv:ROVHb0QjVsNae9eJevG6qc5dc4gkrGt+Y7S2QYrzmQ4=,tag:Advoh75OKPC7CnIeL4GFbA==,type:str]
youtube-client-secret: ENC[AES256_GCM,data:c/ALpo/4qJdccMgYiSLg9ZgG7ddaMYxHwJYZ/ogJN2ED21k=,iv:CkrIq+Vpuq28CsRNwdKRLnBq6L8NF37y4xhhnmHQHqQ=,tag:SKtHpm/QZWnGViDtSKlUUQ==,type:str]
youtube-refresh-token: ENC[AES256_GCM,data:pnXQ1euCdix2H7IxudmUUcpxc2OUhciKT8OcGV89c/EpoXHgx1+eLxwY5rRszroWwjge9M001RGHngvD/ny3phfWAwYmIzMJxun2f7JCPe7ybMesWmPSkiqVBss1Zfic1uB8mNM/yw==,iv:8p8/vATY8F3YuGA1TtjekiuaKOMnQyTMjrwDBJaK4VU=,tag:/jVg9FDOuLMNrupgrywpBQ==,type:str]
twitter-auth-token: ENC[AES256_GCM,data:65SbHggbYtfSfaaxJxRgD6+HpOX4vIfjnVZmOAZ9illPMYOu9MIchQ==,iv:49UuC8n6AGj1skuHzQX39Q/QuKlB9IxogIfiiy1GBnw=,tag:Rq6b0H9UFVZ19tU8ZeelRg==,type:str]
bilibili-cookie: ENC[AES256_GCM,data:58nO7ADu2oH/OgLJNYrEEzhf1J0zt8EpuygnSANkGXJju5oSmtM7WLnaMEjC96q14OTTA9QLiFVsbxiFY1eUnraA5W7g7+6CYRXVRZaxz91D/dhKzHGTMjB/LynnNqEIc6liONlcHbyjZNQ+WIqPtjVpCKMN7Mi8cv81/cFX/1GqAwncgDD2oXh1hMPOVY4dYcGKuOG0GjlY6RgOgTPqU3HawQjnoWQjPF+lq2rnWD5HP9ZTxOYa7hm2GgPrxkq1fkRrq+kKYeDh+6M7VLDcm5Fpf+biq6F8fZWzmw4NlVZT9BG0vJFa,iv:vxYXg9Yg9qIWFQXtwTYa4Ds0KSxZYg3M6xdtXKbdaig=,tag:TzCPehk9w+BL4wwgDc1CPg==,type:str]
mail:
bot-encoded: ENC[AES256_GCM,data:HstqDfhKoLqDip9O+mwYGbNlNQ==,iv:CZSTfxJHhI6nG7501cQdJiZ9l3uKS7d5YsA8iVTUuoE=,tag:Rj3rvXJzDp8XzODV/gABog==,type:str]
bot: ENC[AES256_GCM,data:j4Y5oYeVt0sd2z2Qwuqisw==,iv:wasQCTqEMAyttbn1zm9oKck6QiByom+F7ZIMDUse9Gc=,tag:92O4ka6f0I9qnlnVy2dltA==,type:str]
@@ -54,11 +56,13 @@ synapse:
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]
#ENC[AES256_GCM,data:yFDD8GHjZWHN/Yh53DseevKAhDVwrHX60e8sGZnF4BUsUuPA/4S2PRzj7CtlpFzUH3kb0i+HkLKRvbchg93U3as=,iv:JGG7daEKs0oMKTNVi9GS7PrXn/8rFtVkHknACsEQR+g=,tag:RSN6fojLsI4dcuPu2eTiWA==,type:comment]
admin_token: ENC[AES256_GCM,data:OpjREmxJSRj+aGVoP8KKRE7ClNqRtaV8va4WLVmpl1AO6D0q/GapJvhORHQb5s5ZjIAgvWTz1w+fh050Q9sPwRsNUke3FIcyeNy7k0PHgnnVIdxnU1Vn9KMz/SovjQ0/qEQ7tArvW/EXtKfwnP9lsz9m94VBvA==,iv:9AvDqMa2PeQOSrP2th3YBgA2RxPl3oKZTyUzi/yjRTM=,tag:HYFTQDgWvBsHQk8IZxWkfw==,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]
writefreely: ENC[AES256_GCM,data:+5jsON4SpeWKWZWlbn233XuQ/6HDzaS3XxUxDbUqAp8S/XGmn/QuFK2f375QJEiyZsnrIYkbN/CiOjdTw+nNzg==,iv:8mKqWegyxrT6908P5G0olVZzpP+BwpE7SYODEry7F3A=,tag:HeYoT0RFJGzX6DWcBQy7Jg==,type:str]
photoprism:
adminPassword: ENC[AES256_GCM,data:gB81joOfS8h05BNy2YmD/N0cpLPa/vAduDcQBeHiY/WkcnvqSXnXsOfnvbP74KQfoP4W35oFkfyGVPUBSB83tg==,iv:AkN2NoqMXVHQA9fHTTR7xbEapEqy/D61mHn7O23hyYk=,tag:WV+siDA3VnRkOYnP4Z9Qhw==,type:str]
nextcloud:
@@ -68,21 +72,18 @@ freshrss:
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]
user0: ENC[AES256_GCM,data:2sieulGmi7mCYrJH24djrrmHArrFbOHZ9wUuKvY4f2k=,iv:lb5ODFOeQQ+D9HZnMw48n/DGRB7L51U4frBVcPx1mvk=,tag:MwZua6u+G478uGOwtGu4fQ==,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]
user1: ENC[AES256_GCM,data:Aw0ydspmf+PXKU27Pdzn4q/nY4sxXCADL1WGB7vm3eo=,iv:uTmVvGlW1HfdvoNbupSw3GyShsWTGVCoNrvVJ5BPUy0=,tag:k9KIoCWM6bSprwR8dmN+Hg==,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]
user2: ENC[AES256_GCM,data:P5gmhaQ+VOWVOjTrsx34zUS8dsqIkzCwOImIE8TIfUc=,iv:IoJIUcNJmaBTyr0Ut6R7BN/UqyK8p4HtiwbXUl171pE=,tag:k99PGSL1cEALTmFVWH1uSg==,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]
user3: ENC[AES256_GCM,data:cAzf2X20rtQYyz1rLK6b4jo8utuUOdUHVYfCWdfPTDY=,iv:L5cg7aNdfnLTH2dKl4bWCqaujJ9tIvBJrJIoDIaBLwk=,tag:9Al6Wig4lz1my6hgozSsIA==,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]
user4: ENC[AES256_GCM,data:nUJ0lPuFOUVGCtq0IRSh5dAkAna7hoow1YOtFEgSoZc=,iv:D8phoZxdbQ2/Zaeq8498eRb0a7SZD5WnVdKv+u2pBak=,tag:Obu01n34JjyAVnF0f3uKzg==,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]
@@ -119,6 +120,8 @@ xray-server:
#ENC[AES256_GCM,data:j83rYg==,iv:3oEdAoVz7aMcezcy2chTO0LQTtKpTrJJoQZx3PC03BU=,tag:ABteEIyr2Y6MbGQhmrQySQ==,type:comment]
user3: ENC[AES256_GCM,data:Uk0Ax9FVzmmYs+ggWy7z6FEkuj2tppGlvnQdoW6PDI1VA9oI,iv:wSxigXleRUalQR1/TzKfdUVrdyEUuq+Wg42gSv1QMAI=,tag:qn6nBWv6MlGhMarCfI13BA==,type:str]
private-key: ENC[AES256_GCM,data:TarrinCFzWkB5zCc7i7f3B3tFfxrF+cGnrg4bw9CAGKWBazSJHCviY8Imw==,iv:azHdrc6AlgS9RPwGVsYRb8bBeC/askCdut1rnv9TA3I=,tag:AT2lLraKVgbp9GmlLJiI+w==,type:str]
writefreely:
chn: ENC[AES256_GCM,data:YvhPa69sVdiljm9Ix6yQh6YCEpFvC9iw5Yx72MBcGr7+swdbvWDAfMmGFY066mAPvhpwZX/IEivKvrS0t/OSnw==,iv:7s2yEb30YaCAtNeevbur0HL28nXHVIqmCx6Bngh+HWk=,tag:yx0JK8RNQMVcYLBSxNj+uw==,type:str]
sops:
kms: []
gcp_kms: []
@@ -143,8 +146,8 @@ sops:
SnFHS1Z0SXUzTFdEd29KTy9DU3Y3R0UKfhh+rUmWDrf+UGjclP57dHipPLFoXSqy
HdelmfV6q4/c7ppx2E+oZw3VNgoZCsrxxzYZfwxHJiZb+5vkE0D8iA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-06-08T09:15:52Z"
mac: ENC[AES256_GCM,data:EY6sFc4EcTuxPgIZQ51HFZZZf+khb7mkNEvb6U12kCtoJAEo+i83uszwBZCo/QWw6VCCt9c//9y0mNH4FjZPJAxweJHcRtanyTXa5jdyv12qINUceYe7Uhcb7JuiiEns9DEbrr3UeAKfbPC+N5mD/2trzht0E8hqnFlWU/fysz8=,iv:saymdP4nFveEWx0JrBR2bW8SUl6xCJKhYqw+CsrfRG8=,tag:CHGvJAO8hpSMNdU2YE2OGw==,type:str]
lastmodified: "2024-09-02T23:57:33Z"
mac: ENC[AES256_GCM,data:Tp7uSF3G1WALzv7jPSXGyIJbwYLHz4sF73NUoAI6KPboLs3juhDiZjJfkBkIIv4BawWNTvvAQfBL6hbpPbn3bLpkTvU8TiHyP9yiY5kJkid37I2s8KOHHaxKSu4CXlkAeXdZX0I1iujAOsKYUd2GnN19V07K0qwCtZOVvZXvjsk=,iv:fcsE7qXrcoaRdTv0C4nmfNvIDXtTXiKyF7TCfnkvRPg=,tag:Dgdq4gT2lzhkXZ10uUCwwQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
version: 3.9.0

View File

@@ -34,7 +34,7 @@ sbatch
提交一个 VASP GPU 任务的例子:
```bash
sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" vasp-nvidia
sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" --output=output.txt vasp-nvidia
```
* `--gpus` 指定使用GPU 的情况:
@@ -50,7 +50,7 @@ sbatch --gpus=1 --ntasks-per-gpu=1 --job-name="my great job" vasp-nvidia
提交一个 VASP CPU 任务的例子:
```bash
sbatch --ntasks=4 --cpus-per-task=4 --hint=nomultithread --job-name="my great job" vasp-intel
sbatch --ntasks=4 --cpus-per-task=4 --hint=nomultithread --job-name="my great job" --output=output.txt vasp-intel
```
* `--ntasks=4 --cpus-per-task=4` 指定使用占用多少核。
@@ -85,6 +85,7 @@ scancel -u chn
```bash
scontrol top 114514
sudo scontrol update JobId=3337 Nice=-2147483645
```
要显示一个任务的详细信息(不包括服务器重启之前算过的任务):
@@ -130,6 +131,8 @@ sacct --units M --format=ALL -j 114514 | bat -S
-s, --oversubscribe
# 包裹一个二进制程序
--wrap=
# 设置为最低优先级
--nice=10000
```
# 支持的连接协议
@@ -188,9 +191,7 @@ RDP 暂时没有硬件加速(主要是毛玻璃之类的特效会有点卡)
samba 就是 windows 共享文件夹的那个协议。
* 地址:xmupc1.chn.moe
* 用户名:自己名字的拼音首字母
* 初始密码和 ssh 一样,你可以自己修改密码(使用 `smbpasswd` 命令。samba 的密码和 ssh/rdp 的密码是分开的,它们使用不同的验证机制。
* 地址:因为懒得管理暂时禁用。
在 windows 上,可以直接在资源管理器中输入 `\\xmupc1.chn.moe` 访问。
也可以将它作为一个网络驱动器添加(地址同样是 `\\xmupc1.chn.moe`)。

View File

@@ -10,10 +10,11 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/467C-02E3" = "/boot/efi";
# TODO: reparition
vfat."/dev/disk/by-uuid/467C-02E3" = "/boot";
btrfs =
{
"/dev/disk/by-uuid/2f9060bc-09b5-4348-ad0f-3a43a91d158b" = { "/nix" = "/nix"; "/nix/boot" = "/boot"; };
"/dev/disk/by-uuid/2f9060bc-09b5-4348-ad0f-3a43a91d158b"."/nix" = "/nix";
"/dev/disk/by-uuid/a04a1fb0-e4ed-4c91-9846-2f9e716f6e12" =
{
"/nix/rootfs" = "/nix/rootfs";
@@ -26,7 +27,6 @@ inputs:
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "znver3";
@@ -52,7 +52,6 @@ inputs:
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 =
{
@@ -88,9 +87,10 @@ inputs:
shares = { home.path = "/home"; root.path = "/"; };
};
groupshare = {};
hpcstat = {};
};
bugs = [ "xmunet" "amdpstate" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "zzn" ];
};
services.hardware.bolt.enable = true;
};

View File

@@ -15,8 +15,19 @@ users:
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]
#ENC[AES256_GCM,data:/2y613pek/CO,iv:gqSh74Ac0BxPdO+fOsQ0K8t2YduwyTVOjMq/A5Wmoz0=,tag:jLUYXu7f27FruwH5rUUZSA==,type:comment]
wp: ENC[AES256_GCM,data:3jeHpeu1YlFhK2+o19q2/JyJPhZFivPbUQzJJbJZ15GzAVh7i1VsTSN31LufXAgsC8KjZHAPhEZlGYvnGpCvPzoISQa5NVAJdQ==,iv:bL3ohgbjA2agFKDwgw0H3LgiHTWB4Y5KlQAtHfEMr+w=,tag:SfLtj7iDcmV3dgOlITFvxA==,type:str]
#ENC[AES256_GCM,data:YIlY7n5pcJTp,iv:Y/+ogxaMgSl0vcMPRr3qdSHjjnnhY+N2Q6jFojzIDyQ=,tag:zat02jxJ8jI2uk8noslmHQ==,type:comment]
hjp: ENC[AES256_GCM,data:Ii4P9ZsUOEh3cqt3AKWlgUH1CMNnmHln9QNWdTRR3vZXkkR5j5qKAIrAltml/i3xFlt4hftYNufnupog4UlAVWQJhYBlhCSE4g==,iv:eKWmUcKItjd1dsvVP1se5CAhIFqV/eVH03gPJhBau1E=,tag:ZTE0BTSoDpJGqECklGjs2g==,type:str]
#ENC[AES256_GCM,data:hCgqHfpmeJ1Z,iv:pEKUNxhUyNAVtniTIQ2IpMPmXr2O+twq2/3Y2lIoqdw=,tag:RTqcI0XCoOymQD3r4+yS9Q==,type:comment]
zzn: ENC[AES256_GCM,data:/CSffToFJiBotXZ5rPkz0UNgI/iC0ftusPF2Ce6Of3XckjpCcikWj6n3ahJ24XsWQjp3EvacOiBorh+Kg16LjCEl0P2RMIitTQ==,iv:u9IFdp/jw7ehTshPzQVssLeh33iBYCPjSyJSLsc5EVo=,tag:/KXgmU7dcTKG8C4Y7NcMhw==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:qQMD8SKNmxb3PdScXNqppF9zkX7dV5i7rvljvZuhiI5zLnu77qYCHBW6ymh0mrY14N9NjxmQZhZWX/H8TvBlcg==,iv:J5N3LjCYW3QmuEkMBpl7qvPFW1Z9ZoPLkj45jKcIW9U=,tag:Tl+ld07+lVkmzt7f/f2MqQ==,type:str]
hpcstat:
key: ENC[AES256_GCM,data:POK329h/joF7WdSBwSE1EkYH/pZ9X+wiTKcVWLZjmh7gM9d7HONbN/PqsYNFTHJVR0GgysqpLEcPN2OFGs/SSeH86o04cAdjAVznKZgt1Q34QGYy6b+io15P3lbmK0kTKmeGt5qEhGkBh6BVBoSyqbKAknvUqJ17ZkL17kyRaKffm3Zais7keEJCFdyRF6oSz2kl2CvEmKNWPWDdO9EpgqgYlm9mwu95/k9Hx5eyUjiFpxc3fdFTESGbe0ZYAqKQ0eLFfLLorQp0pAzxCbbxIzZEgyxjzkICXKa1n7Zz6h1ON2Rsqq0Q4hEYJdWGLtvOH/VLVxvNWjW4Er6i3lWGhZRiDDrxLErQGONI+X7QqbneFCnMCZGln3pAfNtOr+KX58ij/egyzmb7bKZrARqnm+X+/I/L0+VS1PfDdLP53GaX7mfKYpcH6z7O2F/zjpuXQTV8njs64YlvgyYXsCaghEUBzehsruwRsBEkTIb4R2AlqItpbesMnNNUJ4Cr/B7Bw6O+gHeJ+oK4ZPBYbgso,iv:B2eWjydl8m8nbcPw2fZfxCnj57utWM9ABj2eJ1pRKWQ=,tag:5W9ZwVSJvm1KvZnf/E5Tug==,type:str]
telegram:
token: ENC[AES256_GCM,data:Mu7guAFUu+UoHvo/h1blcI6Kg3mvng6zNc/HKXuCdf73ujziK0mXwPcf7t7d/w==,iv:BkA4d0OJ4lTD7csZJQHcDnYe7SYcFbwRVYOQAWOQ2lQ=,tag:GuJ4z5pe2znTY3xNT2WF+w==,type:str]
chat: ENC[AES256_GCM,data:OC8ElUPmfsVL,iv:WgZMJP2ugZbqZyihdNtL1xMH8u9VpLNzO8DGpDL4w4k=,tag:u4cKABikuMUbCIm5zCnk6A==,type:str]
sops:
kms: []
gcp_kms: []
@@ -41,8 +52,8 @@ sops:
ZDNHUjE2QVlCV3p0NHdKYW5IMHVBZzQKkZtfyvfroOntg3yRjMw4jQHiQj8eaB2h
IeIHfW4y01mmVT2ofbtB0xYpjcl4gtUlQ8X3tn5iJ9P8gcVo0G598A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-10T08:53:57Z"
mac: ENC[AES256_GCM,data:ImxIE0d7cEpudUKGs9zHCMFKlHYwFfztLWe5ZMWOrQxr7/uRxfCsiIvuU1nRri0jx2x8J6EFAG1BdrF4KRSeW5sIB9Tlk7X1TJ69zSdLhhnIuPl+rSyovoIkMQAJ0Wvyvlgimh1VQyaBkPsjnGk/dga1N0+gIlmiwFKY5uTpaaA=,iv:fo6S9fIDxnp7VWYYWH613U6bxIlDBZaNObkRR3AdgEc=,tag:ZRIMHkWRsf75K3Tg3Xv5xw==,type:str]
lastmodified: "2024-08-31T15:59:56Z"
mac: ENC[AES256_GCM,data:zd3ivzjgdbwGZpZssHeIwwkKFfHDxo/dzvb8ptw9noZ4hDVoC5RL9M/OLN6GrRM0wtpNFZJDs7Zz0i1zMascXdVu6mou/0il6/96r+FkQVBJWbrkY36Lk7ntDAcQmZKWxSUfSF0JPHx1rbkIQSVtsLQrpui9UDxaY5DP23xjLQg=,iv:+ouEpSlo0EovK0Qh27tm7NXSYncbjEc/EMWfWHIrCqE=,tag:4CHXmsJ4LhFBmbep3Wil3w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
version: 3.9.0

39
devices/xmupc1/tunnel.md Normal file
View File

@@ -0,0 +1,39 @@
# 使用 SSH 隧道连接
在学校外且不使用厦大 VPN 时,无法直接连接到学校的服务器,可以通过下面的方法连接到:
首先连接到 vps6.chn.moe。这个服务器在校外洛杉矶因此可以直接连接到。
同时,它通过别的方式与学校的服务器保持着连接,利用这个保持着的连接,跳回到学校的服务器。
这个跳转的过程不需要手动操作,只需要将软件设置好即可。
## PuTTY
1. 首先设置一个名为 `vps6` 的会话。
1. 在 Session 页,填入 `vps6.chn.moe` 作为 Host Name。
2. 在 Connection -> SSH -> Auth -> Credentials 页,在 “Private key file for authentication“ 选择密钥文件。
3. 在 Connection -> Data 页,在 “Auto-login username” 填写用户名。
4. 回到 Session 页,在 “Saved Sessions” 填入 `vps6` 并点击 “Save” 保存配置。
2. 再设置一个名为 `wireguard.xmupc1` 的会话。
1. 在 Session 页,填入 `wireguard.xmupc1.chn.moe` 作为 Host Name。
2. 在 Connection -> SSH -> Auth -> Credentials 页和 Connection -> Data 页,需要修改的设置与在 `vps6` 会话中相同。
3. 在 Connection -> Proxy 页,设置 Proxy type 为 `SSH to proxy and use port forwarding`Proxy hostname 为 `vps6`
4. 回到 Session 页,在 “Saved Sessions” 填入 `wireguard.xmupc1` 并点击 “Save” 保存配置。
之后双击双击 `wireguard.xmupc1` 会话即可连接到学校的服务器。
## WinSCP
1. 在登陆界面,点击 “新建站点”。
1. 设置 “文件协议” 为 `SCP`,“主机名” 为 `wireguard.xmupc1.chn.moe`,并输入用户名。
2. 然后点击右下角 “高级” 继续修改设置。
3. 在 连接 -> 隧道 页,勾选 “通过 SSH 隧道进行连接”,主机名填写 `vps6.chn.moe`,选择密钥文件,并填写用户名。
4. 在 SSH -> 验证 页,选择密钥文件。
5. 点击 “确定”,再点击 “保存”。
## OpenSSH
下面是一个命令的示例:
```bash
ssh -J username@vps6.chn.moe username@wireguard.xmupc1.chn.moe
```

View File

@@ -4,7 +4,7 @@
* 内存256 G。
* 显卡:
* 409024 G 显存。
* P500016 G 显存。
* ~~P500016 G 显存~~暂时拔掉了,否则 4090 供电不够
* 硬盘18 T。
# 支持的连接协议
@@ -18,14 +18,12 @@
## RDP
* 地址xmupc2.chn.moe
* 地址xmupc2.chn.moe:3390
* 用户名:自己名字的拼音首字母
* 密码和 ssh 一样(使用同样的验证机制)。
## samba
* 地址xmupc2.chn.moe
* 用户名:自己名字的拼音首字母
* 初始密码和 ssh 一样。
因端口冲突暂时禁用。
其它内容请阅读 [xmupc1](../xmupc1) 的说明,两台机器的软件大致是一样的。

View File

@@ -10,17 +10,16 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/23CA-F4C4" = "/boot/efi";
vfat."/dev/disk/by-uuid/23CA-F4C4" = "/boot";
btrfs =
{
"/dev/disk/by-uuid/d187e03c-a2b6-455b-931a-8d35b529edac" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; };
};
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "skylake";
@@ -46,7 +45,6 @@ inputs:
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 =
{
@@ -68,14 +66,14 @@ inputs:
enable = true;
cpu = { sockets = 2; cores = 22; threads = 2; mpiThreads = 4; openmpThreads = 10; };
memoryMB = 253952;
gpus = { "4090" = 1; "p5000" = 1; };
gpus."4090" = 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" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" ];
};
};
}

View File

@@ -15,6 +15,10 @@ users:
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]
#ENC[AES256_GCM,data:XfNExliq7noL,iv:K+rFlZHF1oY5rsTzaO0mgxiE1VlKdtPTifAaesg321k=,tag:Dja8NmPWZdJkf/J/96/wAw==,type:comment]
wp: ENC[AES256_GCM,data:yjMDez28pJUo6riIHypQQgjGFbuLwy87eG4ek/+Li2w8b4Cm5JckRvs26o+S0blfICc8WqIqEJGakT2wVBE5O1jGfniKn3PhTA==,iv:dOA318XRd2EXxmTIlk6GhlAR/FBpbKkbPJJCXTwFCxM=,tag:9MkXNUuAoplAzE+4eJpr0w==,type:str]
#ENC[AES256_GCM,data:YGcTkNCeu3m7,iv:jYmVrfRFwQoX1XxeSzS23wRMAD/AnzYBXQjI76Ke2FE=,tag:WJfSmjdggzPojDcJ6GzP+A==,type:comment]
hjp: ENC[AES256_GCM,data:0R5SfBFKuLGurwINnTj31FOrwwfY9bqVS1rG/a0HqIYd+Ui8/2ffFBx0Et+tYIqcxXEJpGbvse43V0naNKmFKlLanfcy9YV/Hg==,iv:mpAUmcVHWWLoreEsG9ha09jxte8mQCLt/A7nm04iX9Y=,tag:bia9pjL0MAcs9vj1gKCVCQ==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:9wLQ1zF/kDaiw0s3UaRpiHgmngU7u6hwyqpddSjev0+Z0v58Q2oiJtK8vn+2VlSxx5ACfqEFbzp0PZYAxd575w==,iv:q9JTkgDymOwkbZ/PaxRAAQrtO96QmGgZcQuLTFCMoS4=,tag:dwOHlOTgZqT/1jQ+oGf7UQ==,type:str]
sops:
@@ -41,8 +45,8 @@ sops:
M0xoL1dQR0kvMWpzN0RMNWVCTFQxNFUKj9LPjBo5NGOrGYNvu8qZ13PLYjLEWllU
LARzEn4XgkeHckouwvxZYMCx7WxmAruRWaOvnxTIczzSNP7wIrqnkA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-05-10T08:54:10Z"
mac: ENC[AES256_GCM,data:4n7bAGzORwd6vHl/Cs5YT8VZaSdfvxUm6e+fw7PYC2ov8XoRlJKU/Bci8Sbwcy2H6OjbkdRYA61cB2wAjtEY1x9N/c6qvUAOjTvOtcXoQQex8d+aMnJsFfJQ70GHCZE+KRTmy1SAMn+N00Oy0FDisdQe/jIZuWyav5j62CKqLqc=,iv:YEhiXU2IgXy4A0ZLsNY7kFqXJM5RBHE4IZwlRoF8XMA=,tag:aVc0r2g1QkY42NP59p4m2w==,type:str]
lastmodified: "2024-08-30T06:31:36Z"
mac: ENC[AES256_GCM,data:UUzv3IewuF4rhbrL2haJ0495p1d4wXA7LHa5ogc5TSv+ZAYuN/HL3VCXQzzKQrzqD3LtgC3DrGgmMNGVyAIzqVFYYxVuAwb03ov+lOp3SHvLTCMqkETbcE525aAIVWNqBXp7RBn7tKC4AD4y7AQihSYhBXO8VF1PeccjaCnN7R8=,iv:G0s8qchlgcm5HVshTKnGyt8nk+D4QYyP7n+5R0TOb8A=,tag:DspvfLf1pBs+/ol8GzT7Xw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.8.1
version: 3.9.0

1257
flake.lock generated

File diff suppressed because it is too large Load Diff

201
flake.nix
View File

@@ -3,31 +3,28 @@
inputs =
{
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:CHN-beta/nixpkgs/nixos-unstable";
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-unstable";
"nixpkgs-23.11".url = "github:CHN-beta/nixpkgs/nixos-23.11";
"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-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix =
{
url = "github:Mic92/sops-nix";
inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; };
};
aagl = { url = "github:ezKEa/aagl-gtk-on-nix/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs-unstable"; };
aagl = { url = "github:ezKEa/aagl-gtk-on-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-xddxdd = { url = "github:xddxdd/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; };
impermanence.url = "github:nix-community/impermanence";
qchem = { url = "github:Nix-QChem/NixOS-QChem/master"; inputs.nixpkgs.follows = "nixpkgs"; };
deploy-rs = { url = "github:serokell/deploy-rs"; 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"; };
@@ -54,8 +51,6 @@
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; };
@@ -66,8 +61,13 @@
kylin-virtual-keyboard = { url = "git+https://gitee.com/openkylin/kylin-virtual-keyboard.git"; flake = false; };
cjktty = { url = "github:CHN-beta/cjktty-patches"; flake = false; };
zxorm = { url = "github:CHN-beta/zxorm"; flake = false; };
openxlsx = { url = "github:troldal/OpenXLSX"; flake = false; };
openxlsx = { url = "github:troldal/OpenXLSX?rev=f85f7f1bd632094b5d78d4d1f575955fc3801886"; flake = false; };
sqlite-orm = { url = "github:fnc12/sqlite_orm"; flake = false; };
sockpp = { url = "github:fpagliughi/sockpp"; flake = false; };
git-lfs-transfer = { url = "github:charmbracelet/git-lfs-transfer"; flake = false; };
nc4nix = { url = "github:helsinki-systems/nc4nix"; flake = false; };
hextra = { url = "github:imfing/hextra"; flake = false; };
nu-scripts = { url = "github:nushell/nu_scripts"; flake = false; };
# does not support lfs yet
# nixos-wallpaper = { url = "git+https://git.chn.moe/chn/nixos-wallpaper.git"; flake = false; };
@@ -75,44 +75,54 @@
outputs = inputs:
let
localLib = import ./local/lib inputs.nixpkgs.lib;
localLib = import ./lib.nix inputs.nixpkgs.lib;
devices = builtins.filter (dir: (builtins.readDir ./devices/${dir})."default.nix" or null == "regular" )
(builtins.attrNames (builtins.readDir ./devices));
in
{
packages.x86_64-linux =
let pkgs = (import inputs.nixpkgs
packages.x86_64-linux = rec
{
pkgs = (import inputs.nixpkgs
{
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [ inputs.self.overlays.default ];
});
in
{
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)
devices));
hpcstat =
let
openssh = (pkgs.pkgsStatic.openssh.override { withLdns = false; etcDir = null; }).overrideAttrs
(prev: { doCheck = false; patches = prev.patches ++ [ ./local/pkgs/hpcstat/openssh.patch ];});
duc = pkgs.pkgsStatic.duc.override { enableCairo = false; cairo = null; pango = null; };
in pkgs.pkgsStatic.localPackages.hpcstat.override
{ inherit openssh duc; standalone = true; version = inputs.self.rev or "dirty"; };
ufo = pkgs.pkgsStatic.localPackages.ufo.override { version = inputs.self.rev or "dirty"; };
chn-bsub = pkgs.pkgsStatic.localPackages.chn-bsub;
nixpkgs = pkgs;
}
// (
builtins.listToAttrs (builtins.map
(system:
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)
devices));
hpcstat =
let
openssh = (pkgs.pkgsStatic.openssh.override { withLdns = false; etcDir = null; }).overrideAttrs
(prev: { doCheck = false; patches = prev.patches ++ [ ./packages/hpcstat/openssh.patch ];});
duc = pkgs.pkgsStatic.duc.override { enableCairo = false; cairo = null; pango = null; };
in pkgs.pkgsStatic.localPackages.hpcstat.override
{ inherit openssh duc; standalone = true; version = inputs.self.rev or "dirty"; };
ufo =
let
range-v3 = pkgs.pkgsStatic.range-v3.overrideAttrs (prev:
{
name = system;
value = inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel;
})
devices)
);
cmakeFlags = prev.cmakeFlags or []
++ [ "-DRANGE_V3_DOCS=OFF" "-DRANGE_V3_TESTS=OFF" "-DRANGE_V3_EXAMPLES=OFF" ];
doCheck = false;
});
tbb = pkgs.pkgsStatic.tbb_2021_11.overrideAttrs (prev: { cmakeFlags = prev.cmakeFlags or [] ++
[ "-DTBB_TEST=OFF" ]; });
biu = pkgs.pkgsStatic.localPackages.biu.override { inherit range-v3; };
matplotplusplus = pkgs.pkgsStatic.localPackages.matplotplusplus.override { libtiff = null; };
in pkgs.pkgsStatic.localPackages.ufo.override { inherit biu tbb matplotplusplus; };
chn-bsub = pkgs.pkgsStatic.localPackages.chn-bsub;
blog = pkgs.callPackage ./blog { inherit (inputs) hextra; };
}
// (builtins.listToAttrs (builtins.map
(system:
{
name = system;
value = inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel;
})
devices)
);
nixosConfigurations =
(
(builtins.listToAttrs (builtins.map
@@ -127,7 +137,7 @@
[
(moduleInputs: { config.nixpkgs.overlays = [(prev: final:
# replace pkgs with final to avoid infinite recursion
{ localPackages = import ./local/pkgs (moduleInputs // { pkgs = final; }); })]; })
{ localPackages = import ./packages (moduleInputs // { pkgs = final; }); })]; })
./modules
./devices/${system}
];
@@ -143,77 +153,66 @@
[
(moduleInputs: { config.nixpkgs.overlays = [(prev: final:
# replace pkgs with final to avoid infinite recursion
{ localPackages = import ./local/pkgs (moduleInputs // { pkgs = final; }); })]; })
{ localPackages = import ./packages (moduleInputs // { pkgs = final; }); })]; })
./modules
./devices/pi3b
];
};
}
);
deploy =
{
sshUser = "root";
user = "root";
fastConnection = true;
autoRollback = false;
magicRollback = false;
nodes = builtins.listToAttrs (builtins.map
(node:
{
name = node;
value =
{
hostname = node;
profiles.system.path = inputs.self.nixosConfigurations.${node}.pkgs.deploy-rs.lib.activate.nixos
inputs.self.nixosConfigurations.${node};
};
})
[ "vps6" "vps7" "nas" "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; }); };
{ localPackages = (import ./packages { inherit (inputs) lib; pkgs = final; topInputs = inputs; }); };
config = { archive = false; branch = "production"; };
devShells.x86_64-linux =
let pkgs = (import inputs.nixpkgs
devShells.x86_64-linux = let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{
biu = pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
{
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [ inputs.self.overlays.default ];
});
in
{
biu = pkgs.mkShell
{
inputsFrom = with pkgs.localPackages; [ biu ];
buildInputs = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
hpcstat = pkgs.mkShell
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.hpcstat.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
sbatch-tui = pkgs.mkShell
{
inputsFrom = with pkgs.localPackages; [ sbatch-tui ];
buildInputs = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
ufo = pkgs.mkShell
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.ufo.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
chn-bsub = pkgs.mkShell
{
inputsFrom = with pkgs.localPackages; [ chn-bsub ];
buildInputs = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
inputsFrom = [ pkgs.localPackages.biu ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
hpcstat = pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.hpcstat.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
sbatch-tui = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.sbatch-tui ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
ufo = pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.ufo.override { version = null; }) ];
packages = [ pkgs.ccls ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
chn-bsub = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.chn-bsub ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
winjob =
let inherit (pkgs) clang-tools_18; in let inherit (inputs.self.packages.x86_64-w64-mingw32) pkgs winjob;
in pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
{
inputsFrom = [ winjob ];
packages = [ clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
};
src = let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{
nixos-wallpaper = pkgs.fetchgit
{
url = "https://git.chn.moe/chn/nixos-wallpaper.git";
rev = "1ad78b20b21c9f4f7ba5f4c897f74276763317eb";
sha256 = "0faahbzsr44bjmwr6508wi5hg59dfb57fzh5x6jh7zwmv4pzhqlb";
fetchLFS = true;
};
};
};
}

View File

@@ -54,4 +54,36 @@ lib: rec
else null
else null)
(attrsToList (builtins.readDir path))));
# replace the value in a nested attrset. example:
# deepReplace
# [ { path = [ "a" "b" 1 ]; value = "new value"; } ]
# { a = { b = [ "old value" "old value" ]; }; }
# => { a = { b = [ "old value" "new value" ]; }; }
deepReplace = pattern: origin:
let replace = { path, value, content }:
if path == [] then
if (builtins.typeOf value) == "lambda" then value content
else value
else let currentPath = builtins.head path; nextPath = builtins.tail path; in
if (builtins.typeOf currentPath) == "string" then
if (builtins.typeOf content) != "set" then builtins.throw "content should be a set"
else builtins.mapAttrs
(n: v: if n == currentPath then replace { path = nextPath; inherit value; content = v; } else v) content
else if (builtins.typeOf currentPath) == "int" then
if (builtins.typeOf content) != "list" then builtins.throw "content should be a list"
else lib.imap0
(i: v: if i == currentPath then replace { path = nextPath; inherit value; content = v; } else v) content
else if (builtins.typeOf currentPath) != "lambda" then throw "path should be a lambda"
else
if (builtins.typeOf content) == "list" then builtins.map
(v: if currentPath v then replace { path = nextPath; inherit value; content = v; } else v) content
else if (builtins.typeOf content) == "set" then builtins.listToAttrs (builtins.map
(v: if currentPath v then replace { path = nextPath; inherit value; content = v; } else v)
(attrsToList content))
else throw "content should be a list or a set.";
in
if (builtins.typeOf pattern) != "list" then throw "pattern should be a list"
else if pattern == [] then origin
else deepReplace (builtins.tail pattern) (replace ((builtins.head pattern) // { content = origin; }));
}

View File

@@ -1,7 +0,0 @@
include("${CMAKE_CURRENT_LIST_DIR}/biuTargets.cmake")
find_package(magic_enum REQUIRED)
find_package(fmt REQUIRED)
find_package(Boost REQUIRED COMPONENTS headers iostreams)
find_package(Eigen3 REQUIRED)
find_package(range-v3 REQUIRED)
find_path(NAMEOF_INCLUDE_DIR nameof.hpp REQUIRED)

View File

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

View File

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

View File

@@ -1,41 +0,0 @@
# 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

@@ -1,267 +0,0 @@
# 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

@@ -1,366 +0,0 @@
# 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

@@ -1,54 +0,0 @@
# 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

@@ -1,29 +0,0 @@
# 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

@@ -1,104 +0,0 @@
# include <future>
# include <utility>
# include <cstdio>
# include <biu.hpp>
# include <boost/process.hpp>
# include <boost/preprocessor.hpp>
namespace biu
{
std::regex literals::operator""_re(const char* str, std::size_t len) { return std::regex{str, len}; }
namespace common
{
void block_forever() { std::promise<void>().get_future().wait(); std::unreachable(); }
bool is_interactive() { return isatty(fileno(stdin)); }
std::optional<std::string> env(std::string name)
{
if (auto value = std::getenv(name.c_str()); !value) return std::nullopt;
else return value;
}
template <bool DirectStdout, bool DirectStderr>
detail_::ExecResult<DirectStdout, DirectStderr>::operator bool() const
{ return ExitCode == 0; }
# define BIU_EXECRESULT_PRED(r, state) BOOST_PP_NOT_EQUAL(state, 4)
# define BIU_EXECRESULT_OP(r, state) BOOST_PP_INC(state)
# define BIU_EXECRESULT_MACRO(r, state) \
template detail_::ExecResult<(state & 1) != 0, (state & 2) != 0>::operator bool() const;
BOOST_PP_FOR(0, BIU_EXECRESULT_PRED, BIU_EXECRESULT_OP, BIU_EXECRESULT_MACRO)
namespace detail_
{
template <ExecInput Input>
detail_::ExecResult<Input.DirectStdout, Input.DirectStderr> exec
(
std::conditional_t<Input.SearchPath, std::string, std::filesystem::path> program, std::vector<std::string> args,
std::optional<std::string> stdin_string, std::map<std::string, std::string> extra_env
)
{
namespace bp = boost::process;
bp::ipstream stdout_stream, stderr_stream;
bp::opstream input_stream;
auto&& stdout_format = [&]
{ if constexpr (Input.DirectStdout) return bp::std_out > stdout; else return bp::std_out > stdout_stream; }();
auto&& stderr_format = [&]
{ if constexpr (Input.DirectStderr) return bp::std_err > stderr; else return bp::std_err > stderr_stream; }();
auto&& actual_program =
[&]{ if constexpr (Input.SearchPath) return bp::search_path(program); else return program.string(); }();
std::unique_ptr<bp::child> process;
bp::environment env = boost::this_process::environment();
for (const auto& [key, value] : extra_env) env[key] = value;
process = [&]
{
if constexpr (Input.DirectStdin) return std::make_unique<bp::child>
(actual_program, bp::args(args), stdout_format, stderr_format, bp::std_in < stdin, env);
else if (stdin_string) return std::make_unique<bp::child>
(actual_program, bp::args(args), stdout_format, stderr_format, bp::std_in < input_stream, env);
else return std::make_unique<bp::child>
(actual_program, bp::args(args), stdout_format, stderr_format, bp::std_in < bp::null, env);
}();
if (stdin_string) { input_stream << *stdin_string; input_stream.pipe().close(); }
process->wait();
return
{
.ExitCode = process->exit_code(),
.Stdout = [&]
{
if constexpr (Input.DirectStdout) return Empty{};
else return std::string{std::istreambuf_iterator<char>{stdout_stream.rdbuf()}, {}};
}(),
.Stderr = [&]
{
if constexpr (Input.DirectStderr) return Empty{};
else return std::string{std::istreambuf_iterator<char>{stderr_stream.rdbuf()}, {}};
}()
};
}
}
template <detail_::ExecInput Input> requires (!Input.DirectStdin)
detail_::ExecResult<Input.DirectStdout, Input.DirectStderr> exec
(
std::conditional_t<Input.SearchPath, std::string, std::filesystem::path> program, std::vector<std::string> args,
std::optional<std::string> stdin_string, std::map<std::string, std::string> extra_env
)
{ return detail_::exec<Input>(program, args, stdin_string, extra_env); }
template <detail_::ExecInput Input> requires (Input.DirectStdin)
detail_::ExecResult<Input.DirectStdout, Input.DirectStderr> exec
(
std::conditional_t<Input.SearchPath, std::string, std::filesystem::path> program, std::vector<std::string> args,
std::map<std::string, std::string> extra_env
)
{ return detail_::exec<Input>(program, args, {}, extra_env); }
# define BIU_EXEC_PRED(r, state) BOOST_PP_NOT_EQUAL(state, 8)
# define BIU_EXEC_OP(r, state) BOOST_PP_INC(state)
# define BIU_EXEC_MACRO(r, state) \
template detail_::ExecResult<(state & 1) != 0, (state & 2) != 0> \
exec<{false, (state & 1) != 0, (state & 2) != 0, (state & 4) != 0}> \
(std::conditional_t<(state & 4) != 0, std::string, std::filesystem::path>, std::vector<std::string>, \
std::optional<std::string>, std::map<std::string, std::string>); \
template detail_::ExecResult<(state & 1) != 0, (state & 2) != 0> \
exec<{true, (state & 1) != 0, (state & 2) != 0, (state & 4) != 0}> \
(std::conditional_t<(state & 4) != 0, std::string, std::filesystem::path>, std::vector<std::string>, \
std::map<std::string, std::string>);
BOOST_PP_FOR(0, BIU_EXEC_PRED, BIU_EXEC_OP, BIU_EXEC_MACRO)
}
}

View File

@@ -1,36 +0,0 @@
# 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

@@ -1,89 +0,0 @@
inputs: rec
{
typora = inputs.pkgs.callPackage ./typora {};
vesta = inputs.pkgs.callPackage ./vesta {};
rsshub = inputs.pkgs.callPackage ./rsshub.nix
{
inherit mkPnpmPackage;
src = inputs.topInputs.rsshub;
nodejs = nodejs-with-pnpm9.override { nodejs = inputs.pkgs.nodejs_22; };
};
misskey = inputs.pkgs.callPackage ./misskey.nix
{ inherit mkPnpmPackage; src = inputs.topInputs.misskey; nodejs = nodejs-with-pnpm9; };
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; };
mirism = inputs.pkgs.callPackage ./mirism
{
inherit cppcoro nameof tgbot-cpp date;
nghttp2 = inputs.pkgs.callPackage "${inputs.topInputs."nixpkgs-23.05"}/pkgs/development/libraries/nghttp2"
{ enableAsioLib = true; stdenv = inputs.pkgs.gcc12Stdenv; };
stdenv = inputs.pkgs.gcc12Stdenv;
};
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.nix { 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
{
src = inputs.pkgs.callPackage ./vasp/source.nix {};
gnu = inputs.pkgs.callPackage ./vasp/gnu
{
inherit (inputs.pkgs.llvmPackages) openmp;
inherit wannier90 src;
hdf5 = inputs.pkgs.hdf5.override { mpiSupport = true; fortranSupport = true; cppSupport = false; };
};
nvidia = inputs.pkgs.callPackage ./vasp/nvidia
{ inherit lmod nvhpc wannier90 vtst src; hdf5 = hdf5-nvhpc; };
intel = inputs.pkgs.callPackage ./vasp/intel
{ inherit lmod oneapi wannier90 vtst src; hdf5 = hdf5-oneapi; };
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; };
vtst = (inputs.pkgs.callPackage ./vasp/vtst.nix {});
vtstscripts = inputs.pkgs.callPackage ./vasp/vtstscripts.nix {};
};
# TODO: use other people packaged hpc version
oneapi = inputs.pkgs.callPackage ./oneapi {};
mumax = inputs.pkgs.callPackage ./mumax { src = inputs.topInputs.mumax; };
kylin-virtual-keyboard = inputs.pkgs.libsForQt5.callPackage ./kylin-virtual-keyboard
{ src = inputs.topInputs.kylin-virtual-keyboard; };
biu = inputs.pkgs.callPackage ./biu { inherit nameof zpp-bits; };
zxorm = inputs.pkgs.callPackage ./zxorm { src = inputs.topInputs.zxorm; };
hpcstat = inputs.pkgs.callPackage ./hpcstat { inherit nameof sqlite-orm zpp-bits date biu openxlsx; };
openxlsx = inputs.pkgs.callPackage ./openxlsx { src = inputs.topInputs.openxlsx; };
sqlite-orm = inputs.pkgs.callPackage ./sqlite-orm { src = inputs.topInputs.sqlite-orm; };
mkPnpmPackage = inputs.pkgs.callPackage ./mkPnpmPackage.nix {};
nodejs-with-pnpm9 = inputs.pkgs.callPackage ./nodejs-with-pnpm9.nix {};
sbatch-tui = inputs.pkgs.callPackage ./sbatch-tui { inherit biu; };
ufo = inputs.pkgs.callPackage ./ufo
{ inherit concurrencpp biu glad matplotplusplus zpp-bits; tbb = inputs.pkgs.tbb_2021_11; };
chn-bsub = inputs.pkgs.callPackage ./chn-bsub { inherit biu; };
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}
"${inputs.pkgs.remarshal}/bin/yaml2json ${builtins.toFile "content.yaml" content} $out"));
}

View File

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

@@ -1,214 +1 @@
# 设置 SSH agent forwarding
为了区分登陆 jykang@hpc.xmu.edu.cn 时使用的密钥并分密钥统计使用情况需要启用一项名为“SSH agent forwarding”的功能。
接下来的内容将带领您在 Windows 系统上配置 SSH agent forwarding。
> [!NOTE]
> 在 Linux 上的配置方法放在了文章末尾。大多数用户不需要阅读。
要启用“SSH agent forwarding”需要下面三个步骤
1. 启动 Pageant 并添加密钥。 **这一步骤每次登陆前都需要执行。**
2. 配置 PuTTY使 PuTTY 在每次登陆时不直接使用密钥,而是利用 Pageant 完成认证。这一步骤只需要执行一次。
3. 配置 WinSCP使 WinSCP 在每次登陆时不直接使用密钥,而是利用 Pageant 完成认证。这一步骤只需要执行一次。
接下来将分别说明这三个步骤。
## Pageant:
1. 找到 Pageant 程序。Pageant 会随着 PuTTY 一起安装,一般来说您可以直接在开始菜单中搜索 “pageant” 找到它,也可以在 PuTTY 的安装目录中找到它。
2. 启动 Pageant。启动后可能没有任何反应也可能有一个黑框闪过这是正常的。只要右下角的系统托盘中出现了 pageant 的图标就可以了。
![](pageant1.png)
3. 双击 Pageant 图标,打开 Pageant 窗口。选择 “Add Key”然后选择您的密钥文件。
![](pageant2.png)
4. 在使用服务器期间保持 Pageant 启动(可以关闭 Pageant 的窗口,但不要在系统托盘中右键退出)。
5. 使用完毕后,在系统托盘中右键退出 Pageant。
> [!NOTE]
> 无论是使用 WinSCP 还是 PuTTY每次使用前都需要如此启动 Pageant 并添加密钥。
> [!TIP]
> 如果您觉得每次打开 Pageant 都要手动添加密钥很麻烦,并且熟悉 Windows 命令行的使用,
> 可以编写一个批处理文件(将下方代码用记事本保存,然后将扩展名从 `.txt` 改为 `.bat`),每次双击该文件即可启动 Pageant 并自动添加密钥:
>
> `"C:\ProgramData\chocolatey\bin\PAGEANT.EXE" "Z:\.ssh\id_rsa.ppk"`
>
> 其中第一个引号内为 Pageant 的路径,第二个引号内为您的密钥文件的路径。也可以将该批处理文件放入开机启动项中,使得 Pageant 在开机时自动启动。
>
> 因为每个人的密钥文件以及 Pageant 的路径都可能不同,所以这里无法提供通用的批处理文件。
## PuTTY:
1. 在 Connection -> SSH -> Auth勾选“Attempt authentication using Pageant”和“Allow agent forwarding”。
![](putty1.png)
2. 在 Connection -> SSH -> Auth -> Credentials清空 “Private key file for authentication”然后保存。
![](putty2.png)
3. (选做但推荐)在 Connection -> Data 中,将 “Auto-login username” 设置为 `jykang`,这样每次登陆时就不需要手动输入用户名了。
## WinSCP:
1. 在 SSH -> Authentication勾选 “使用 Pageant 进行认证”,勾选 “允许代理转发”,清空 “密钥文件”,然后保存。
![](winscp1.png)
2. (选做)如果您需要通过 WinSCP 打开 PuTTY 的话,需要在 WinSCP 主界面 -> 工具 -> 选项 -> 集成 -> 应用程序路径中,
在原来的基础上增加 `-A` 参数。
![](winscp2.png)
> [!TIP]
> 如果 WinSCP 不让你直接修改那个字符串,就把它复制到记事本里修改,然后再复制回去。
至此,您已经成功配置了 SSH agent forwarding。
之后使用 PuTTY 登陆 `jykang@hpc.xmu.edu.cn` 时,会收到包含了您的名字的提示(如图所示),表明您已经成功启用了 SSH agent forwarding。
![](putty3.png)
> [!NOTE]
> 无论是 PuTTY 还是 WinSCP改完设置后都记得保存。
> [!IMPORTANT]
> 如果您确认已经按照教程设置好了却仍然不能连接,可以尝试将 WinSCP 和 PuTTY 都更新到最新。
>
> 我测试使用的版本是PuTTY 0.78 和 WinSCP 6.3.3。
---
# 其它内容
接下来的内容不是使用 jykang@hpc.xmu.edu.cn 的必需内容,不须要阅读。
如果您按照上面的步骤配置 SSH agent forwarding 失败,那么请再次仔细阅读上面的内容,**接下来的内容对您没有帮助**。
接下来的内容包括:
* 解释为什么不转发 agent 就无法区分不同密钥。
* 介绍一些可能有用的附加功能,例如区分使用同一个密钥的不同用户,以及如何设置任务进度微信通知。
## 为什么不转发 agent 就无法区分不同密钥?
如果你好奇为什么不使用 Pageant 就无法区分使用不同密钥的登陆:
SSH 连接并不是直接由 jykang 用户处理的,
而是由一个名为 `sshd` 的程序处理,它通常以 `root` 用户的身份运行。
在完成认证后,`sshd` 会将 Windows 电脑发来的信息解密后转发给以 `jykang` 用户运行的进程,
并将以 `jykang` 用户运行的进程的输出加密后发回给 Windows 电脑。
我们只能控制 `jykang` 用户运行的进程,但这里拿不到任何关于密钥的信息。
```mermaid
flowchart TB
subgraph "Run on windows"
A[(密钥文件)] -.->|从硬盘读取| B["SSH client (putty, WinSCP, etc.)"]
end
subgraph "Run on hpc by root"
C["SSH server (sshd)"]
end
B <--> |"认证信息 & 加密的数据"| C
subgraph "Run on hpc by <b>jykang</b>"
D["Other programs (bash, VASP, etc.)"]
end
C <--> |"解密后的数据(不包含密钥信息)"| D
```
Pageant 程序就是所谓的“SSH agent”。“SSH agent forwarding” 就是将到 Pageant 的连接通过已经建立的 SSH 连接转发给远程服务器,
使得远程服务器可以与 Pageant 通信,进而读取密钥信息。
“SSH agent forwarding” 典型的用途是在远程服务器上使用本地的密钥再次登陆其他服务器,而不是为了区分使用不同密钥的登陆。
```mermaid
flowchart TB
subgraph "Run on windows"
A[(密钥文件)] -.->|从硬盘读取| E["SSH agent (pageant)"]
E <-->|认证信息| B["SSH client (putty, WinSCP, etc.)"]
end
subgraph "Run on hpc by root"
C["SSH server (sshd)"]
end
B <--> |"认证信息 & 加密的数据"| C
subgraph "Run on hpc by <b>jykang</b>"
D["Other programs (bash, VASP, etc.)"]
end
C <--> |"解密后的数据(不包含密钥信息)"| D
E <-...-> |"通过已经建立的 SSH 连接转发密钥信息"| D
```
事实上linux 的管理(统计用户使用的资源,等)非常依赖于不同的用户,即用高权限的用户去管理低权限的用户。
大家都使用同一个账户的情况下,很多管理的功能没有现成的解决方案(要自己手写代码、思考如何设计),甚至完全无法实现。
整这个东西真的挺麻烦的。我也嫌麻烦(而且我要做的事情比大多数用户多得多)。要不是康老师一定要我做,我才不会做。
如果你嫌这些麻烦,与其埋怨我,不如去建议自己的导师去自己申请一个账号用。
## 设置子账户:
一个老师拿到密钥后,可能会将它分发给多个不同的学生。
如果希望区分不同学生的使用情况,可以修改 `TERM` 变量,加上 `hpcstat_subaccount:your_name:` 前缀,
以此来进一步区分使用同一个密钥的不同用户。
对于 PuTTY 来说,`TERM` 变量在 Connection -> Data -> Ternimal-type string 中修改。
例如,如果原本的 `TERM` 变量是 `xterm`,那么修改后的 `TERM` 变量可以是 `hpcstat_subaccount:chn:xterm`
`TERM` 变量只在交互式登陆时有效,因此无法在 WinSCP 中使用。
如果设置了这个参数,那么会额外统计不同子账户的使用情况(登陆次数、投递的任务、占用的核时,等)。
是否设置这个参数都不影响按密钥统计的功能(即,按照密钥统计的核时,是所有使用这个密钥的用户的总和,无论是否设置了这个参数)。
同时,子账户的统计结果也仅供参考,事实上这个统计结果很容易造假
(如果 A 和 B 都使用同一个密钥登陆,那么显然 B 可以在 TERM 中填入 A 的名字以假装自己是 A把自己用的核时都算到 A 头上)。
> [!CAUTION]
> 如果 `TERM` 变量的格式设置得不正确PuTTY 登陆后一些程序会无法正常工作,因此尝试时应该仔细且小心。
## PuTTY 登陆时自动跳转:
如果您希望在登陆时自动跳转到自己的目录下,可以在 `TERM` 中再增加以下前缀:`chn_cd:your_path:`
例如,将 `TERM` 变量修改为 `chn_cd:linwei/chn:xterm`,那么使用 PuTTY 登陆后会自动跳转到 `linwei/chn` 目录下。
如果同时使用了 `hpcstat_subaccount``chn_cd`,那么 `hpcstat_subaccount` 必须在 `chn_cd` 之后,
例如 `chn_cd:linwei/chn:hpcstat_subaccount:chn:xterm`
## 任务进度微信通知:
用微信打开下面的链接:
```
https://wxpusher.zjiecode.com/wxuser/?type=1&id=75864#/follow
```
您应该会被引导去关注一个公众号WxPusher 消息推送平台)。关注这个公众号之后会收到一条包含 UID 的消息。
然后把下面的信息发给我:
* 您的 UID
* 您使用的密钥的指纹(用 PuTTY 登陆时会提示)
* 如果使用了子账户(在 `TERM` 中设置了 `hpcstat_subaccount`),还需要告诉我您设置的子账户名
之后您投递的任务有新进度(例如,开始运行、运行结束)时就会通过这个公众号收到通知。
需要注意的是,这个 UID 会被明文写到 jykang 上的文件里。
也就是说存在这样的风险:有权限登陆 jykang 的人都有权限通过这个公众号给您发消息。
## 在 Linux 上配置 SSH agent forwarding
1. 使用以下命令将 `.ppk` 的私钥部分拆分出来:
```bash
puttygen id_rsa.ppk -O private-openssh -o ./id_rsa
```
确保 `id_rsa` 的权限为 `600`。
2. 在 `~/.ssh/config` 中添加以下内容:
```
Host jykang
AddKeysToAgent yes
ForwardAgent yes
IdentityFile ~/path/to/id_rsa
```
然后就可以正常使用了,例如:
```bash
ssh jykang
```
Moved to [../../../../packages/hpcstat/doc/setup.md](../../../../packages/hpcstat/doc/setup.md)

Binary file not shown.

View File

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

@@ -1,15 +0,0 @@
{ nodejs, fetchurl }: nodejs.overrideAttrs (prev:
{
passthru.pkgs = prev.passthru.pkgs.extend (final: prev:
{
pnpm = prev.pnpm.override
{
version = "9.1.0";
src = fetchurl
{
url = "https://registry.npmjs.org/pnpm/-/pnpm-9.1.0.tgz";
sha512 = "Z/WHmRapKT5c8FnCOFPVcb6vT3U8cH9AyyK+1fsVeMaq07bEEHzLO6CzW+AD62IaFkcayDbIe+tT+dVLtGEnJA==";
};
};
});
})

View File

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

View File

@@ -1 +0,0 @@
test

View File

@@ -1,10 +0,0 @@
{
stdenv, cmake, pkg-config,
yaml-cpp, eigen, fmt, concurrencpp, highfive, tbb, glad, matplotplusplus, biu, zpp-bits
}: stdenv.mkDerivation
{
name = "ufo";
src = ./.;
buildInputs = [ yaml-cpp eigen fmt concurrencpp highfive tbb glad matplotplusplus biu zpp-bits ];
nativeBuildInputs = [ cmake pkg-config ];
}

View File

@@ -1,141 +0,0 @@
# pragma once
# include <iostream>
# include <array>
# include <numbers>
# include <numeric>
# include <fstream>
# include <optional>
# include <array>
# include <utility>
# include <execution>
# include <syncstream>
# include <any>
# include <map>
# include <vector>
# include <span>
# include <yaml-cpp/yaml.h>
# include <Eigen/Dense>
# include <concurrencpp/concurrencpp.h>
# include <fmt/format.h>
# include <fmt/std.h>
# include <fmt/ranges.h>
# include <highfive/H5File.hpp>
# include <zpp_bits.h>
# include <matplot/matplot.h>
# include <matplot/backend/opengl.h>
// 在相位中, 约定为使用 $\exp (2 \pi i \vec{q} \cdot \vec{r})$ 来表示原子的运动状态
// (而不是 $\exp (-2 \pi i \vec{q} \cdot \vec{r})$)
// 一些书定义的倒格矢中包含了 $2 \pi$ 的部分, 我们这里约定不包含这部分.
// 也就是说, 正格子与倒格子的转置相乘, 得到单位矩阵.
namespace Eigen
{
constexpr inline auto serialize(auto & archive, Eigen::Matrix3d& matrix)
{ return archive(std::span(matrix.data(), matrix.size())); }
constexpr inline auto serialize(auto & archive, const Eigen::Matrix3d& matrix)
{ return archive(std::span(matrix.data(), matrix.size())); }
constexpr inline auto serialize(auto & archive, Eigen::Vector3d& vector)
{ return archive(std::span(vector.data(), vector.size())); }
constexpr inline auto serialize(auto & archive, const Eigen::Vector3d& vector)
{ return archive(std::span(vector.data(), vector.size())); }
}
namespace ufo
{
using namespace std::literals;
struct PhonopyComplex { double r, i; };
inline HighFive::CompoundType create_compound_complex()
{ return {{ "r", HighFive::AtomicType<double>{}}, {"i", HighFive::AtomicType<double>{}}}; }
namespace detail_
{
template <typename T> struct SpecializationOfBitsMembersHelper : std::false_type {};
template <std::size_t N> struct SpecializationOfBitsMembersHelper<zpp::bits::members<N>> : std::true_type {};
}
template <typename T> concept ZppSerializable
= requires() { detail_::SpecializationOfBitsMembersHelper<T>::value == true; };
class Solver
{
public:
virtual Solver& operator()() = 0;
virtual ~Solver() = default;
static concurrencpp::generator<std::pair<Eigen::Vector<unsigned, 3>, unsigned>>
triplet_sequence(Eigen::Vector<unsigned, 3> range);
template <ZppSerializable T> inline static void zpp_write(const T& object, std::string filename)
{
auto [data, out] = zpp::bits::data_out();
out(object).or_throw();
static_assert(sizeof(char) == sizeof(std::byte));
std::ofstream file(filename, std::ios::binary | std::ios::out);
file.exceptions(std::ios::badbit | std::ios::failbit);
file.write(reinterpret_cast<const char*>(data.data()), data.size());
}
template <ZppSerializable T> inline static T zpp_read(std::string filename)
{
auto input = std::ifstream(filename, std::ios::binary | std::ios::in);
input.exceptions(std::ios::badbit | std::ios::failbit);
static_assert(sizeof(std::byte) == sizeof(char));
std::vector<std::byte> data;
{
std::vector<char> string(std::istreambuf_iterator<char>(input), {});
data.assign
(
reinterpret_cast<std::byte*>(string.data()),
reinterpret_cast<std::byte*>(string.data() + string.size())
);
}
auto in = zpp::bits::in(data);
T output;
in(output).or_throw();
return output;
}
class Hdf5file
{
public:
inline Hdf5file& open_for_read(std::string filename)
{
File_ = HighFive::File(filename, HighFive::File::ReadOnly);
return *this;
}
inline Hdf5file& open_for_write(std::string filename)
{
File_ = HighFive::File(filename, HighFive::File::ReadWrite | HighFive::File::Create
| HighFive::File::Truncate);
return *this;
}
template <typename T> inline Hdf5file& read(T& object, std::string name)
{
object = File_->getDataSet(name).read<std::remove_cvref_t<decltype(object)>>();
return *this;
}
template <typename T> inline Hdf5file& write(const T& object, std::string name)
{
File_->createDataSet(name, object);
return *this;
}
protected:
std::optional<HighFive::File> File_;
};
struct DataFile
{
std::string Filename;
std::string Format;
std::map<std::string, std::any> ExtraParameters;
inline DataFile() = default;
DataFile
(
YAML::Node node, std::set<std::string> supported_format,
std::string config_file, bool allow_same_as_config_file = false
);
};
};
}
HIGHFIVE_REGISTER_TYPE(ufo::PhonopyComplex, ufo::create_compound_complex)

View File

@@ -1,86 +0,0 @@
# include <ufo/fold.hpp>
namespace ufo
{
FoldSolver::InputType::InputType(std::string config_file)
{
auto input = YAML::LoadFile(config_file);
for (unsigned i = 0; i < 3; i++)
SuperCellMultiplier(i) = input["SuperCellMultiplier"][i].as<unsigned>();
if (input["SuperCellDeformation"])
{
SuperCellDeformation.emplace();
for (unsigned i = 0; i < 3; i++)
for (unsigned j = 0; j < 3; j++)
(*SuperCellDeformation)(i, j) = input["SuperCellDeformation"][i][j].as<double>();
}
for (auto& qpoint : input["Qpoints"].as<std::vector<std::vector<double>>>())
Qpoints.push_back(Eigen::Vector3d
{{qpoint.at(0)}, {qpoint.at(1)}, {qpoint.at(2)}});
OutputFile = DataFile(input["OutputFile"], {"yaml"}, config_file);
}
void FoldSolver::OutputType::write(std::string filename) const
{
std::ofstream(filename) << [&]
{
std::stringstream print;
print << "Qpoints:\n";
for (auto& qpoint : Qpoints)
print << fmt::format(" - [ {:.8f}, {:.8f}, {:.8f} ]\n", qpoint(0), qpoint(1), qpoint(2));
return print.str();
}();
}
FoldSolver::FoldSolver(std::string config_file) : Input_(config_file) {}
FoldSolver& FoldSolver::operator()()
{
if (!Output_)
{
Output_.emplace();
for (auto& qpoint : Input_.Qpoints)
Output_->Qpoints.push_back(fold
(
qpoint, Input_.SuperCellMultiplier,
Input_.SuperCellDeformation
));
}
Output_->write(Input_.OutputFile.Filename);
return *this;
}
Eigen::Vector3d FoldSolver::fold
(
Eigen::Vector3d qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell,
Eigen::Vector<unsigned, 3> super_cell_multiplier,
std::optional<Eigen::Matrix<double, 3, 3>> super_cell_deformation
)
{
// 首先需要将 q 点转移到 ModifiedSuperCell 的倒格子中
// 将 q 点坐标扩大, 然后取小数部分, 就可以了
auto qpoint_by_reciprocal_modified_super_cell = super_cell_multiplier.cast<double>().asDiagonal()
* qpoint_in_reciprocal_primitive_cell_by_reciprocal_primitive_cell;
auto qpoint_in_reciprocal_modified_super_cell_by_reciprocal_modified_super_cell =
(qpoint_by_reciprocal_modified_super_cell.array() - qpoint_by_reciprocal_modified_super_cell.array().floor())
.matrix();
if (!super_cell_deformation)
return qpoint_in_reciprocal_modified_super_cell_by_reciprocal_modified_super_cell;
/*
对 q 点平移数个 SupreCell, 直到它落在超胞的倒格子中
这等价于直接将 q 点坐标用 SuperCell 的倒格子表示, 然后取小数部分.
ModifiedSuperCell = SuperCellMultiplier * PrimativeCell
SuperCell = SuperCellDeformation * ModifiedSuperCell
ReciprocalModifiedSuperCell = ModifiedSuperCell.inverse().transpose()
ReciprocalSuperCell = SuperCell.inverse().transpose()
Qpoint = QpointByReciprocalModifiedSuperCell.transpose() * ReciprocalModifiedSuperCell
Qpoint = QpointByReciprocalSuperCell.transpose() * ReciprocalSuperCell
整理可以得到:
QpointByReciprocalSuperCell = SuperCellDeformation * QpointByReciprocalModifiedSuperCell
*/
auto qpoint_in_reciprocal_modified_super_cell_by_reciprocal_super_cell =
(*super_cell_deformation * qpoint_in_reciprocal_modified_super_cell_by_reciprocal_modified_super_cell).eval();
auto qpoint_in_reciprocal_super_cell_by_reciprocal_super_cell =
qpoint_in_reciprocal_modified_super_cell_by_reciprocal_super_cell.array()
- qpoint_in_reciprocal_modified_super_cell_by_reciprocal_super_cell.array().floor();
return qpoint_in_reciprocal_super_cell_by_reciprocal_super_cell;
}
}

View File

@@ -1,20 +0,0 @@
{ lib, stdenv, src }: stdenv.mkDerivation
{
name = "win11os-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/* $out/share/Kvantum
mkdir -p $out/share/plasma/desktoptheme
cp -r $src/plasma/desktoptheme/* $out/share/plasma/desktoptheme
mkdir -p $out/share/plasma/look-and-feel
cp -r $src/plasma/look-and-feel/* $out/share/plasma/look-and-feel
mkdir -p $out/share/wallpapers
cp -r $src/wallpaper/* $out/share/wallpapers
'';
}

View File

@@ -30,8 +30,6 @@ inputs:
nix-vscode-extensions = topInputs.nix-vscode-extensions.extensions."${prev.system}";
nur-xddxdd = topInputs.nur-xddxdd.overlays.default final prev;
nur-linyinfeng = (topInputs.nur-linyinfeng.overlays.default final prev).linyinfeng;
deploy-rs =
{ inherit (prev) deploy-rs; inherit ((topInputs.deploy-rs.overlay final prev).deploy-rs) lib; };
firefox-addons = (import "${topInputs.rycee}" { inherit (prev) pkgs; }).firefox-addons;
inherit (import topInputs.gricad { pkgs = final; }) intel-oneapi intel-oneapi-2022;
})
@@ -39,7 +37,6 @@ inputs:
home-manager.sharedModules =
[
topInputs.plasma-manager.homeManagerModules.plasma-manager
topInputs.nix-doom-emacs.hmModule
topInputs.catppuccin.homeManagerModules.catppuccin
];
};

26
modules/hardware/cpus.nix Normal file
View File

@@ -0,0 +1,26 @@
inputs:
{
options.nixos.hardware.cpus = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.listOf (types.enum [ "intel" "amd" ]); default = []; };
config = let inherit (inputs.config.nixos.hardware) cpus; in inputs.lib.mkIf (cpus != [])
{
hardware.cpu = builtins.listToAttrs
(builtins.map (name: { inherit name; value = { updateMicrocode = true; }; }) cpus);
boot =
{
initrd.availableKernelModules =
let modules =
{
intel =
[
"intel_cstate" "aesni_intel" "intel_cstate" "intel_uncore" "intel_uncore_frequency" "intel_powerclamp"
];
amd = [];
};
in builtins.concatLists (builtins.map (cpu: modules.${cpu}) cpus);
};
environment.systemPackages =
let packages = with inputs.pkgs; { intel = []; amd = [ zenmonitor ]; };
in builtins.concatLists (builtins.map (cpu: packages.${cpu}) cpus);
};
}

View File

@@ -11,7 +11,6 @@ inputs:
joystick = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
printer = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
sound = mkOption { type = types.nullOr (types.submodule {}); inherit default; };
cpus = mkOption { type = types.listOf (types.enum [ "intel" "amd" ]); default = []; };
};
config = let inherit (inputs.config.nixos) hardware; in inputs.lib.mkMerge
[
@@ -40,33 +39,8 @@ inputs:
{
hardware.pulseaudio.enable = false;
services.pipewire = { enable = true; alsa = { enable = true; support32Bit = true; }; pulse.enable = true; };
sound.enable = true;
security.rtkit.enable = true;
}
)
# cpus
(
inputs.lib.mkIf (hardware.cpus != [])
{
hardware.cpu = builtins.listToAttrs
(map (name: { inherit name; value = { updateMicrocode = true; }; }) hardware.cpus);
boot =
{
initrd.availableKernelModules =
let modules =
{
intel =
[
"intel_cstate" "aesni_intel" "intel_cstate" "intel_uncore" "intel_uncore_frequency" "intel_powerclamp"
];
amd = [];
};
in builtins.concatLists (map (cpu: modules.${cpu}) hardware.cpus);
kernelParams =
let params = { intel = [ "intel_iommu=off" ]; amd = [ "amd_iommu=fullflush" ]; };
in builtins.concatLists (map (cpu: params.${cpu}) hardware.cpus);
};
}
)
];
}

View File

@@ -21,7 +21,7 @@ inputs:
mode = mkOption { type = types.enum [ "offload" "sync" ]; default = "offload"; };
busId = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
};
driver = mkOption { type = types.enum [ "production" "beta" ]; default = "production"; };
driver = mkOption { type = types.enum [ "production" "latest" "beta" ]; default = "production"; };
};
};
config = let inherit (inputs.config.nixos.hardware) gpu; in inputs.lib.mkIf (gpu.type != null) (inputs.lib.mkMerge
@@ -34,28 +34,23 @@ inputs:
let modules =
{
intel = [ "i915" ];
nvidia = [ "nvidia" "nvidia_drm" "nvidia_modeset" ]; # nvidia-uvm should not be loaded
amd = [ "amdgpu" ];
nvidia = []; # early loading breaks resume from hibernation
amd = [];
};
in builtins.concatLists (builtins.map (gpu: modules.${gpu}) gpus);
hardware =
{
opengl =
graphics =
{
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages =
let packages = with inputs.pkgs;
{
intel = [ intel-vaapi-driver libvdpau-va-gl intel-media-driver ];
nvidia = [ vaapiVdpau ];
amd = [ amdvlk rocmPackages.clr rocmPackages.clr.icd ];
amd = [];
};
in builtins.concatLists (builtins.map (gpu: packages.${gpu}) gpus);
extraPackages32 =
let packages = { intel = []; nvidia = []; amd = [ inputs.pkgs.driversi686Linux.amdvlk ]; };
in builtins.concatLists (builtins.map (gpu: packages.${gpu}) gpus);
};
nvidia = inputs.lib.mkIf (builtins.elem "nvidia" gpus)
{
@@ -63,25 +58,27 @@ inputs:
powerManagement.enable = true;
dynamicBoost.enable = inputs.lib.mkIf gpu.nvidia.dynamicBoost true;
nvidiaSettings = true;
forceFullCompositionPipeline = true;
package =
let actualDriver = { production = "legacy_535"; }.${gpu.nvidia.driver} or gpu.nvidia.driver;
in inputs.config.boot.kernelPackages.nvidiaPackages.${actualDriver};
package = inputs.config.boot.kernelPackages.nvidiaPackages.${gpu.nvidia.driver};
open = true; # TODO: remove when 560 is stable
prime.allowExternalGpu = true;
# nvidia 555 package have some bug, should use open
open = inputs.lib.mkIf (gpu.nvidia.driver == "beta") true;
};
};
boot =
{
kernelParams = inputs.lib.mkIf (builtins.elem "amd" gpus)
[ "radeon.cik_support=0" "amdgpu.cik_support=1" "radeon.si_support=0" "amdgpu.si_support=1" ];
blacklistedKernelModules = [ "nouveau" ];
};
environment.variables.VDPAU_DRIVER = inputs.lib.mkIf (builtins.elem "intel" gpus) "va_gl";
boot.blacklistedKernelModules = [ "nouveau" ];
environment.variables =
if builtins.elem "nvidia" gpus then { VDPAU_DRIVER = "nvidia"; }
else if builtins.elem "intel" gpus then { VDPAU_DRIVER = "va_gl"; }
else {};
services.xserver.videoDrivers =
let driver = { intel = "modesetting"; amd = "amdgpu"; nvidia = "nvidia"; };
in builtins.map (gpu: driver.${gpu}) gpus;
nixos.packages.packages._packages =
let packages = with inputs.pkgs;
{
intel = [ intel-gpu-tools ];
nvidia = [ nvtopPackages.full ];
amd = [];
};
in builtins.concatLists (builtins.map (gpu: packages.${gpu}) gpus);
}
)
# nvidia prime offload
@@ -99,5 +96,15 @@ inputs:
powerManagement.finegrained = inputs.lib.mkIf (gpu.nvidia.prime.mode == "offload") true;
};}
)
# amdgpu
(
inputs.lib.mkIf (inputs.lib.strings.hasPrefix "amd" gpu.type) { hardware.amdgpu =
{
opencl.enable = true;
legacySupport.enable = true;
initrd.enable = true;
amdvlk = { enable = true; support32Bit.enable = true; supportExperimental.enable = true; };
};}
)
]);
}

View File

@@ -1,6 +1,11 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
options.nixos.packages.chromium = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) chromium; in inputs.lib.mkIf (chromium != null)
{
programs.chromium = { enable = true; extraOpts.PasswordManagerEnabled = false; };
};

View File

@@ -1,47 +1,21 @@
inputs:
{
imports = inputs.localLib.findModules ./.;
options.nixos.packages =
let
inherit (inputs.lib) mkOption types;
packageSets =
[
# no gui, only used for specific purpose
"server"
"server-extra"
# gui, for daily use, but not install large programs such as matlab
"desktop"
"desktop-extra"
# nearly everything
"workstation"
];
in
{
packageSet = mkOption
{
type = types.enum packageSets;
default = if inputs.config.nixos.system.gui.enable then "desktop" else "server";
};
extraPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_packageSets = mkOption
{
type = types.listOf types.nonEmptyStr;
readOnly = true;
default = builtins.genList (i: builtins.elemAt packageSets i)
((inputs.localLib.findIndex inputs.config.nixos.packages.packageSet packageSets) + 1);
};
_packages = mkOption { type = types.listOf types.unspecified; default = []; };
_pythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
};
options.nixos.packages.packages = let inherit (inputs.lib) mkOption types; in
{
extraPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
extraPrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
excludePrebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_packages = mkOption { type = types.listOf types.unspecified; default = []; };
_pythonPackages = mkOption { type = types.listOf types.unspecified; default = []; };
_prebuildPackages = mkOption { type = types.listOf types.unspecified; default = []; };
};
config =
{
environment.systemPackages = let inherit (inputs.lib.lists) subtractLists; in with inputs.config.nixos.packages;
environment.systemPackages = with inputs.config.nixos.packages.packages;
(inputs.lib.lists.subtractLists excludePackages (_packages ++ extraPackages))
++ [
(inputs.pkgs.python3.withPackages (pythonPackages:

View File

@@ -1,46 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# system management
btrfs-assistant snapper-gui kdePackages.qtstyleplugin-kvantum ventoy-full cpu-x
inputs.pkgs."pkgs-23.11".etcher
# password and key management
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui bitwarden
# download
qbittorrent nur-xddxdd.baidupcs-go wgetpaste
# development
scrcpy weston cage openbox krita
# media
spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc obs-studio
waifu2x-converter-cpp inkscape blender
# editor
typora
# news
fluent-reader
# nix tools
deploy-rs.deploy-rs nixpkgs-fmt appimage-run nixd nix-serve node2nix nix-prefetch-github prefetch-npm-deps
nix-prefetch-docker
# instant messager
element-desktop telegram-desktop discord fluffychat zoom-us signal-desktop slack nur-linyinfeng.wemeet
# browser
google-chrome
# office
crow-translate zotero pandoc ydict libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain hdfview
texliveFull
# math, physics and chemistry
octaveFull root ovito localPackages.vesta localPackages.vaspkit localPackages.v-sim
]
++ (builtins.filter (p: !((p.meta.broken or false) || (builtins.elem p.pname or null [ "falkon" ])))
(builtins.filter inputs.lib.isDerivation (builtins.attrValues kdePackages.kdeGear)));
};
};
programs.kdeconnect.enable = true;
};
}

View File

@@ -1,50 +1,144 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
options.nixos.packages.desktop = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) desktop; in inputs.lib.mkIf (desktop != null)
{
nixos =
{
packages._packages = with inputs.pkgs;
[
# system management
gparted wayland-utils clinfo glxinfo vulkan-tools dracut
(
writeShellScriptBin "xclip"
''
#!${bash}/bin/bash
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
exec ${xclip}/bin/xclip -sel clip "$@"
else
exec ${wl-clipboard-x11}/bin/xclip "$@"
fi
''
)
# color management
argyllcms xcalib
# networking
remmina putty mtr-gui
# media
mpv nomacs
# themes
localPackages.win11os-kde localPackages.fluent-kde localPackages.blurred-wallpaper
localPackages.slate utterly-nord-plasma utterly-round-plasma-style catppuccin catppuccin-sddm
catppuccin-cursors catppuccinifier-gui catppuccinifier-cli catppuccin-plymouth
(catppuccin-kde.override { flavour = [ "latte" ]; })
(catppuccin-gtk.override { variant = "latte"; })
(tela-circle-icon-theme.override { allColorVariants = true; })
# terminal
warp-terminal
# development
adb-sync
# desktop sharing
rustdesk-flutter
];
packages.packages =
{
_packages = with inputs.pkgs;
[
# system management
# TODO: module should add yubikey-touch-detector into path
gparted wayland-utils clinfo glxinfo vulkan-tools dracut yubikey-touch-detector btrfs-assistant snapper-gui
kdePackages.qtstyleplugin-kvantum ventoy-full cpu-x inputs.pkgs."pkgs-23.11".etcher wl-mirror
(
writeShellScriptBin "xclip"
''
#!${bash}/bin/bash
if [ "$XDG_SESSION_TYPE" = "x11" ]; then
exec ${xclip}/bin/xclip -sel clip "$@"
else
exec ${wl-clipboard-x11}/bin/xclip "$@"
fi
''
)
# color management
argyllcms xcalib
# networking
remmina putty mtr-gui
# media
mpv nomacs spotify yesplaymusic simplescreenrecorder imagemagick gimp netease-cloud-music-gtk vlc obs-studio
waifu2x-converter-cpp inkscape blender whalebird paraview
# themes
catppuccin catppuccin-sddm catppuccin-cursors catppuccinifier-gui catppuccinifier-cli catppuccin-plymouth
(catppuccin-kde.override { flavour = [ "latte" ]; }) (catppuccin-kvantum.override { variant = "latte"; })
klassy
localPackages.slate localPackages.blurred-wallpaper tela-circle-icon-theme
# terminal
warp-terminal
# development
adb-sync scrcpy weston cage openbox krita jetbrains.clion android-studio dbeaver-bin cling fprettify
aircrack-ng
# desktop sharing
rustdesk-flutter
# password and key management
yubikey-manager yubikey-manager-qt yubikey-personalization yubikey-personalization-gui bitwarden electrum
jabref
john crunch hashcat
# download
qbittorrent nur-xddxdd.baidupcs-go wgetpaste onedrive onedrivegui rclone
# editor
typora appflowy notion-app-enhanced joplin-desktop standardnotes logseq
# news
fluent-reader rssguard newsflash newsboat
# nix tools
nixpkgs-fmt appimage-run nixd nix-serve node2nix nix-prefetch-github prefetch-npm-deps nix-prefetch-docker
nix-template nil pnpm-lock-export bundix
# instant messager
element-desktop telegram-desktop discord fluffychat zoom-us signal-desktop slack nur-linyinfeng.wemeet
nheko # qq nur-xddxdd.wechat-uos TODO: cinny-desktop
# browser
google-chrome tor-browser microsoft-edge
# office
crow-translate zotero pandoc ydict libreoffice-qt texstudio poppler_utils pdftk gnuplot pdfchain hdfview
davinci-resolve
texliveFull
# math, physics and chemistry
octaveFull root ovito localPackages.vesta localPackages.vaspkit localPackages.v-sim
(mathematica.overrideAttrs (prev: { postInstall = prev.postInstall or "" + "ln -s ${src} $out/src"; }))
(quantum-espresso.override { stdenv = gcc14Stdenv; gfortran = gfortran14; }) jmol mpi
# virtualization
# TODO: broken on python 3.12: playonlinux
wineWowPackages.stagingFull virt-viewer bottles genymotion
# media
nur-xddxdd.svp
# for kdenlive auto subtitle
openai-whisper
]
++ (builtins.filter (p: !((p.meta.broken or false) || (builtins.elem p.pname or null [ "falkon" "kalzium" ])))
(builtins.filter inputs.lib.isDerivation (builtins.attrValues kdePackages.kdeGear)));
# TODO: fix it
# ++ inputs.lib.optional (inputs.config.nixos.system.nixpkgs.march != null) localPackages.mumax;
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
# TODO: broken on python 3.12: tensorflow keras
])];
};
user.sharedModules =
[{
config.programs =
{
plasma =
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
plasmarc.Wallpapers.usersWallpapers.value =
let
inherit (inputs.topInputs.self.src) nixos-wallpaper;
isPicture = f: builtins.elem (inputs.lib.last (inputs.lib.splitString "." f))
[ "png" "jpg" "jpeg" "webp" ];
in builtins.concatStringsSep "," (builtins.map (f: "${nixos-wallpaper}/${f.name}")
(builtins.filter (f: (isPicture f.name) && (f.value == "regular"))
(inputs.localLib.attrsToList (builtins.readDir nixos-wallpaper))));
};
powerdevil =
let config =
{
autoSuspend.action = "nothing";
dimDisplay.enable = false;
powerButtonAction = "turnOffScreen";
turnOffDisplay.idleTimeout = "never";
whenLaptopLidClosed = "turnOffScreen";
};
in { AC = config; battery = config; lowBattery = config; };
};
obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
};
};
}];
};
programs =
{
adb.enable = true;
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
yubikey-touch-detector.enable = true;
kdeconnect.enable = true;
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
sleepy-launcher = { enable = true; package = inputs.pkgs.sleepy-launcher; };
};
nixpkgs.overlays = [(final: prev:
{
@@ -52,20 +146,6 @@ inputs:
{
patches = (if (attrs ? patches) then attrs.patches else []) ++ [ ./telegram.patch ];
});
kdePackages = prev.kdePackages.overrideScope (final: prev:
{
kwin = prev.kwin.overrideAttrs (prev: { patches = prev.patches ++
[
{
"6.0.5" = inputs.pkgs.fetchurl
{
url = "https://aur.archlinux.org/cgit/aur.git/plain/explicit-sync.patch?h=kwin-explicit-sync"
+ "&id=b6fb7e1b8651365af426cfc7be0d03b9615fdd3a";
sha256 = "1zcksalmkf0mifmv0zl5awy1ch3fvfkkknxqk4mqg0vk1bbpjh2b";
};
}.${prev.version}
]; });
});
})];
services.pcscd.enable = true;
};

View File

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

View File

@@ -1,11 +1,12 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
options.nixos.packages.flatpak = let inherit (inputs.lib) mkOption types; in mkOption
{
services.flatpak =
{
enable = true;
uninstallUnmanaged = true;
};
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) flatpak; in inputs.lib.mkIf (flatpak != null)
{
services.flatpak = { enable = true; uninstallUnmanaged = true; };
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.git = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) git; in inputs.lib.mkIf (git != null)
{
programs.git =
{
@@ -11,7 +13,10 @@ inputs:
{
init.defaultBranch = "main";
core.quotepath = false;
lfs.ssh.automultiplex = false; # 避免 lfs 一直要求触摸 yubikey
receive.denyCurrentBranch = "warn"; # 允许 push 到非 bare 的仓库
};
};
nixos.packages.packages._packages = [ inputs.pkgs.localPackages.git-lfs-transfer ]; # make pure ssh lfs work
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.gpg = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) gpg; in inputs.lib.mkIf (gpg != null)
{
programs.gnupg.agent.enable = true;
};

View File

@@ -0,0 +1,51 @@
inputs:
{
options.nixos.packages.nushell = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = {};
};
config = let inherit (inputs.config.nixos.packages) nushell; in inputs.lib.mkIf (nushell != null)
{
nixos =
{
packages.packages._packages = [ inputs.pkgs.nushell ];
user.sharedModules =
[{
config.programs =
{
nushell =
{
enable = true;
extraConfig =
''
source ${inputs.topInputs.nu-scripts}/aliases/git/git-aliases.nu
$env.PATH = ($env.PATH | split row (char esep) | append "~/bin")
'';
};
carapace.enable = true;
oh-my-posh =
{
enable = true;
enableZshIntegration = false;
settings = inputs.localLib.deepReplace
[
{
path = [ "blocks" 0 "segments" (v: v.type or "" == "path") "properties" "style" ];
value = "powerlevel";
}
{
path = [ "blocks" 0 "segments" (v: v.type or "" == "executiontime") "template" ];
value = v: builtins.replaceStrings [ "" ] [ " " ] v;
}
]
(builtins.fromJSON (builtins.readFile
"${inputs.pkgs.oh-my-posh}/share/oh-my-posh/themes/atomic.omp.json"));
};
zoxide.enable = true;
direnv.enable = true;
};
}];
};
};
}

View File

@@ -1,18 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
{
nixos.user.sharedModules =
[{
config.programs.plasma =
{
enable = true;
configFile =
{
plasma-localerc = { Formats.LANG.value = "en_US.UTF-8"; Translations.LANGUAGE.value = "zh_CN"; };
baloofilerc."Basic Settings".Indexing-Enabled.value = false;
};
};
}];
};
}

View File

@@ -1,32 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server-extra" inputs.config.nixos.packages._packageSets)
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# shell
ksh
# basic tools
neofetch
# office
todo-txt-cli pdfgrep ffmpeg-full
# development
hexo-cli gh nix-init
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ])
++ (inputs.lib.optional (inputs.config.nixos.system.nixpkgs.arch == "x86_64") rar);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
openai python-telegram-bot fastapi pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 inquirerpy requests tqdm pydbus
])];
};
};
programs.yazi.enable = true;
services.fwupd.enable = true;
};
}

View File

@@ -1,41 +1,53 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.server = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) server; in inputs.lib.mkIf (server != null)
{
nixos.packages._packages = with inputs.pkgs;
[
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij ipfetch localPackages.pslist
fastfetch reptyr nushellFull duc ncdu progress
# lsxx
pciutils usbutils lshw util-linux lsof dmidecode lm_sensors
# top
iotop iftop htop btop powertop s-tui
# editor
nano bat
# downloader
wget aria2 curl yt-dlp
# file manager
tree eza trash-cli lsd broot file xdg-ninja mlocate
# compress
pigz upx unzip zip lzip p7zip
# file system management
sshfs e2fsprogs duperemove compsize exfatprogs
# disk management
smartmontools hdparm
# encryption and authentication
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
# networking
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils wireguard-tools
# nix tools
nix-output-monitor nix-tree ssh-to-age (callPackage "${inputs.topInputs.nix-fast-build}" {}) nix-inspect
# development
gdb try inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix
# stupid things
toilet lolcat
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ])
++ (inputs.lib.optional (inputs.config.nixos.system.nixpkgs.arch == "x86_64") rar);
nixos.packages.packages =
{
_packages = with inputs.pkgs;
[
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq zellij ipfetch localPackages.pslist
fastfetch reptyr duc ncdu progress libva-utils ksh neofetch
# lsxx
pciutils usbutils lshw util-linux lsof dmidecode lm_sensors
# top
iotop iftop htop btop powertop s-tui
# editor
nano bat
# downloader
wget aria2 curl yt-dlp ffsend
# file manager
tree eza trash-cli lsd broot file xdg-ninja mlocate
# compress
pigz upx unzip zip lzip p7zip
# file system management
sshfs e2fsprogs duperemove compsize exfatprogs
# disk management
smartmontools hdparm
# encryption and authentication
apacheHttpd openssl ssh-to-age gnupg age sops pam_u2f yubico-piv-tool
# networking
ipset iptables iproute2 dig nettools traceroute tcping-go whois tcpdump nmap inetutils wireguard-tools
# nix tools
nix-output-monitor nix-tree ssh-to-age (callPackage "${inputs.topInputs.nix-fast-build}" {}) nix-inspect
# development
gdb try inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix rr hexo-cli gh nix-init hugo
# stupid things
toilet lolcat
# office
todo-txt-cli pdfgrep ffmpeg-full
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ])
++ (inputs.lib.optional (inputs.config.nixos.system.nixpkgs.arch == "x86_64") rar);
_pythonPackages = [(pythonPackages: with pythonPackages;
[
openai python-telegram-bot fastapi-cli pypdf2 pandas matplotlib plotly gunicorn redis jinja2
certifi charset-normalizer idna orjson psycopg2 inquirerpy requests tqdm pydbus
])];
};
programs =
{
nix-index-database.comma.enable = true;
@@ -44,8 +56,16 @@ inputs:
autojump.enable = true;
direnv = { enable = true; nix-direnv.enable = true; };
mosh.enable = true;
yazi.enable = true;
};
services =
{
udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
fwupd.enable = true;
};
services.udev.packages = with inputs.pkgs; [ yubikey-personalization libfido2 ];
home-manager = { useGlobalPkgs = true; useUserPackages = true; };
# allow everyone run compsize
security.wrappers.compsize =
{ setuid = true; owner = "root"; group = "root"; source = "${inputs.pkgs.compsize}/bin/compsize"; };
};
}

View File

@@ -1,10 +1,22 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.ssh = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) ssh; in inputs.lib.mkIf (ssh != null)
{
services.openssh.knownHosts =
let servers =
{
vps4 =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIF7Y0tjt1XLPjqJ8HEB26W9jVfJafRQ3pv5AbPaxEc/Z";
hostnames = [ "vps4.chn.moe" "104.234.37.61" ];
};
"initrd.vps4" =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIJkOPTFvX9f+Fn/KHOIvUgoRiJfq02T42lVGQhpMUGJq";
hostnames = [ "initrd.vps4.chn.moe" "104.234.37.61" ];
};
vps6 =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIO5ZcvyRyOnUCuRtqrM/Qf+AdUe3a5bhbnfyhw2FSLDZ";
@@ -18,27 +30,27 @@ inputs:
vps7 =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIF5XkdilejDAlg5hZZD0oq69k8fQpe9hIJylTo/aLRgY";
hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "95.111.228.40" "192.168.83.2" ];
hostnames = [ "vps7.chn.moe" "wireguard.vps7.chn.moe" "ssh.git.chn.moe" "144.126.144.62" "192.168.83.2" ];
};
"initrd.vps7" =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIGZyQpdQmEZw3nLERFmk2tS1gpSvXwW0Eish9UfhrRxC";
hostnames = [ "initrd.vps7.chn.moe" "95.111.228.40" ];
hostnames = [ "initrd.vps7.chn.moe" "144.126.144.62" ];
};
nas =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIIktNbEcDMKlibXg54u7QOLt0755qB/P4vfjwca8xY6V";
hostnames = [ "wireguard.nas.chn.moe" "[office.chn.moe]:5440" "192.168.1.185" "192.168.83.4" ];
hostnames = [ "wireguard.nas.chn.moe" "192.168.1.2" "192.168.83.4" ];
};
"initrd.nas" =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIAoMu0HEaFQsnlJL0L6isnkNZdRq0OiDXyaX3+fl3NjT";
hostnames = [ "initrd.nas.chn.moe" "[office.chn.moe]:5440" "192.168.1.185" ];
hostnames = [ "initrd.nas.chn.moe" "192.168.1.2" ];
};
surface =
{
ed25519 = "AAAAC3NzaC1lZDI1NTE5AAAAIFdm3DcfHdcLP0oSpVrWwIZ/b9lZuakBSPwCFz2BdTJ7";
hostnames = [ "192.168.1.166" "wireguard.surface.chn.moe" "192.168.83.5" ];
hostnames = [ "192.168.1.4" "wireguard.surface.chn.moe" "192.168.83.5" ];
};
pc =
{
@@ -97,7 +109,7 @@ inputs:
(
(builtins.map
(host: { name = host; value = { inherit host; hostname = "${host}.chn.moe"; }; })
[ "vps6" "wireguard.vps6" "vps7" "wireguard.vps7" "wireguard.nas" ])
[ "vps4" "vps6" "wireguard.vps6" "vps7" "wireguard.vps7" "wireguard.nas" ])
++ (builtins.map
(host: { name = host; value = { inherit host; hostname = "${host}.chn.moe"; forwardX11 = true; }; })
[ "wireguard.pc" "wireguard.surface" "wireguard.xmupc1" "wireguard.xmupc2" ])
@@ -115,12 +127,12 @@ inputs:
})
[ "wlin" "hwang" ])
)
// {
// rec {
xmupc1 = { host = "xmupc1"; hostname = "xmupc1.chn.moe"; port = 6007; forwardX11 = true; };
xmupc2 = { host = "xmupc2"; hostname = "xmupc2.chn.moe"; port = 6394; forwardX11 = true; };
nas = { host = "nas"; hostname = "office.chn.moe"; port = 5440; };
pc = { host = "pc"; hostname = "office.chn.moe"; port = 3673; forwardX11 = true; };
surface = { host = "surface"; hostname = "192.168.1.166"; forwardX11 = true; };
nas = { host = "nas"; hostname = "192.168.1.2"; forwardX11 = true; };
pc = { host = "pc"; hostname = "192.168.1.3"; forwardX11 = true; };
surface = { host = "surface"; hostname = "192.168.1.4"; forwardX11 = true; };
gitea = { host = "gitea"; hostname = "ssh.git.chn.moe"; };
jykang =
{
@@ -130,6 +142,7 @@ inputs:
forwardAgent = true;
extraOptions.AddKeysToAgent = "yes";
};
"wireguard.jykang" = jykang // { host = "internal.jykang"; proxyJump = "wireguard.xmupc1"; };
};
};
})];

View File

@@ -1,6 +1,11 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets)
options.nixos.packages.steam = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) steam; in inputs.lib.mkIf (steam != null)
{
programs.steam =
{
@@ -15,6 +20,12 @@ inputs:
'';
});
});
extraPackages = [ inputs.pkgs.openssl_1_1 ];
extraCompatPackages = [ inputs.pkgs.proton-ge-bin ];
remotePlay.openFirewall = true;
protontricks.enable = true;
localNetworkGameTransfers.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
}

View File

@@ -1,7 +1,14 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "workstation" inputs.config.nixos.packages._packageSets)
options.nixos.packages.vasp = let inherit (inputs.lib) mkOption types; in mkOption
{
nixos.packages._packages = with inputs.pkgs.localPackages.vasp; [ intel nvidia vtstscripts ];
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
# TODO: add more options to correctly configure VASP
config = let inherit (inputs.config.nixos.packages) vasp; in inputs.lib.mkIf (vasp != null)
{
nixos.packages.packages._packages = inputs.lib.optionals (inputs.config.nixos.system.nixpkgs.march != null)
(with inputs.pkgs.localPackages.vasp; [ intel nvidia vtstscripts ]);
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.vim = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) vim; in inputs.lib.mkIf (vim != null)
{
nixos.user.sharedModules =
[{

View File

@@ -1,8 +1,13 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "desktop" inputs.config.nixos.packages._packageSets)
options.nixos.packages.vscode = let inherit (inputs.lib) mkOption types; in mkOption
{
nixos.packages = with inputs.pkgs;
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config = let inherit (inputs.config.nixos.packages) vscode; in inputs.lib.mkIf (vscode != null)
{
nixos.packages.packages = with inputs.pkgs;
{
_packages =
[(
@@ -21,7 +26,7 @@ inputs:
++ (builtins.attrNames vscode-extensions)
)));
in with extensions;
(with equinusocio; [ vsc-community-material-theme vsc-material-theme-icons ])
(with equinusocio; [ vsc-material-theme vsc-material-theme-icons ])
++ (with github; [ copilot copilot-chat github-vscode-theme ])
++ (with intellsmi; [ comment-translate deepl-translate ])
++ (with ms-python; [ isort python vscode-pylance ])

View File

@@ -1,62 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "workstation" inputs.config.nixos.packages._packageSets)
{
nixos =
{
packages = with inputs.pkgs;
{
_packages =
[
# password and key management
electrum jabref
# system management
wl-mirror nvtopPackages.full
# nix tools
nix-template nil pnpm-lock-export bundix
# instant messager
cinny-desktop nheko # qq nur-xddxdd.wechat-uos
# development
jetbrains.clion android-studio dbeaver-bin cling fprettify aircrack-ng
# install per project
# clang-tools_16 ccls
# media
nur-xddxdd.svp
# virtualization
wineWowPackages.stagingFull virt-viewer bottles # wine64
# text editor
appflowy notion-app-enhanced joplin-desktop standardnotes logseq
# math, physics and chemistry
(mathematica.overrideAttrs (prev: { postInstall = prev.postInstall or "" + "ln -s ${src} $out/src"; }))
(quantum-espresso.override { stdenv = gcc14Stdenv; gfortran = gfortran14; })
paraview jmol mpi localPackages.mumax
# encryption and password management
john crunch hashcat
# container and vm
genymotion davinci-resolve playonlinux
# browser
microsoft-edge tor-browser
# news
rssguard newsflash newsboat
];
_pythonPackages = [(pythonPackages: with pythonPackages;
[
phonopy tensorflow keras scipy scikit-learn jupyterlab autograd # localPackages.pix2tex
])];
};
user.sharedModules =
[{
config.programs.obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi obs-nvfbc droidcam-obs obs-vkcapture ];
};
}];
};
programs =
{
anime-game-launcher = { enable = true; package = inputs.pkgs.anime-game-launcher; };
honkers-railway-launcher = { enable = true; package = inputs.pkgs.honkers-railway-launcher; };
};
};
}

View File

@@ -1,6 +1,8 @@
inputs:
{
config = inputs.lib.mkIf (builtins.elem "server" inputs.config.nixos.packages._packageSets)
options.nixos.packages.zsh = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) zsh; in inputs.lib.mkIf (zsh != null)
{
nixos.user.sharedModules = [(home-inputs: { config.programs =
{
@@ -37,11 +39,7 @@ inputs:
name = "powerlevel10k";
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
file = "p10k.zsh";
name = "powerlevel10k-config";
src = ./p10k-config;
}
{ file = "p10k.zsh"; name = "powerlevel10k-config"; src = ./p10k-config; }
{
name = "zsh-lsd";
src = inputs.pkgs.fetchFromGitHub
@@ -71,10 +69,7 @@ inputs:
autosuggestions.enable = true;
enableCompletion = true;
ohMyZsh =
{
enable = true;
plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ];
};
{ enable = true; plugins = [ "git" "colored-man-pages" "extract" "history-substring-search" "autojump" ]; };
};
};
}

View File

@@ -41,6 +41,7 @@ inputs:
"--thread-count" "${builtins.toString instance.value.threads or 1}"
"--loadavg-target" "${builtins.toString instance.value.loadAverage or 1}"
"--scan-mode" "3"
"--verbose" "6"
];
};
})

View File

@@ -1,10 +1,7 @@
inputs:
{
options.nixos.services.fz-new-order = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = null;
};
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) fz-new-order; in inputs.lib.mkIf (fz-new-order != null)
{
users =
@@ -72,7 +69,7 @@ inputs:
"Z /var/lib/fz-new-order - fz-new-order fz-new-order"
];
};
sops = let userNum = 6; configNum = 2; in
sops = let userNum = 5; configNum = 2; in
{
templates."fz-new-order/config.json" =
{
@@ -80,7 +77,6 @@ inputs:
group = inputs.config.users.users."fz-new-order".group;
content = let placeholder = inputs.config.sops.placeholder; in builtins.toJSON
{
manager = placeholder."fz-new-order/manager";
token = placeholder."fz-new-order/token";
uids = builtins.map (j: placeholder."fz-new-order/uids/user${builtins.toString j}")
(builtins.genList (n: n) userNum);
@@ -92,7 +88,7 @@ inputs:
};
};
secrets =
{ "fz-new-order/manager" = {}; "fz-new-order/token" = {}; }
{ "fz-new-order/token" = {}; }
// (builtins.listToAttrs (builtins.map
(i: { name = "fz-new-order/uids/user${toString i}"; value = {}; })
(builtins.genList (n: n) userNum)))

View File

@@ -48,7 +48,7 @@ std::string urlencode(std::string s)
void oneshot
(
const std::string& username, const std::string& password, const std::string& comment,
const std::set<std::string>& wxuser, const std::set<std::string>& manager, const std::string& token
const std::set<std::string>& wxuser, const std::string& token
)
{
httplib::Client fzclient("http://scmv9.fengzhansy.com:8882");
@@ -152,16 +152,6 @@ void oneshot
for (const auto& order : order_list)
if (!order_old.contains(order.first))
{
for (const auto& user : manager)
{
auto path = fmt::format
(
"/api/send/message/?appToken={}&content={}&uid={}",
token, urlencode(fmt::format("push {}", order.first)), user
);
auto wxresult = wxclient.Get(path.c_str());
}
auto body = fmt::format
(
"method=dgate&rand=1234&op=scmmgr_pcggl&nv%5B%5D=opmode&nv%5B%5D=ddsp_qry&nv%5B%5D=bill&nv%5B%5D={}",
@@ -248,7 +238,7 @@ int main(int argc, char** argv)
oneshot
(
config["username"].asString(), config["password"].asString(), config["comment"].asString(),
uids, { configs["manager"].asString() }, configs["token"].asString()
uids, configs["token"].asString()
);
}

View File

@@ -19,11 +19,6 @@ inputs:
services.gitea =
{
enable = true;
package = inputs.pkgs.gitea.overrideAttrs { src = builtins.fetchurl
{
url = "https://dl.gitea.com/gitea/1.22.0-rc1/gitea-src-1.22.0-rc1.tar.gz";
sha256 = "1h7kjzk7zck7j2advcxc0gsmv3qkwmhcnqi9zl7ypiffy40p6l9y";
};};
lfs.enable = true;
mailerPasswordFile = inputs.config.sops.secrets."gitea/mail".path;
database =
@@ -48,6 +43,7 @@ inputs:
SMTP_PORT = 465;
USER = "bot@chn.moe";
};
service.REGISTER_MANUAL_CONFIRM = true;
};
};
nixos.services =

View File

@@ -4,7 +4,11 @@ inputs:
{
type = types.nullOr (types.submodule { options =
{
users = mkOption { type = types.listOf types.nonEmptyStr; default = [ "chn" "gb" "xll" "yjq" "zem" ]; };
users = mkOption
{
type = types.listOf types.nonEmptyStr;
default = [ "chn" "gb" "xll" "yjq" "zem" "gb" "wp" "hjp" ];
};
};});
default = null;
};

View File

@@ -106,7 +106,8 @@ inputs:
(inputs.localLib.attrsToList meilisearch.instances));
};
environment.persistence =
let inherit (inputs.config.nixos.system) impermanence; in inputs.lib.mkIf impermanence.enable
let inherit (inputs.config.nixos.system) impermanence;
in inputs.lib.mkIf (impermanence.enable && meilisearch.instances != {})
{ "${impermanence.nodatacow}".directories = [ "/var/lib/meilisearch" ]; };
};
}

View File

@@ -42,36 +42,23 @@ inputs:
secretFile = inputs.config.sops.templates."nextcloud/secret".path;
extraApps =
let
githubRelease = repo: file: "https://github.com/${repo}/releases/download/${file}";
in
{
# nix-prefetch-url --unpack
maps = inputs.pkgs.fetchNextcloudApp
version = inputs.lib.versions.major inputs.config.services.nextcloud.package.version;
info = builtins.fromJSON (builtins.readFile "${inputs.topInputs.nc4nix}/${version}.json");
getInfo = package:
{
url = githubRelease "nextcloud/maps" "v1.4.0/maps-1.4.0.tar.gz";
sha256 = "1gqms3rrdpjmpb1h5d72b4lwbvsl8p10zwnkhgnsmvfcf93h3r1c";
license = "agpl3Only";
inherit (info.${package}) hash url description homepage;
appName = package;
appVersion = info.${package}.version;
license =
let
licenses = { agpl = "agpl3Only"; };
originalLincense = builtins.head info.${package}.licenses;
in licenses.${originalLincense} or originalLincense;
};
phonetrack = inputs.pkgs.fetchNextcloudApp
{
url = githubRelease "julien-nc/phonetrack" "v0.8.1/phonetrack-0.8.1.tar.gz";
sha256 = "1i28xgzp85yb44ay2l2zw18fk00yd6fh6yddj92gdrljb3w9zpap";
license = "agpl3Only";
};
twofactor_webauthn = inputs.pkgs.fetchNextcloudApp
{
url = githubRelease "nextcloud-releases/twofactor_webauthn" "v1.4.0/twofactor_webauthn-v1.4.0.tar.gz";
sha256 = "0llxakzcdcy9hscyzw3na5zp1p57h03w5fmm0gs9g62k1b88k6kw";
license = "agpl3Only";
};
calendar = inputs.pkgs.fetchNextcloudApp
{
url = githubRelease "nextcloud-releases/calendar" "v4.7.6/calendar-v4.7.6.tar.gz";
sha256 = "09rsp5anpaqzwmrixza5qh12vmq9hd3an045064vm3rnynz537qc";
license = "agpl3Only";
};
};
};
in builtins.listToAttrs (builtins.map
(package: { name = package; value = inputs.pkgs.fetchNextcloudApp (getInfo package); })
[ "maps" "phonetrack" "twofactor_webauthn" "calendar" ]);
};
nixos.services =
{
postgresql.instances.nextcloud = {};

View File

@@ -1,17 +1,13 @@
inputs:
{
options.nixos.services.nginx.applications.blog = let inherit (inputs.lib) mkOption types; in
options.nixos.services.nginx.applications.blog = let inherit (inputs.lib) mkOption types; in mkOption
{
enable = mkOption { type = types.bool; default = false; };
type = types.nullOr (types.submodule {});
default = null;
};
config =
let
inherit (inputs.config.nixos.services.nginx.applications) blog;
inherit (inputs.lib) mkIf;
in mkIf blog.enable
config = let inherit (inputs.config.nixos.services.nginx.applications) blog; in inputs.lib.mkIf (blog != null)
{
nixos.services.nginx.https."blog.chn.moe".location."/".static =
{ root = "/srv/blog"; index = [ "index.html" ]; };
systemd.tmpfiles.rules = [ "d /srv/blog 0700 nginx nginx" "Z /srv/blog - nginx nginx" ];
{ root = builtins.toString inputs.topInputs.self.packages.x86_64-linux.blog; index = [ "index.html" ]; };
};
}

View File

@@ -3,7 +3,7 @@ inputs:
options.nixos.services.nixseparatedebuginfo = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default = if builtins.elem "desktop-extra" inputs.config.nixos.packages._packageSets then {} else null;
default = if inputs.config.nixos.system.gui.enable then {} else null;
};
config =
let inherit (inputs.config.nixos.services) nixseparatedebuginfo; in inputs.lib.mkIf (nixseparatedebuginfo != {})

View File

@@ -0,0 +1,17 @@
inputs:
{
options.nixos.services.ollama = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) ollama; in inputs.lib.mkIf (ollama != null)
{
services =
{
ollama.enable = true;
open-webui =
{ enable = true; package = inputs.pkgs.genericPackages.open-webui; environment.WEBUI_AUTH = "False"; };
nextjs-ollama-llm-ui.enable = true;
};
# TODO: broken in python 3.12
# nixos.packages._packages = [ inputs.pkgs.oterm ];
};
}

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