Compare commits

..

282 Commits

Author SHA1 Message Date
26371c3076 modules.services.gitea: disable AI web crawler prevention 2026-01-06 12:44:54 +08:00
f0cc24522e modules.services.gitea: fix 2026-01-06 12:38:43 +08:00
411a276d34 modules.system.grub: wait indefinitely on desktops 2026-01-06 12:31:34 +08:00
3b2ed6d850 modules.system.systemd: handle lid switch 2026-01-06 12:31:34 +08:00
e580d7faa2 flake: add ufo as submodule 2026-01-06 12:31:34 +08:00
c480e681c1 modules.services.gitea: remove anubis, use simple js 2026-01-06 09:48:54 +08:00
4adc1be9a2 flake: use nixpkgs from git submodule 2026-01-05 23:11:44 +08:00
93b1e4f146 modules.system.gui: set niri keybindings 2026-01-05 16:46:45 +08:00
b71484eca4 devices.wlin: chn-bsub us non-static package 2026-01-05 16:19:56 +08:00
3c37a9288c devices.wlin: use static chn-bsub 2026-01-05 16:11:09 +08:00
2532d3cf70 packages.biu: fix static build 2026-01-05 16:06:45 +08:00
1e65495897 packages.biu: cleanup unnecessary stdenv override 2026-01-05 15:26:06 +08:00
f2a9d285f3 packages.biu: simplify backtrace 2026-01-05 15:10:10 +08:00
ef8f516ab3 packages.biu: remove unused Logger::Exception class 2026-01-05 13:56:23 +08:00
d8b96a32e8 devices.wlin: fix env 2026-01-05 13:44:16 +08:00
085fde23ba modules.system.gui: allow to turn off monitors 2026-01-04 23:57:53 +08:00
5de71b4f6d modules.system.fileSystems.nfs: fix read-only NFS unmounting 2026-01-04 21:26:45 +08:00
682fb5d0a4 flake: update cachyos 2026-01-04 20:47:45 +08:00
a4ebf16124 modules.hardware.asus: do not apply kernel patch 2026-01-04 20:24:45 +08:00
03e89c43d2 Revert "devices.pc: switch to xanmod kernel"
This reverts commit 3e3e62838b.
2026-01-04 20:24:22 +08:00
e8786d4ace update asusctl 2026-01-04 19:23:57 +08:00
7b479a158b modules.system.kernel: Sort ASUS kernel patches 2026-01-04 00:30:27 +08:00
3e3e62838b devices.pc: switch to xanmod kernel 2026-01-03 23:04:29 +08:00
0ac3e0f4bc update xanmod 2026-01-03 23:03:56 +08:00
ef99027542 Revert "flake: remove linux-asus patch"
This reverts commit 1e3f630aa9.
2026-01-03 22:58:52 +08:00
c86ebb17f4 modules.packages.zsh: fix gitstatusd run on remote 2026-01-03 21:15:00 +08:00
6eb1609f3e modules.system.gui: fix niri scroll 2026-01-03 20:24:54 +08:00
b6dd4555a6 devices.wlin: add prrte.dev 2026-01-03 18:32:11 +08:00
93dc607cb5 Revert "localPackages: remove custom stdenv"
This reverts commit f653471c23.
2026-01-03 17:49:32 +08:00
f653471c23 localPackages: remove custom stdenv 2026-01-03 17:15:53 +08:00
0416427642 Revert "packages.chn-bsub: use fixed bash"
This reverts commit 9595bed7c0.
2026-01-03 16:58:50 +08:00
9595bed7c0 packages.chn-bsub: use fixed bash 2026-01-03 16:56:19 +08:00
e2556f3a04 devices.wlin: fix chn-bsub override usage 2026-01-03 16:20:21 +08:00
f5e70e16b2 packages.chn-bsub: fix config format 2026-01-03 16:05:01 +08:00
ebc05b9911 flake.lib.buildNixpkgsConfig: enable lsf support for openmpi 2026-01-03 15:57:18 +08:00
6efc29a7a4 devices.pc: Improve power management settings 2026-01-03 15:05:11 +08:00
c0c8bc3704 modules.system.systemd: disable lid switch causing suspend 2026-01-03 15:05:11 +08:00
73a1490fed modules.system.gui: fix niri 2026-01-03 15:05:11 +08:00
1bb6e550d8 modules.user.chn.ssh: Set TERM for wlin host 2026-01-03 14:18:55 +08:00
c9bd7b48d7 devices.wlin: add lsd 2026-01-03 14:17:25 +08:00
d1d27ce194 packages.chn-bsub: fix, install on wlin 2026-01-03 12:19:05 +08:00
3f46eb23de devices.wlin: adjust path 2026-01-02 18:08:02 +08:00
4cb983ce32 modules.packages.ssh: fix wlin 2026-01-02 18:06:20 +08:00
87c6d0fab4 devices.wlin: install 2026-01-02 18:05:24 +08:00
e5f7e1650e devices.wlin: add phonopy and vasp 2026-01-02 13:52:42 +08:00
d92b202b8e modules.packages.minimal: add cryptsetup 2026-01-02 12:59:45 +08:00
4c3cb5fe5f flake.dns: add tailscale DNS config 2026-01-02 12:46:56 +08:00
2147ba2f2d devices.srv2: remove NFS mount for NAS 2026-01-02 12:24:27 +08:00
58b1c596db flake.nixos: temporarily remove r2s 2026-01-02 11:38:50 +08:00
2e278b2dba flake: update btop 2026-01-01 07:56:27 +08:00
72067d23c5 flake.packages: allow to build separate archive 2025-12-31 20:21:26 +08:00
94670e9cbe devices.srv2: fix nfs mount 2025-12-31 17:31:19 +08:00
3ab4ecb5d2 modules.system.gui: Enable GTK icon cache 2025-12-31 17:03:45 +08:00
63c647ceba Merge branch 'next' into production 2025-12-31 14:11:59 +08:00
fb7e9156d0 packages.missgram: fix 2025-12-31 08:29:00 +08:00
f2e2f34cbf devices.pc: add NFS mount for nas.ts.chn.moe 2025-12-30 14:56:07 +08:00
7d09abee57 modules.system.fileSystems.nfs: add readOnly option 2025-12-30 14:55:12 +08:00
e2921059f8 modules.packages.desktop: update libreoffice 2025-12-30 11:36:40 +08:00
acd2845377 update readme 2025-12-30 10:52:00 +08:00
b1546505a5 fix distutils 2025-12-30 08:20:28 +08:00
e067993a14 packages.missgram: 转发回复,并修改文案 2025-12-29 17:06:58 +08:00
ffd01db99b packages.missgram: 修改文案 2025-12-29 16:52:47 +08:00
e1879c6625 packages/missgram: fix 2025-12-29 14:06:23 +08:00
8587524732 flake.lib: allow generic module styles 2025-12-28 18:00:25 +08:00
8fba11e9a8 modules.packages.vscode: swith to nixd 2025-12-28 17:40:51 +08:00
1de9f717ab modules.services.missgram: fix 2025-12-28 17:16:00 +08:00
3a34d1e962 packages.missgram: fix 2025-12-28 15:40:25 +08:00
f7deb945ae packages/missgram: save info to db 2025-12-28 10:46:52 +08:00
c3e1d2bfb7 devices.pc: enable postgresql 2025-12-27 16:23:42 +08:00
8166c7ecee packages/missgram: init sql depencency 2025-12-27 16:02:40 +08:00
157dd0e844 packages/reflectcpp,sqlgen: init 2025-12-27 15:46:15 +08:00
0c80dde1d1 packages/missgram: rename 2025-12-27 11:40:10 +08:00
4d1f6eb6b5 packages.misskey-forwarder: fix 2025-12-26 13:35:01 +08:00
bf922747d5 packages/misskey-forwarder: fix renote link 2025-12-26 12:38:29 +08:00
a1b4aa7803 flake.dns: fix 2025-12-26 07:01:12 +08:00
3eb2495ebb flake.lib.buildNixpkgsConfig: remove valkey workaround 2025-12-25 23:12:53 +08:00
c36e0c52d6 packages/misskey-forwarder: init 2025-12-25 23:12:48 +08:00
222b0829c8 modules.packages.vscode: remove tab default keybinding 2025-12-25 17:53:45 +08:00
3b7e22fc52 Merge branch 'next' into production 2025-12-25 09:13:40 +08:00
5aebb72185 packages.ghostty/zellij: increase scrollback buffer size 2025-12-24 21:06:20 +08:00
08023306d6 modules.services.sshd: enable GatewayPorts 2025-12-24 14:28:28 +08:00
ea91a75380 Revert "modules.services.huggin: drop"
This reverts commit 7a7b645e9e.
2025-12-24 14:01:49 +08:00
0211a71cfa devices.xmuhk: add archive 2025-12-22 19:03:41 +08:00
37a5069c3a devices.wlin: add archive 2025-12-22 19:02:33 +08:00
da9e67c25e devices.jykang: add archive 2025-12-22 18:53:11 +08:00
94a0b81122 modules.user: add stq 2025-12-22 18:05:20 +08:00
4d10cb5301 modules.system.gui: add more startup apps 2025-12-22 12:58:10 +08:00
a097f7b85e flake: remname dank-material-shell 2025-12-22 10:26:03 +08:00
cd96c1a4ee flake: revert nix4vscode version 2025-12-22 10:25:46 +08:00
a1c9487e79 update everything 2025-12-21 19:57:48 +08:00
721c0af938 modules.services.slurm: update flag syntax 2025-12-21 10:39:02 +08:00
1d6a352978 modules.packages.zsh: enable fzf 2025-12-21 09:29:11 +08:00
58ea730d48 Revert "devices.pc: adjust cpu voltage and power settings"
This reverts commit 298b0e05f5.
2025-12-21 08:58:00 +08:00
298b0e05f5 devices.pc: adjust cpu voltage and power settings 2025-12-20 22:00:12 +08:00
373e8c57ce fix bootstrap with nix store path containing /. 2025-12-20 18:20:43 +08:00
019aa5850a devices.wlin: rename 2025-12-19 17:43:18 +08:00
32babff9d5 devices.pc: mount hpc build dir 2025-12-19 17:08:42 +08:00
5f509a036e fix slurm 2025-12-19 13:11:44 +08:00
5c57f5232a downgrade slurm 2025-12-19 12:39:42 +08:00
7a7b645e9e modules.services.huggin: drop 2025-12-19 11:10:34 +08:00
3ff1802ded flake: update nixpkgs, to fix slurm 2025-12-18 21:43:28 +08:00
f7f473dac8 modules.services.peerBanHelper: drop 2025-12-18 21:34:23 +08:00
969aa0dae5 modules.services.groupshare: drop 2025-12-18 21:33:45 +08:00
ebc6307ca7 modules.services.searx: drop 2025-12-18 21:32:16 +08:00
403f4bf27f modules.services.slurm: fix 2025-12-18 19:52:15 +08:00
9188ffce9d flake: update nixpkgs 2025-12-18 19:32:02 +08:00
972155935d modules.system.gui: Start Telegram in tray on startup 2025-12-18 18:49:04 +08:00
e7d931d5c1 flake: update nixpkgs 2025-12-18 10:23:25 +08:00
43f782c44f modules.system.security: increase nofile limit 2025-12-18 09:55:51 +08:00
dd850c5984 modules.packages.desktop: add lutris 2025-12-18 09:39:38 +08:00
058aa6996d modules.services.nextcloud: upgrade to 32 2025-12-17 16:06:21 +08:00
a315cb4ef8 modules.services.gitea: fix anubis warning 2025-12-17 16:05:46 +08:00
87c0bd2e74 flake.lib.buildNixpkgsConfig: fix postgresql on cascadelake 2025-12-17 15:58:45 +08:00
c507e8d69d Revert "modules.services.postgresql: enable jit"
This reverts commit 9e66c845c1.
2025-12-17 15:56:22 +08:00
5305c9ee08 modules.packages.minimal: only enable direnv on x86_64 2025-12-17 15:40:44 +08:00
ab15e27a41 modules.packages: adjust python packages for desktop and server 2025-12-17 13:31:11 +08:00
9afb725ed1 modules.packages.minimal: disable kitty on aarch64 2025-12-17 13:28:04 +08:00
2ecad08f6e flake: update btrfs patch 2025-12-17 13:21:44 +08:00
c2c85b06f3 Revert "modules.hardware: re-enable joystick drivers"
This reverts commit 9c88a9d573.
2025-12-17 12:06:08 +08:00
9c88a9d573 modules.hardware: re-enable joystick drivers 2025-12-17 11:37:04 +08:00
06eaf9a1eb flake: update nix-cachyos-kernel 2025-12-17 11:15:58 +08:00
bbaca57ed0 flake.src: update btrfs patch 2025-12-17 11:12:39 +08:00
e92d791bc3 modules.packages.ghostty: init 2025-12-16 23:05:05 +08:00
0a5bbb14fe modules.services.tailscale: disable tailscale on aarch64 2025-12-16 17:56:59 +08:00
07c0fc44d0 flake: downgrade misskey 2025-12-16 17:14:57 +08:00
57f57e8b18 Revert "modules.services.misskey: fix"
This reverts commit 864e8c0ca6.
2025-12-16 17:13:06 +08:00
864e8c0ca6 modules.services.misskey: fix 2025-12-16 17:00:08 +08:00
838853bccf devices.nas: enable binfmt 2025-12-16 15:13:23 +08:00
4576d11bb9 flake.lib.buildNixpkgsConfig: use upstream svp 2025-12-16 14:45:32 +08:00
d5e0282abc flake: update nix-cachyos-kernel 2025-12-16 11:14:12 +08:00
9e66c845c1 modules.services.postgresql: enable jit 2025-12-16 11:13:20 +08:00
d507fcce11 flake: update misskey 2025-12-16 10:59:45 +08:00
4c8c0c8dce devices.pc: add partition 2025-12-16 10:46:50 +08:00
4e6c8562a0 flake.src: rename 2025-12-16 10:06:21 +08:00
aba0881a16 modules.services.slurm: disable X11 2025-12-15 21:33:19 +08:00
aee7d98f3c modules.packages.vscode: add nushell extension 2025-12-15 20:13:47 +08:00
65931dd1c1 flake.src: update netboot.xyz ISO sha256 2025-12-15 18:33:15 +08:00
e43c516841 flake.src: remove guix 2025-12-15 18:32:40 +08:00
cae87abde3 modules.packages.desktop: add missing desktop applications 2025-12-15 15:36:03 +08:00
7c774115f8 modules.system.gui: set niri window layout 2025-12-15 14:35:18 +08:00
09dfc1e55c modules.system.gui: add screenshot keybinding 2025-12-15 14:04:59 +08:00
ee8e980a61 Revert "modules.services.acme: fix"
This reverts commit 5a6a49ab5b.
2025-12-15 13:50:17 +08:00
db5bf6bb6a modules.services.coredns: fix 2025-12-15 13:41:14 +08:00
5a6a49ab5b modules.services.acme: fix 2025-12-15 10:38:55 +08:00
57efd0fb94 Revert "modules.services.acme: use google dns"
This reverts commit 397d8bb767.
2025-12-15 10:10:11 +08:00
397d8bb767 modules.services.acme: use google dns 2025-12-15 09:36:41 +08:00
a5fc71da87 module.system.gui: remove gtk settings 2025-12-14 23:32:25 +08:00
6c9d2555b9 flake: update nixpkgs 2025-12-14 23:22:50 +08:00
36c5799364 modules.system.kernel: fix mount fat32 2025-12-14 23:07:32 +08:00
705c24347a modules.system.gui: fix qt 2025-12-14 23:06:00 +08:00
c3670d2597 flake: set xddxdd overlay to use final 2025-12-14 20:29:31 +08:00
9d6f16ddcc devices.pc: set swap resume offset 2025-12-14 17:24:11 +08:00
e9295fea05 flake.lib.buildNixpkgsConfig: clenaup 2025-12-14 14:20:46 +08:00
592b40e73d flake.lib.buildNixpkgsConfig: remove ctranslate2 fix 2025-12-14 14:18:05 +08:00
db31934f46 flake: rewirte archive 2025-12-14 13:13:51 +08:00
73c061a350 devices.pc: add btrfs patch 2025-12-14 12:59:04 +08:00
a0cf0045df modules.system.kernel: remove unused kernel 2025-12-14 12:59:04 +08:00
a3be46d70c flake: replace chaotic with nix-cachyos-kernel 2025-12-14 12:59:04 +08:00
b973738722 flake.lib.buildNixpkgsConfig: import xddxdd overlay 2025-12-14 12:59:03 +08:00
e6d17c8ca6 modules.system.kernel: add 6.18 btrfs patch 2025-12-14 12:59:03 +08:00
f317e2db15 flake: update 2025-12-14 11:07:55 +08:00
3569aa1b9a devices.pc: disable waydroid 2025-12-14 10:12:30 +08:00
bafe32ad98 devices.pc: set cpu voltage 2025-12-13 11:52:13 +08:00
chn
959722a509 modules.user.chn: set git user name 2025-12-13 10:35:07 +08:00
chn
2a39ec4c7f devices.pc: fix coredns bind 2025-12-12 20:55:07 +08:00
chn
0c37f4c330 modules.services.xray.client: use coredns instead of dnsmasq 2025-12-12 20:33:42 +08:00
chn
d32d4398bb flake.packages: archive flake inputs 2025-12-12 20:08:19 +08:00
chn
d037f954a2 packages.sbatch-tui: cleanup unused options 2025-12-12 20:06:31 +08:00
chn
58d7b36ee3 modules.services.xray: use tailscale to visit gitea 2025-12-12 20:01:53 +08:00
chn
9de070e6be flake.dev: fix 2025-12-12 20:01:20 +08:00
chn
d5c8898db9 devices.pc: run beesd with loadAverage 4 2025-12-12 00:44:21 +08:00
chn
f3af01e6e2 devices.cross.tinc: fix 2025-12-11 14:46:42 +08:00
chn
dc22e56986 devices.pc: Update resume offset 2025-12-10 19:16:40 +08:00
chn
1d5a24807a devices.pc: disable trim for tf card 2025-12-10 15:07:31 +08:00
chn
0d2aff16a8 devices.pc: enable waydroid 2025-12-10 11:47:51 +08:00
chn
0d0fc6a75b packages.nvhpc.stdenv: fix 2025-12-08 19:49:01 +08:00
chn
61fb833ea5 packages.mumax: fix 2025-12-08 19:32:18 +08:00
chn
df52b19a1e modules.system: show more concice info 2025-12-08 17:10:57 +08:00
chn
01098e9c83 modules.system.gui: add xwayland clipboard binding 2025-12-08 16:54:01 +08:00
chn
6611f65657 flake: fix xwayland-satellite 2025-12-08 16:30:06 +08:00
chn
ac6d0fc3e1 flake.lib.buildNixpkgsConfig: fix amdgpu 2025-12-08 15:16:04 +08:00
chn
c9e7700aa6 Revert "flake.lib.buildNixpkgsConfig: fix"
This reverts commit 6c68e5348c.
2025-12-08 12:27:54 +08:00
chn
2950ac0878 devices.srv2: do not install desktop package 2025-12-08 12:20:48 +08:00
chn
6c68e5348c flake.lib.buildNixpkgsConfig: fix 2025-12-08 10:38:51 +08:00
chn
98e5e95dd3 modules.services.slurm: fix build 2025-12-08 10:36:05 +08:00
chn
fc0c9a0f20 modules.hardware.gpu: fix build 2025-12-08 10:30:57 +08:00
chn
5ebd5f0f08 modules.system.gui: enable numlock on startup 2025-12-07 16:09:44 +08:00
chn
5d654bea66 modules.system.gui: set monitor mode 2025-12-07 16:09:44 +08:00
chn
188694ef8c modules.services.harmonia: fix 2025-12-07 13:30:16 +08:00
chn
7fd61ef0cb modules.serrvices.harmonia: init 2025-12-07 12:03:50 +08:00
chn
5d3abe7b8b devices.pc: mount tf 2025-12-07 11:04:24 +08:00
chn
e09fc0e745 devices.pc: remove tf mount 2025-12-07 10:12:51 +08:00
chn
20a019d687 devices.pc: adjust cpu downvolt 2025-12-06 20:17:58 +08:00
chn
354543db24 modules.system.gui: add keybinding to move workspace to next monitor 2025-12-06 15:09:07 +08:00
chn
6a1f8f4278 modules.system.kernel: remove unnecessary workaround 2025-12-06 10:02:58 +08:00
chn
31999eada5 Revert "devices.pc: fix ollama rocm gpu support"
This reverts commit af3750fa8b.
2025-12-05 22:49:34 +08:00
chn
af3750fa8b devices.pc: fix ollama rocm gpu support 2025-12-05 22:32:52 +08:00
chn
faaff1cc61 packages.sbatch-tui: remove "All" memory option 2025-12-05 15:09:24 +08:00
chn
cb6b13638c flake.lib.buildNixpkgsConfig: fix build 2025-12-05 14:27:50 +08:00
chn
f03d4c366b modules.packages.yazi: add keymap for ghostty 2025-12-05 10:58:53 +08:00
chn
c12842ea3c fix kernel 6.18 build 2025-12-05 09:36:28 +08:00
chn
bf29b9d756 flake: update 2025-12-05 09:09:00 +08:00
chn
e1c47cb73e modules.services.photoprism: drop 2025-12-05 01:34:00 +08:00
chn
e296f09a77 packages: drop unused function 2025-12-05 01:31:36 +08:00
chn
18e18ebc24 flake.lib: drop unused function 2025-12-05 01:31:31 +08:00
chn
5d54c09cb0 flake.lib.buildNixpkgsConfig: fix build 2025-12-05 01:26:55 +08:00
chn
bae5f8128d Merge branch 'production' into next 2025-12-04 22:03:29 +08:00
chn
9d52c21faf modules.packages.desktop: fix paraview 2025-12-04 21:54:06 +08:00
chn
b8e1ed7078 flake.lib.buildNixpkgsConfig: fix build 2025-12-04 21:15:49 +08:00
chn
1db32b29a2 modules.services.xray: remove xmuClient, xmuPersist, xmuServer 2025-12-04 20:35:23 +08:00
chn
37ba4f34e7 flake: fix build 2025-12-04 20:20:54 +08:00
chn
56d605f909 Merge branch 'production' into next 2025-12-04 19:31:45 +08:00
chn
4c66ea44d0 module.system.gui: drop kde support 2025-12-04 19:30:38 +08:00
chn
f83e3a9599 flake.lib.buildNixpkgsConfig: fix build 2025-12-04 18:58:48 +08:00
chn
ec1f9d7796 modules.packages.yazi: init 2025-12-04 17:27:31 +08:00
chn
bd8d336215 modules.system.gui: add lockscreen shortcut 2025-12-04 11:39:58 +08:00
chn
bbca1b88d6 modules.system.gui: fix niri output 2025-12-04 10:38:01 +08:00
chn
f29e305dac modules.system.gui: fix niri touchpad 2025-12-03 09:29:15 +08:00
chn
e74b8a4540 modules.packages.desktop: set typora flags 2025-12-02 22:29:59 +08:00
chn
60bd4d124c flake.lib.buildNixpkgsConfig: comment out fixes 2025-12-02 19:37:14 +08:00
chn
115d215203 modules.system.gui: fix 2025-12-02 15:10:13 +08:00
chn
cb9f11f184 modules.system.kernel: drop hibernate-progress patch 2025-12-02 14:49:40 +08:00
chn
84f96aa489 devices.pc: lower beesd loadavg 2025-12-02 12:13:26 +08:00
chn
0e4d718c41 devices.pc: remove harmful/useless udev rules 2025-12-02 11:34:22 +08:00
chn
e135d6bcd6 modules.system.gui: fix niri 2025-12-02 10:28:10 +08:00
chn
dba82d6fb1 modules.system.gui: fix 2025-12-01 23:36:18 +08:00
chn
80431046a9 modules.packages: move kitty and ghostty to minimal 2025-12-01 23:27:44 +08:00
chn
ad5ae4e374 modules.packages.desktop: add ghostty 2025-12-01 23:11:20 +08:00
chn
8f538040e1 modules.system.gui: add niri mouse wheel bindings for column focus 2025-12-01 23:00:42 +08:00
chn
475e245bec modules.system.gui: fix 2025-12-01 17:15:26 +08:00
chn
4e659c10a8 modules.system.gui: fix niri 2025-12-01 16:52:50 +08:00
chn
f4fa1a80ef modules.system.gui: fix xdg-desktop-portal-gnome 2025-12-01 16:41:01 +08:00
chn
2ba6dc5b2e flake: set aagl version 2025-12-01 16:22:56 +08:00
chn
90a3e94060 modules.services.preload: drop 2025-12-01 16:20:14 +08:00
chn
f8a641615d flake: update 2025-12-01 15:49:04 +08:00
chn
18202905a0 flake: set nixpkgs to another branch 2025-12-01 15:24:06 +08:00
chn
22a8ce2c62 modules.system: disable fstrim 2025-12-01 15:11:08 +08:00
chn
c49b6dee8f Revert "flake: update niri"
This reverts commit 4815bd0236.
2025-11-30 12:22:54 +08:00
chn
4815bd0236 flake: update niri 2025-11-30 12:15:46 +08:00
chn
19e568052f module.system.gui: fix niri 2025-11-30 11:52:23 +08:00
chn
8af3fb18eb devices.pc: switch to cachyos kernel 2025-11-29 07:14:39 +08:00
chn
164f250860 modules.system.fileSystems.impermanence: persist .local 2025-11-29 06:43:21 +08:00
chn
d5ece0aec5 modules.system.gui: fix 2025-11-29 06:29:32 +08:00
chn
16d882b022 flake: update niri 2025-11-28 21:32:11 +08:00
chn
78461b199f module.system.gui: niri use gnome keyring 2025-11-28 12:33:38 +08:00
chn
4306244d81 modules.system.gui: change default GUI implementation to niri 2025-11-28 10:06:18 +08:00
chn
2cf730b48f devices.pc: use lts kernel as default 2025-11-28 10:04:33 +08:00
chn
21beab6252 modules.user.chn.plasma.autostart: remove autostart entries, will be handled by niri 2025-11-27 23:40:57 +08:00
chn
ad8711c2f4 devices.srv1-node0: remove unused packages 2025-11-27 16:51:27 +08:00
chn
eb32b0c72c devices.srv1: disable samba 2025-11-27 16:50:15 +08:00
chn
4e2354c202 modules.services.xrdp: drop, since plasma will not support it 2025-11-27 16:49:27 +08:00
chn
ef592ca014 Revert "devices.nas: disable store ro protect"
This reverts commit 840eb7c09c.
2025-11-27 08:42:45 +08:00
chn
b1cfc26648 devices.pc: switch to cachyos kernel and add lts variant 2025-11-25 20:43:56 +08:00
chn
bdf56d01cc modules.system.fileSystems.rollingRootfs: fix compatibility with impermanence 2025-11-25 20:40:28 +08:00
chn
b03d8cfa06 devices.pc: add tf2 decrypt 2025-11-25 14:14:34 +08:00
chn
715b15f9a5 modules.packages.desktop: disable lact 2025-11-25 14:12:00 +08:00
chn
b10e890aa4 modules.hardware.asus: disable rog-control-center autoStart 2025-11-25 13:36:34 +08:00
chn
01f46ccc6a modules.packages.desktop: disable coolercontrol 2025-11-25 13:22:11 +08:00
chn
ac6c528eba devices.pc: disable xmunet iwlwifi bug patches 2025-11-25 13:20:43 +08:00
chn
ac60d7cd7f devices.pc: remove user xly 2025-11-25 13:20:30 +08:00
chn
13ee2e6c7d devices.pc: disable lumerical 2025-11-25 13:20:30 +08:00
chn
8b102a87ef devices.pc: disable misskey 2025-11-25 13:19:02 +08:00
chn
d2145b713b devices.pc: switch to lts kernel, enable btrfs patch 2025-11-25 13:18:35 +08:00
chn
1e3f630aa9 flake: remove linux-asus patch 2025-11-25 13:17:16 +08:00
chn
8685cfd3b2 modules.system.nix: set build dir for new nix version 2025-11-25 10:10:48 +08:00
chn
64d691ba54 devices.pc: mark tf card reader as non-removable device 2025-11-24 11:53:37 +08:00
chn
cf479ec30d modules.system.kernel: add sdhci_pci for tf card support on pc 2025-11-24 11:39:20 +08:00
chn
b2a7dfadd3 modules.services.preload: init 2025-11-24 11:29:35 +08:00
chn
5a02aaa27a devices.pc: add tf card 2025-11-24 11:26:44 +08:00
chn
56ca103c46 modules.system.kernel: add patch asus 2025-11-23 18:18:32 +08:00
chn
0bea81e0e1 modules.services.howdy: init 2025-11-23 09:39:13 +08:00
chn
4984093a1f modules.services.keyd: add keyd to systemPackages 2025-11-22 23:47:56 +08:00
chn
2a7865fcbd modules.services.keyd: map 'prog4' to 'sysrq' key 2025-11-22 23:47:42 +08:00
chn
64f658473a devices.pc: remove niri specialisation 2025-11-22 21:16:35 +08:00
chn
4fafc47e38 devices.pc: switch to xanmod kernel 2025-11-22 15:26:17 +08:00
chn
49c57b6ff7 devices.pc: xanmod specialisation switch to last kernel 2025-11-22 14:52:04 +08:00
chn
84bfd59173 devices.cross.tinc: disable auto connection and disable host data exchange 2025-11-22 11:29:05 +08:00
chn
5bea46c07f update nixos-wallpaper 2025-11-22 10:41:46 +08:00
chn
52c4b028f0 flake.lib.buildNixpkgsConfig: fix numpy 2025-11-22 09:25:59 +08:00
chn
9be88b4d4d Revert "fix numpy"
This reverts commit 5fbda61b60.
2025-11-22 09:19:04 +08:00
chn
d016e5846c devices.pc: set cpu voltage 2025-11-22 09:16:01 +08:00
chn
5fbda61b60 fix numpy 2025-11-21 20:03:47 +08:00
130 changed files with 2161 additions and 2383 deletions

1
.gitattributes vendored
View File

@@ -1 +0,0 @@
flake/branch.nix merge=ours

6
.gitmodules vendored Normal file
View File

@@ -0,0 +1,6 @@
[submodule "nixpkgs"]
path = nixpkgs
url = https://github.com/CHN-beta/nixpkgs.git
[submodule "packages/ufo"]
path = packages/ufo
url = https://git.chn.moe/chn/ufo.git

View File

@@ -24,3 +24,9 @@ An overlay is provided through `outputs.overlays.default`, you could use it in y
}
```
## TODO
* Write this readme file. Something have been outdate.
* Servers in XMU should use vps9 to run proxy.
* Allow to specify oneapiArch and nvhpcArch per package.
* Update document. Something is outdate.

View File

@@ -164,6 +164,8 @@ in
Proxy = inputs.lib.mkIf (inputs.config.nixos.services.xray.client != null) "socks5 127.0.0.1 10885";
ConnectTo = builtins.map tincHostname (builtins.attrNames
(inputs.lib.filterAttrs (n: v: (v.address or null != null) && (v.jump or null == n)) connection.${hostname}));
AutoConnect = false;
TunnelServer = true;
};
ed25519PrivateKeyFile = inputs.config.nixos.system.sops.secrets."tinc".path;
hostSettings = inputs.lib.mkMerge
@@ -181,7 +183,13 @@ in
{
addresses = inputs.lib.optionals (v.address != null) [{ inherit (v) address; }];
settings = { Ed25519PublicKey = publicKey.${v.jump}; IndirectData = true; };
subnets = [{ address = getAddress "tinc0.${n}"; weight = v.length; }];
subnets =
[{
address = getAddress "tinc0.${n}";
# 最短路径已经被提前计算出来了,这里将权重统一设置为零
# 如果分开设置,两个节点会因为对权重的描述不统一而拒绝连接
weight = 0;
}];
};})
(inputs.lib.filterAttrs (_: v: v != null) connection.${hostname})))
];

View File

@@ -15,10 +15,11 @@ let
mkdir -p $out/bin
ln -s ${python}/bin/python3 $out/bin/python-lyj
'';
in pkgs.symlinkJoin
{
name = "jykang";
paths = with pkgs; [ gnuplot localPackages.vaspkit pv python-lyj sqlite ];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs; };
}
jykang = pkgs.symlinkJoin
{
name = "jykang";
paths = with pkgs; [ gnuplot localPackages.vaspkit pv python-lyj sqlite ];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs; archive = pkgs.closureInfo { rootPaths = [ jykang.drvPath ]; }; };
};
in jykang

View File

@@ -12,6 +12,7 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBoDGk9HYphkngx2Ix/vef2ZntdVNK1kbS9pY8+TzI41
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJi6O1Sf1BBV1dYyH1jcHiws+ntwVfV29+6Paq1CQaET hss
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFlBxisj3sU9QC8UC5gX6sakf7G03ybbkmHtD2cybuZA qmx
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAWU/OlrP8bJ5k7IqpIwUC1COuVsmrYVreW/ieEdPYdj ccy
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXkM8TS8fDot22LTfU2jDVOqK20LmK8Rd7xO05vYns stq
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

@@ -29,23 +29,18 @@ inputs:
network.settings.static.enp3s0 =
{ ip = "192.168.1.2"; mask = 24; gateway = "192.168.1.1"; dns = "192.168.1.1"; };
kernel.patches = [ "btrfs" ];
binfmt = {};
};
hardware.gpu.type = "intel";
services =
{
sshd = {};
xray =
xray.client =
{
client =
{
xray.serverName = "xserver2.vps9.chn.moe";
dnsmasq = { extraInterfaces = [ "enp3s0" ]; hosts."git.chn.moe" = "127.0.0.1"; };
};
xmuServer = {};
server.serverName = "xservernas.chn.moe";
xray.serverName = "xserver2.vps9.chn.moe";
coredns = { extraInterfaces = [ "enp3s0" ]; hosts."git.chn.moe" = "127.0.0.1"; };
};
beesd."/".hashTableSizeMB = 10 * 128;
nix-serve.hostname = "nix-store.nas.chn.moe";
postgresql.mountFrom = "ssd";
mariadb.mountFrom = "ssd";
rsshub = {};
@@ -57,7 +52,6 @@ inputs:
matrix = { port = 8009; redisPort = 6380; };
};
vaultwarden = {};
photoprism = {};
nextcloud = {};
freshrss = {};
send = {};
@@ -73,6 +67,5 @@ inputs:
};
systemd.tmpfiles.rules =
[ "w /sys/class/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw - - - - 10000000" ];
boot.nixStoreMountOpts = [ "nodev" "nosuid" ];
};
}

View File

@@ -1,11 +1,5 @@
xray-client:
uuid: ENC[AES256_GCM,data:97aX07G5FPumdWcDxnYOs6fRgljXWuwyNXGg1d7zdbUUfNnb,iv:+wAC/DZXsg+evYFA4DMfLw5Ut3ExQl1RgZ/2AsNQDpo=,tag:ebD77muITHof+FQMydWobg==,type:str]
xray-xmu-server: ENC[AES256_GCM,data:3O5rFi5szla70M/c62JV4nGWKPSOREImrOucjeVYf9bde6K8,iv:PGCqlmHtaNuWOtAAeJ6O+CWFpMszijozU1OpUFrftjs=,tag:iGTOoNvQhhZy2FL9jy1KIQ==,type:str]
xray-server:
clients:
#ENC[AES256_GCM,data:gToh4rgMOQ==,iv:A14sSC7ExbSZNOzzz6mOmWalSz9K6ROoSYgCqdF7j4U=,tag:1Jr2FfVQ9L2w+bWHh/NekQ==,type:comment]
user4: ENC[AES256_GCM,data:/ZrgvlpwDlKhcHqkBRsdqqJsNUxtb3ZnC36mc8qlJ+HP4mY3,iv:R5QzXY0mC72TDB0OcF4fJt3bc5L1Z96Q+n9kNbZP7m4=,tag:tjWSEcsG0udvQZZJ/RMTJw==,type:str]
private-key: ENC[AES256_GCM,data:34FOslwr3AZNDg4YrS95S20agGXwGJRNGnpogMR7utbt1ELUxfQkiAU1qw==,iv:4fiJCi6TJM+NIlfI1qFX/eCNhcVaCWGsLA7iMjQpATw=,tag:eLz8HlQMprQNryk5saqyVQ==,type:str]
store:
signingKey: ENC[AES256_GCM,data:zr02XBgQ4H5jRnjpLtp9rjcysXP9qI7McOiBwaWhdylu5GevKmxlCd4h3pEUO74k+gJT88BzJ+S59P+6DS76Y5nlKqextGMzGjdq5XPkdDkSkKZBai2kkqBSyko=,iv:hyhroaDazMLFeLMGruiFeokZ2Tz3xKj+xCsiEUJ5faQ=,tag:w3805eqo6Y1pw65mjoRgOg==,type:str]
nginx:
@@ -59,11 +53,8 @@ vaultwarden:
#ENC[AES256_GCM,data:wbKsGwBKrJYagX1AvY0o5FHXxOhrfjZ/+crasAh52uOFYGd0P8A7NnyF6JvNgH749dAT9H47DXRKBAclVVSqWPc=,iv:TZgJ7pwyGBpf7S4g7CL2dync2sGNzQ9369atAvLwFJ8=,tag:sxtkPHOmrjUb13zeWPBdng==,type:comment]
admin_token: ENC[AES256_GCM,data:TrgqQwXBoCdsLeWQYkur4zS+Z4nCoDDoePnN5vm+AIcgYXVwjxcf/0AwXQIxVNEypYysPpoHKOigwhkf5kLazAMiBZ0goAflJT/S4nOLo90s+9kDCADXWnCeHNhBUg8fUulNPBbpqdfFKCJgJCD2WTI+V5yFLQ==,iv:maKU6pcxis7Cyrx9x26cUTBzA6ZKcKJWSP23w+MDehw=,tag:GYpPHp2slC6V8aKA1FHFAg==,type:str]
mariadb:
photoprism: ENC[AES256_GCM,data:h7TQh5ScGM30e42VSEg6AynwRUPHMRHddJcJotQtDbkFVgmfjHmAHTY22U5jWqjq4KXPN5ItRETLOMw9k9yOgg==,iv:jFTPaXortmiU+8m/NBTYjAXRXHCpD+UE5oeveH7/znk=,tag:3OOUUyHLQJROh5rZcX8bAg==,type:str]
freshrss: ENC[AES256_GCM,data:Qjg5GIX13ccZi/DuqtWK0qzr2GK0GzzUdEZWXDhUhGxFWzgosADxDCc8wfOchItaJFefnVrpPxdAPvT+4TEH0g==,iv:oGii3o6sJYVc11kdQMh0Pa3GUbWqttFgjvSVEbTycZc=,tag:8GWWwuJjQBwDFl9pJvg90g==,type:str]
huginn: ENC[AES256_GCM,data:/hFQdG/RGrX75qd0+WgwhnwR7p/CEVx1vPksRSudxmc1m4VO/AVzgMCWAz4310ctTEnn4GZinvD6QGFta5IOSA==,iv:mrPDZA6Bnw+SPVDDe64tivvvQtHWvCsPJbEnPqm12g4=,tag:ihXbIJwwtQ0RfaNfcaop4Q==,type:str]
photoprism:
adminPassword: ENC[AES256_GCM,data:QXrDNGSKdRZxc4mfwIhR5cmmmJysGV3cThSFlng3mEviaq0p+BvOa5Thtgw0CxQXdpgjrkui+837NJ/FxPUYvg==,iv:EkutxeDDWfSOVD9p1Ari/rkgf7EwTutDymZQ1uNm6FA=,tag:r3gXuefnIQ+5pPtGZajnZg==,type:str]
nextcloud:
admin: ENC[AES256_GCM,data:DJK+u19VP9cFvq4/P0+f7erXxZkRWI4NRrX9HdHO96xy9wZMtB+hEDN3zLQnkTTtmd2ZLs9+c9BsUNXZperGDQ==,iv:zX8Nxt5+O/mGVt5l1j8IojBkgxg5oDae6KWTXYz0hRE=,tag:MRyMx0OXYTCmtaySP/umNw==,type:str]
freshrss:
@@ -99,7 +90,7 @@ sops:
by9Rd0U0bzNiK21BQTNxN1RuQ09DQVkKJmSlzV5ppEkZFljsS17ZWmoI++fz4tJh
kTdoAStG1zsKASHyZTsmdm3RBDO3qV1KhQC2gC7d4EiwNZngxOOZJg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-10-12T08:53:54Z"
mac: ENC[AES256_GCM,data:BmUcsv1AFkmIYdrYsYcjZExdyIfbAK+RHeIgaHvvgaGNxl3LxaS04CIwTB7HKA2vl87V+1Z2I/pGdEgE+KcUxl1RaRhGDTjkJeoxubSnwnhPb7B1WAb18MXXD5LiMUZzoGoMcqRTbkBIX9JJHcrdiKuSiXuyn6HbP/9g50unr2w=,iv:XMWqHOtodBX8UvPfGhoSt08gbacabzEJ59r4qrPOx2s=,tag:/dEIE5lMG1J54cIVB2Impg==,type:str]
lastmodified: "2025-12-04T17:33:50Z"
mac: ENC[AES256_GCM,data:MjCnibcdkR927418wAlPUj5IXfbCQMS4QQOKvWRHdqqZHBQFw886Nx8YOXvH2PTgAhDWjzhuhnkF3InaY63zYqamJcKKwp/aIjZ97UXNKsZPKaVo48S9rBuHPFI/NceDSoMPZvgrMhgNguegdc6B8D2fwJPdtdSa6pJez1WQ9r8=,iv:kZnVRglmmWkR7f80bCX9Y5Th3dNI8TtUxx6P40d7E1o=,tag:5L0bfCYJq/EpvaT8BJA2QQ==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2
version: 3.11.0

View File

@@ -12,11 +12,27 @@ inputs:
mount =
{
vfat."/dev/disk/by-partlabel/pc-boot" = "/boot";
btrfs."/dev/mapper/root1" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
btrfs =
{
"/dev/mapper/root1" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
"/dev/mapper/tf1" =
{
"/" = "/nix/tf";
"/nix/remote/jykang" = "/data/gpfs01/jykang/.nix";
"/nix/remote/xmuhk" = "/public/home/xmuhk/.nix";
"/nix/remote/wlin" = "/data/gpfs01/wlin/.nix";
};
};
nfs."nas.ts.chn.moe:/" = { mountPoint = "/nix/remote/nas"; mountBeforeSwitch = false; };
};
luks.auto =
{
"/dev/disk/by-partlabel/pc-root1" = { mapper = "root1"; ssd = true; };
"/dev/disk/by-partlabel/pc-tf1".mapper = "tf1";
"/dev/disk/by-partlabel/pc-tf2" = { mapper = "tf2"; ssd = true; };
};
luks.auto."/dev/disk/by-partlabel/pc-root1" = { mapper = "root1"; ssd = true; };
swap = [ "/nix/swap/swap" ];
resume = { device = "/dev/mapper/root1"; offset = 131605760; };
resume = { device = "/dev/mapper/root1"; offset = 156901642; };
};
grub.windowsEntries."08D3-10DE" = "Windows";
nix.marches =
@@ -34,7 +50,7 @@ inputs:
];
nixpkgs = { march = "znver5"; rocm = true; };
sysctl.laptop-mode = 5;
kernel.variant = "cachyos";
kernel = { variant = "cachyos"; patches = [ "btrfs" ]; };
};
hardware = { gpu.type = "amd"; asus = {};};
services =
@@ -51,7 +67,7 @@ inputs:
};
};
sshd = {};
xray.client.dnsmasq =
xray.client.coredns =
{
hosts = builtins.listToAttrs
(
@@ -59,11 +75,14 @@ inputs:
(name: { inherit name; value = "144.34.225.59"; })
[ "mirism.one" "beta.mirism.one" "ng01.mirism.one" "initrd.vps6.chn.moe" ])
);
extraInterfaces = [ "wlo1" ];
extraInterfaces = [ "wlp194s0" ];
};
harmonia.store = "/nix/tf";
beesd =
{
"/" = { hashTableSizeMB = 2 * 128; loadAverage = 4; };
"/nix/tf" = { hashTableSizeMB = 128; loadAverage = 4; };
};
nix-serve = {};
misskey.instances.misskey.hostname = "xn--qbtm095lrg0bfka60z.chn.moe";
beesd."/" = { hashTableSizeMB = 4 * 128; threads = 4; };
slurm =
{
enable = true;
@@ -83,12 +102,13 @@ inputs:
keyd = {};
kvm = {};
mariadb.mountFrom = "nodatacow";
lumericalLicenseManager.macAddress = "10:5f:ad:10:3e:ca";
open-webui.ollamaHost = "127.0.0.1";
howdy = {};
postgresql.enable = true;
};
bugs = [ "xmunet" "amdpstate" "iwlwifi" ];
packages = { mathematica = {}; vasp = {}; lumerical = {}; };
user.users = [ "chn" "xly" "lilydjwg" ];
bugs = [ "amdpstate" ];
packages = { mathematica = {}; vasp = {}; };
user.users = [ "chn" "lilydjwg" ];
};
# 允许kvm读取物理硬盘
users.users.qemu-libvirtd.extraGroups = [ "disk" ];
@@ -98,14 +118,14 @@ inputs:
#
ACTION=="add", ATTR{power/wakeup}="disabled"
# CPU
SUBSYSTEM=="power_supply", KERNEL=="BAT0", ACTION=="*", RUN+="${inputs.pkgs.ryzenadj}/bin/ryzenadj --set-coall=0x0fff00"
SUBSYSTEM=="power_supply", KERNEL=="BAT0", ACTION=="*", RUN+="${inputs.pkgs.ryzenadj}/bin/ryzenadj --set-coall=0x0fff40"
'';
# 解决有时蓝牙不能使用的问题
boot.kernelParams = [ "mt7925e.disable_aspm=1" ];
specialisation =
{
niri.configuration.nixos.system.gui.implementation = "niri";
xanmod.configuration.nixos.system.kernel.variant = inputs.lib.mkForce "xanmod-lts";
};
boot.kernelParams =
[
# 解决有时蓝牙不能使用的问题
"mt7925e.disable_aspm=1"
# 插拔电源和扩展坞不要唤醒电脑
"acpi.ec_no_wakeup=1"
];
};
}

View File

@@ -10,11 +10,6 @@ mariadb:
slurm: ENC[AES256_GCM,data:fGvNMmqk7Cee28VJ1QoBVrBbgIUbj/F1W0SRjdP8N4K/M8Wx4AVm1kAr0IAhPWyDLXlIjM1NUvuEV5BpYDBdjg==,iv:rFTMJ4x2kgENQUA8ftSaLjdOc25i5mWR3UYbdq54vjs=,tag:6feD0eCSv7bcHWBveLNJwg==,type:str]
nix:
remote: ENC[AES256_GCM,data:uosYkxTCB0wiY+Uufk//OcBZFN3EzbZoQGZ95M9eZMjQ5AobAZqosi4laE+EMcZL1CqYqlWXaSoEUOB8biUaZPseo+1AX1TlmUgZ7QpkfOX0VKZu01C6C+lVyqVqMFq6z1BFyX/oeITMIfnd4a/2KwJCHLAZ4hMkJ5p+aJwByKGa3N/2m41HH/1S3z7pYQWj7YJxunTPPG6WNSiRncQki11rvmddwnXmsBF89+jW1Phge8U295haC57T5oIGPxR645IeTK4ZUlL8eVuZ+BhsnwbkYcaxvjSwe+DOIVPupR8GW+gis7KxwE89kqvnQhinamexcPUz4lGHlqO/Xn6jrJx6T/wXF+19epAzeHapYte3dTWNsdPwPLPJihT16YT5fwrLnH3zq8kexWz1crmnCGUoaBs4S2tHWHLgv2lTv0IHLx5F6ijpDBj/Avg9YILIURzdeea+rBxdycHasUDTVlJtYKRH5J+WbAKWI+oJ5qmXjIRUYL+O9xIUfOGO+1b3xs8MYxRWuvDV2P88N8vN,iv:yQQp5wjbSVn1oia5yL7d6GF9Vo704G0iOQRGMbzQHzg=,tag:bpBag5y5n+7ojOa8QOcDvA==,type:str]
searx:
secret-key: ENC[AES256_GCM,data:KhIP+Rz3rMfNgPEGTlKGvm6gl1/ZuPI=,iv:GcaLEJHKJO3n6IaeiFr9PaJ6eNx04/VjX3UgmBF429g=,tag:HkplyH9hTHUaEZ709TyitA==,type:str]
xray-xmu-client:
uuid: ENC[AES256_GCM,data:XiUkReTJLAxZNWFVeD6EiOtUX5tsyPLFi6QyDBdHyB4v5/mD,iv:QppdtP2CFDEVhlrmDJKYBGc1zYGJvpGYxLfsBAMxDSI=,tag:jzMSFRit+aBzWMkaa3+5hA==,type:str]
cookie: ENC[AES256_GCM,data:0jqSEZloX2/c8Zg4WTKkLw==,iv:BKLm1KMoRrH0uO6hPMsv2a7sG0AwNRrdbpmABP4BszA=,tag:pBs+rQIhhNO4Qr6q1V3MUA==,type:str]
tinc: ENC[AES256_GCM,data:qI2KAyJiC9m+IOzTQ7SFjWnjzzkxvNe6R2yxyK+C/YnEK4JdYqEETIMuqAUQxaSyHjKk9x6kDs3YPC2AyNKf+lc22YoB35Eo5ym+3+GDDPTL4wL4aI4xnGHVLH3JrSFHDyIbvu8R2NLnSy2j4O5Uj+jJmOz/b1xV8zeLbdoFwLgZCbcxvqkIwMlJdDGjAtjEb8eDkjtVzSRSPXohgYgmhxKZyA5/7c41e+/X6RIsHHeOD+Ppz5jlYAkRrsvAxGTfrMN2xTZopxc=,iv:E/8ys6ucmmaKawqrgumJdjTsC17F7Y0RgnHYfu3RIPQ=,tag:OZM/HG88gyF9TZXwHcd3nA==,type:str]
open-webui:
openai: ENC[AES256_GCM,data:8CQLvoDuGtQ7PN+1SOmXF48dV/G6fDOiu6olkhSbWEjYcNO4VVmxtHw=,iv:rKBxOTB7/LXfXWVrBFBJeyn43R82oBYCxup8OzWvzKk=,tag:ByoyMizWc9Lpnt+ciYcszg==,type:str]
@@ -39,7 +34,7 @@ sops:
OUlxNjdQaXdXMkZ6bnV1ek4yZ2dpbkEKpKGOAxo5Eef2jtGrg4iSzmGCeg+vTgvu
+K8b+O19MIkGMDBm6UbYUPtc/7eqoEZRiTUzNMTmfkLVS4ul5zou9A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-11-06T12:37:57Z"
mac: ENC[AES256_GCM,data:7iy/orIRUCtFhTaHdskIYu7b9a3uqM4xz+2hRSAvJ7HeKEWFcgCOhE8t5jPkXTi8gMciw/I60015k+GF/mY7cK2Sa/HiWptGwhKAr1jNF4LgJN13eG+7HLQ7Y2SopAzVV2+j0Sit7gsg8x+a1hR/Xi6OBu8ecjyW//Rcelj/Lwc=,iv:F82F+w7BRO3ubZjzV2TU4d0pqbf9d6gUAEZ5YOzEQ1M=,tag:TKMi/mHSqtVv+kvhRbRxmQ==,type:str]
lastmodified: "2025-12-18T13:32:13Z"
mac: ENC[AES256_GCM,data:iGNeV1hyiuhmLApu9o0IA75+oNJPp5I9ehTEdcVIyNQfKLeUbzcxz3tiKQNxxDy15vjtpBb/SicgSF60i6k54Y7KRRFadlRQ6erqZRj/6XlLqGwW0EKxN1EEEG9QNqMt6smA0WsdaoInmWWalaC14P55toU6LKbL05hSfSwtbXo=,iv:WEMF3u/8LwlIG5tAf25mM5IX7KHHXNpuhDxVzIAmZmU=,tag:PJc4r6b8ppQg/rcXsoDDpA==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2
version: 3.11.0

View File

@@ -19,19 +19,7 @@ inputs:
trust = [ "eno146" ];
};
};
services =
{
sshd.motd = true;
beesd."/" = { hashTableSizeMB = 128; threads = 4; };
xrdp = { enable = true; hostname = [ "srv1.chn.moe" ]; };
samba = { hostsAllowed = ""; shares = { home.path = "/home"; root.path = "/"; }; };
};
packages =
{
desktop = {};
packages._prebuildPackages =
[ inputs.topInputs.self.nixosConfigurations.srv1-node1.pkgs.localPackages.vasp.intel ];
};
services = { sshd.motd = true; beesd."/" = { hashTableSizeMB = 128; threads = 4; }; };
};
};
}

View File

@@ -12,7 +12,6 @@ inputs:
vfat."/dev/disk/by-partlabel/${clusterName}-${nodeName}-boot" = "/boot";
btrfs."/dev/disk/by-partlabel/${clusterName}-${nodeName}-root1" =
{ "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
nfs."nas.ts.chn.moe:/" = { mountPoint = "/nix/remote/nas"; neededForBoot = false; };
};
nixpkgs.cuda.capabilities =
[
@@ -87,7 +86,7 @@ inputs:
};
xray.client.xray.serverName = "xserver2.vps9.chn.moe";
};
packages = { vasp = {}; desktop = {}; lumerical = {}; };
packages = { vasp = {}; lumerical = {}; };
user.users =
[
# 组内
@@ -102,6 +101,7 @@ inputs:
"ccy" # 陈超业
"twr" # 唐文睿,吴猛的学生
"lsp" # 李书平的不知道哪个学生要用
"stq" # 孙天骐
];
};
};

View File

@@ -9,16 +9,7 @@ inputs:
nixpkgs.march = "icelake-server";
network.settings =
{ static.eno8303 = { ip = "192.168.178.3"; mask = 24; gateway = "192.168.178.1"; }; trust = [ "eno8303" ]; };
fileSystems =
{
swap = [ "/nix/swap/swap" ];
mount.btrfs."/dev/disk/by-partlabel/srv2-node2-root1" =
{
"/nix/remote/jykang.xmuhpc" = "/data/gpfs01/jykang/.nix";
"/nix/remote/xmuhk" = "/public/home/xmuhk/.nix";
"/nix/remote/wlin" = "/data/gpfs01/wlin/.nix";
};
};
fileSystems.swap = [ "/nix/swap/swap" ];
};
services =
{

View File

@@ -25,7 +25,7 @@ inputs:
services =
{
sshd = {};
xray = { server = {}; xmuPersist = {}; };
xray.server = {};
nginx =
{
streamProxy.map =
@@ -61,6 +61,7 @@ inputs:
beesd."/" = {};
coredns.interface = "ens18";
headscale = {};
missgram = {};
};
};
networking.nftables.tables.forward =

View File

@@ -2,11 +2,13 @@ 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]
xray-xmu-client:
cookie: ENC[AES256_GCM,data:RZ2WFnsX7s/PVqA7ZKhGqw==,iv:CknFoAcHIiIwJI1IEXkFdWXcOCAZr50pfwmQN72OI8o=,tag:w2pNU1APxlSQsGMIEdE2OA==,type:str]
tinc: ENC[AES256_GCM,data:E3OrPA67R48x5FJUW0ZbERlclz8Z/XokAaGTeBQLPEHSeqEArHYSZkdJRZejFrBruJPlGZMPNBQzlIBXOfXKwMnlBDaGJIIJHIzPDGG9W7QF4IIRK/BjVZHFwfKvZtbUDGsqLcCSe5+ttmyucBaFGquXhnD/Tu09uyWtRvS10KAJLY0Z2/16CFB1+8egJIcYw2TFXObo+KR92Va0qwiDSepKaJtYLimDGRKk04QGj+BYa5y8PjIG6bz8UG82mmCiV7XM3EPlSMA=,iv:kawsklNGFbRhxKuUwvNL2WyBxuYu2T/uks1cJ4i8NhA=,tag:V+jAaxQX7JCiR5+wIVW4Nw==,type:str]
postgresql:
headscale: ENC[AES256_GCM,data:z2cyyT1TcIhNJCBeGn072aFI2nAioWZQvpyzoky4tWtMymKlw4ilOtSYAsp+kaNOoqvWSmoAQNJLNzeDk1iTCQ==,iv:hZdS/CAVBO0k/AmX3qw3YwTYgK49Aeu5QI3YCAduiZ0=,tag:2l4GPV/T2GHjAAUDX3LaEA==,type:str]
missgram: ENC[AES256_GCM,data:zUY6397ThfeHDD8/Msy3mWnTjXCkEhpgsUwcjXnhIiNET1J14hIojCbwUpdCtGTFF+RQOtaS9aGSp8ctQeWIwg==,iv:0+WeCoMFQFhnzjSfvz0ZnqK6FIn1QBHr9fB+tjBNSDk=,tag:Bf5krX2hxIPlkdiAXppSqA==,type:str]
missgram:
secret: ENC[AES256_GCM,data:qsxJue8mGAJejSxOoPd4MXD06upnk0fxUM5EKPBs/WI=,iv:HaHj/vJkIERUQ0Lr93s9kaApNWPjDcpLu2897qmCjqA=,tag:u73jUDd6pGKk1yir/oF4hQ==,type:str]
telegramBotToken: ENC[AES256_GCM,data:kNGhj1SjyK1H8NJmJLi90cpGtWmmGpFEFFT/JkDX4QqxbOC6BfFIMgzVsZ5GVQ==,iv:sccRmCs8HBAvi9mDAaz8OjxqXLAVXepJHaj7RrUt6kI=,tag:RuK3EdRMVhS9pVDw50lW6A==,type:str]
sops:
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
@@ -27,7 +29,7 @@ sops:
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-11-16T03:45:41Z"
mac: ENC[AES256_GCM,data:AnvNGraWYOKZHtmI73wWerrFRNjAlZdcVSPXDsv+x/0Dohq+9KB/PoWoczXQTUy240BDErXp7UrNmNgwyGtUofdQvJqmdJ2vFkTW0VIWJ1Alq489nafdanGwn97P/aluHqF+zhgBCANAGwIVLaEAggR/xCdidcyn01taHpKoVfE=,iv:frCptbX5gtEmjL7XfCIRaB5jwqOLGJkpVuaOoo/Tg6k=,tag:G0C0ZZ0V24YN+vNv4z4xHQ==,type:str]
lastmodified: "2025-12-28T09:13:01Z"
mac: ENC[AES256_GCM,data:rVjqBfoA/DUgb1Yqc3FzeMBPWJniAYKYcbLauh5flpKYfcTp01lr/pTbyB5BLEHZLOYwMf2PNjfG8zPDKv2z1cjYwoYEj9bur4N6pagR/NFuAoEvgOjm0YlrTVkskRmLxaqxYB749y4wWS04MvJhfPON4hWMdoYguPBmCpZMKqc=,iv:4ZVGsLKQNxqKmpaDcIpA21rAe51TKVR8diN5/d7SOQg=,tag:pIw/tqw+211V/0xK9M3hvg==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2
version: 3.11.0

View File

@@ -31,7 +31,7 @@ inputs:
(site: { name = "${site}.chn.moe"; value.upstream.address = "tinc0.nas.chn.moe"; })
[
"xn--s8w913fdga" "matrix" "send" "git" "grafana" "peertube" "rsshub" "misskey" "synapse" "vaultwarden"
"photoprism" "nextcloud" "freshrss" "huginn" "api" "webdav"
"nextcloud" "freshrss" "huginn" "api" "webdav"
]);
};
};

9
devices/wlin/bsub.nix Normal file
View File

@@ -0,0 +1,9 @@
{
normal = [ 4 4 20 ];
normal_1day = [ 4 7 28 ];
normal_1week = [ 4 7 28 ];
normal_2week = [ 6 8 48 ];
normal_1day_new = [ 4 6 24 ];
ocean_530_1day = [ 4 6 24 ];
ocean6226R_1day = [ 4 8 32 ];
}

View File

@@ -1,3 +1,6 @@
# sudo nix build --store 'local?store=/data/gpfs01/wlin/.nix/store&state=/data/gpfs01/wlin/.nix/state&log=/data/gpfs01/wlin/.nix/log' .#wlin
# sudo nix-store --store 'local?store=/data/gpfs01/wlin/.nix/store&state=/data/gpfs01/wlin/.nix/state&log=/data/gpfs01/wlin/.nix/log' -qR ./result | grep -Fxv -f <(ssh wlin find .nix/store -maxdepth 1 -exec realpath '{}' '\;') | sudo xargs nix-store --store 'local?store=/data/gpfs01/wlin/.nix/store&state=/data/gpfs01/wlin/.nix/state&log=/data/gpfs01/wlin/.nix/log' --export | pv > wlin.nar
# cat wlin.nar | nix-store --import
{ inputs, localLib }:
let
pkgs = import inputs.nixpkgs (localLib.buildNixpkgsConfig
@@ -5,10 +8,18 @@ let
inputs = { inherit (inputs.nixpkgs) lib; topInputs = inputs; };
nixpkgs = { march = "haswell"; nixRoot = "/data/gpfs01/wlin/.nix"; nixos = false; };
});
in pkgs.symlinkJoin
{
name = "jykang";
paths = with pkgs; [ gnuplot localPackages.vaspkit pv ];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs; };
}
python = pkgs.python3.withPackages (ps: with ps; [ phonopy ]);
chn-bsub = pkgs.localPackages.chn-bsub.override
(prev: { bsubConfig = builtins.toFile "bsub.yaml" (builtins.toJSON (import ./bsub.nix)); });
wlin = pkgs.symlinkJoin
{
name = "wlin";
paths = with pkgs;
[
gnuplot localPackages.vaspkit pv python localPackages.vasp.intel chn-bsub hwloc
lsd glibc glibc.bin
];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs chn-bsub; archive = pkgs.closureInfo { rootPaths = [ wlin.drvPath ]; }; };
};
in wlin

View File

@@ -1,12 +1,3 @@
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH

View File

@@ -1,43 +1,10 @@
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
export PATH=$PATH:/data/gpfs01/wlin/bin
# User specific aliases and functions
export PATH=/data/gpfs01/wlin/bin/vaspkit.1.4.1/bin:${PATH}
#export PATH=~/bin:/data/gpfs01/wlin/opt/mpich_ifort/bin:$PATH
#export LD_LIBRARY_PATH=/data/gpfs01/wlin/opt/mpich_ifort/lib:$LD_LIBRARY_PATH
#export PATH=~/bin:/data/gpfs01/wlin/opt/mpich/bin:$PATH
#export LD_LIBRARY_PATH=/data/gpfs01/wlin/opt/mpich/lib:$LD_LIBRARY_PATH
export P4_RSHCOMMAND=ssh
shopt -s cdspell
export HISTCONTROL=ignoredups
#shopt -s histappend
PROMPT_COMMAND='history -a'
export C3_RSH="ssh -x"
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
alias grep='grep --color'
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S `whoami`@${USER_IP}: "
export HISTFILESIZE=1000000
export PROMPT_COMMAND="history -a; history -r; $PROMPT_COMMAND"
shopt -s histappend
# Auto add env parameter $PROMPT_COMMAND when use non-Linux tty login by ssh.
if [ "$SSH_CONNECTION" != '' -a "$TERM" != 'linux' ]; then
declare -a HOSTIP
HOSTIP=`echo $SSH_CONNECTION |awk '{print $3}'`
export PROMPT_COMMAND='echo -ne "\033]0;${USER}@$HOSTIP:[${HOSTNAME%%.*}]:${PWD/#$HOME/~} \007"'
if [ -z "${BASHRC_SOURCED-}" ]; then
export PATH=$HOME/.nix/state/gcroots/current/bin:$HOME/bin:$PATH
ulimit -s unlimited
export HISTFILESIZE=1000000
export BASHRC_SOURCED=1
fi
ulimit -s unlimited
export PYTHONPATH=/data/gpfs01/wlin/bin/VaspBandUnfolding-master:${PYTHONPATH}
# vsts, see https://theory.cm.utexas.edu/vtsttools/scripts.html
export PATH=$PATH:/data/gpfs01/wlin/yjj/vtstscripts-1022
export PERL5LIB=/data/gpfs01/wlin/yjj/vtstscripts-1022

View File

@@ -0,0 +1,2 @@
store = local?store=/data/gpfs01/wlin/.nix/store&state=/data/gpfs01/wlin/.nix/state&log=/data/gpfs01/wlin/.nix/log
experimental-features = flakes nix-command

View File

@@ -59,11 +59,12 @@ let
trap cleanup SIGINT SIGTERM SIGHUP EXIT
tail -f /dev/null
'';
in pkgs.symlinkJoin
{
name = "xmuhk";
paths = (with pkgs; [ hello btop htop iotop pv localPackages.lumerical.lumerical.cmd ])
++ [ lumericalLicenseManager ];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs; };
}
xmuhk = pkgs.symlinkJoin
{
name = "xmuhk";
paths = (with pkgs; [ hello btop htop iotop pv localPackages.lumerical.lumerical.cmd ])
++ [ lumericalLicenseManager ];
postBuild = "echo ${inputs.self.rev or "dirty"} > $out/.version";
passthru = { inherit pkgs; archive = pkgs.closureInfo { rootPaths = [ xmuhk.drvPath ]; }; };
};
in xmuhk

807
flake.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,39 +3,36 @@
inputs =
{
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-unstable";
self = { submodules = true; lfs = true; };
nixpkgs.url = ./nixpkgs;
nixpkgs-2505.url = "github:CHN-beta/nixpkgs/nixos-25.05";
nixpkgs-2411.url = "github:CHN-beta/nixpkgs/nixos-24.11";
nixpkgs-2311.url = "github:CHN-beta/nixpkgs/nixos-23.11";
nixpkgs-2305.url = "github:CHN-beta/nixpkgs/nixos-23.05";
home-manager = { url = "github:nix-community/home-manager/master"; inputs.nixpkgs.follows = "nixpkgs"; };
home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix = { url = "github:Mic92/sops-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"; };
nur-xddxdd = { url = "github:CHN-beta/nur-xddxdd"; inputs.nixpkgs.follows = "nixpkgs"; };
impermanence.url = "github:CHN-beta/impermanence";
plasma-manager =
{
url = "github:pjones/plasma-manager";
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
nur-linyinfeng = { url = "github:linyinfeng/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-flatpak.url = "github:gmodena/nix-flatpak";
chaotic =
{
url = "github:chaotic-cx/nyx";
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
catppuccin = { url = "github:catppuccin/nix"; inputs.nixpkgs.follows = "nixpkgs"; };
bscpkgs = { url = "github:CHN-beta/bscpkgs"; inputs.nixpkgs.follows = "nixpkgs"; };
aagl = { url = "github:ezKEa/aagl-gtk-on-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
aagl = { url = "github:ezKEa/aagl-gtk-on-nix/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; };
winapps = { url = "github:winapps-org/winapps/feat-nix-packaging"; inputs.nixpkgs.follows = "nixpkgs"; };
nixvirt = { url = "github:CHN-beta/NixVirt"; inputs.nixpkgs.follows = "nixpkgs"; };
buildproxy = { url = "github:polygon/nix-buildproxy"; inputs.nixpkgs.follows = "nixpkgs"; };
niri = { url = "github:sodiboo/niri-flake"; inputs.nixpkgs.follows = "nixpkgs"; };
nix4vscode = { url = "github:nix-community/nix4vscode"; inputs.nixpkgs.follows = "nixpkgs"; };
nix4vscode =
{
url = "github:nix-community/nix4vscode?rev=6c603c201b11dafda616940bac1f295144ac1c41";
inputs.nixpkgs.follows = "nixpkgs";
};
dankmaterialshell = { url = "github:AvengeMedia/DankMaterialShell"; inputs.nixpkgs.follows = "nixpkgs"; };
harmonia.url = "github:nix-community/harmonia";
nix-cachyos-kernel = { url = "github:CHN-beta/nix-cachyos-kernel"; inputs.nixpkgs.follows = "nixpkgs"; };
misskey = { url = "git+https://github.com/CHN-beta/misskey?submodules=1"; flake = false; };
misskey = { url = "git+https://github.com/CHN-beta/misskey?submodules=1&rev=4c0425d6a229d3a75f2ff01cc30cf90434381cec"; flake = false; };
rsshub = { url = "github:DIYgod/RSSHub"; flake = false; };
zpp-bits = { url = "github:eyalz800/zpp_bits"; flake = false; };
concurrencpp = { url = "github:David-Haim/concurrencpp"; flake = false; };
@@ -56,9 +53,7 @@
py4vasp = { url = "github:vasp-dev/py4vasp?ref=v0.10.2"; flake = false; };
pocketfft = { url = "github:mreineck/pocketfft"; flake = false; };
blog = { url = "git+https://git.chn.moe/chn/blog-public.git?lfs=1"; flake = false; };
nixos-wallpaper = { url = "git+https://git.chn.moe/chn/nixos-wallpaper.git?lfs=1"; flake = false; };
vaspberry = { url = "github:Infant83/VASPBERRY"; flake = false; };
ufo = { url = "git+https://git.chn.moe/chn/ufo.git?lfs=1"; flake = false; };
stickerpicker = { url = "github:maunium/stickerpicker"; flake = false; };
fancy-motd = { url = "github:CHN-beta/fancy-motd"; flake = false; };
mac-style = { url = "github:SergioRibera/s4rchiso-plymouth-theme?lfs=1"; flake = false; };
@@ -68,6 +63,9 @@
pybinding = { url = "git+https://github.com/dean0x7d/pybinding?submodules=1"; flake = false; };
brokenaxes = { url = "github:bendichter/brokenaxes"; flake = false; };
mirism-old = { url = "github:CHN-beta/mirism-old-public"; flake = false; };
sqlgen = { url = "git+https://github.com/getml/sqlgen?submodules=1"; flake = false; };
reflectcpp = { url = "git+https://github.com/getml/reflect-cpp?submodules=1"; flake = false; };
linux-asus = { url = "github:CHN-beta/linux-g14/6.18"; flake = false; };
};
outputs = inputs: let localLib = import ./flake/lib inputs.nixpkgs.lib; in
@@ -76,11 +74,7 @@
nixosConfigurations = import ./flake/nixos.nix { inherit inputs localLib; };
overlays.default = final: prev:
{ localPackages = (import ./packages { inherit localLib; pkgs = final; topInputs = inputs; }); };
config =
{
branch = import ./flake/branch.nix;
dns = inputs.self.packages.x86_64-linux.dns-push.meta.config;
};
config.dns = inputs.self.packages.x86_64-linux.dns-push.meta.config;
devShells.x86_64-linux = import ./flake/dev.nix { inherit inputs; };
src = import ./flake/src.nix { inherit inputs; };
apps.x86_64-linux.dns-push = { type = "app"; program = "${inputs.self.packages.x86_64-linux.dns-push}"; };

View File

@@ -1 +0,0 @@
"production"

View File

@@ -1,57 +1,64 @@
{ inputs }: let inherit (inputs.self.nixosConfigurations.pc) pkgs; in
{
biu = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
biu = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.biu ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
hpcstat = pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
hpcstat = pkgs.mkShell
{
inputsFrom = [ (pkgs.localPackages.hpcstat.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
sbatch-tui = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
sbatch-tui = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.sbatch-tui ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
ufo = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
ufo = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.ufo ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
chn-bsub = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.chn-bsub ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
info = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
info = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.info ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
vm = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
vm = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.vm ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
xinli = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
xinli = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.xinli ];
packages = [ pkgs.clang-tools_18 ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
missgram = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.missgram ];
packages = [ pkgs.llvmPackages.clang-tools ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};

View File

@@ -8,7 +8,7 @@ let
vps6 =
[
"blog" "catalog" "coturn" "element" "initrd.vps6" "sticker" "synapse-admin" "tgapi" "ua" "xserver2"
"xserver2.vps6" "s" "headscale"
"xserver2.vps6" "s" "headscale" "missgram"
# to pc
""
];
@@ -18,14 +18,14 @@ let
srv1-node0 = [ "srv1" ];
srv2-node0 = [ "srv2" ];
"pc.ts" = [ "nix-store" "chat" ];
"nas.ts" = [ "nix-store.nas" "ssh.git" ];
"nas.ts" = [ "ssh.git" ];
autoroute = [ "" "matrix" ];
vps9 =
[
"initrd.vps9" "xserver2.vps9"
# to nas
"git" "grafana" "peertube" "send" "vikunja" "xservernas" "freshrss" "huginn" "nextcloud"
"photoprism" "rsshub" "vaultwarden" "webdav" "synapse" "misskey" "api"
"rsshub" "vaultwarden" "webdav" "synapse" "misskey" "api"
];
};
a =
@@ -45,6 +45,7 @@ let
"409test" = "192.168.1.5";
};
tinc = import ./tinc.nix;
tailscale = import ./tailscale.nix;
in
{
"" =
@@ -82,3 +83,6 @@ in
// lib.mapAttrs'
(n: v: lib.nameValuePair "tinc0.${n}" { type = "A"; value = "192.168.85.${builtins.toString v}"; })
tinc
// lib.mapAttrs'
(n: v: lib.nameValuePair "${n}.ts" { type = "A"; value = "100.97.101.${builtins.toString v}"; })
tailscale

View File

@@ -0,0 +1,10 @@
{
vps4 = 7;
vps6 = 2;
vps9 = 6;
pc = 1;
nas = 3;
srv2-node0 = 4;
srv2-node1 = 5;
srv2-node2 = 8;
}

View File

@@ -0,0 +1,76 @@
diff --git a/src/btop_config.cpp b/src/btop_config.cpp
index eaaa577..3074a08 100644
--- a/src/btop_config.cpp
+++ b/src/btop_config.cpp
@@ -234,6 +234,7 @@ namespace Config {
{"custom_gpu_name4", "#* Custom gpu4 model name, empty string to disable."},
{"custom_gpu_name5", "#* Custom gpu5 model name, empty string to disable."},
#endif
+ {"btrfs_group_subvolumes", "#* Show only the first subvolume of a btrfs filesystem."},
};
std::unordered_map<std::string_view, string> strings = {
@@ -336,6 +337,7 @@ namespace Config {
#endif
{"terminal_sync", true},
- {"save_config_on_exit", true}
+ {"save_config_on_exit", true},
+ {"btrfs_group_subvolumes", false},
};
std::unordered_map<std::string_view, bool> boolsTmp;
diff --git a/src/btop_menu.cpp b/src/btop_menu.cpp
index 75ec31c..cfaec39 100644
--- a/src/btop_menu.cpp
+++ b/src/btop_menu.cpp
@@ -724,6 +724,15 @@ namespace Menu {
"kernel as used memory.",
"",
"True or False."},
+ {
+ "btrfs_group_subvolumes",
+ "(Linux) Show only first BTRFS subvolume.",
+ "",
+ "Set to true to only show the first BTRFS",
+ "subvolume mounted per disk.",
+ "",
+ "True or False.",
+ }
},
{
{"graph_symbol_net",
diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp
index eebaa50..37d5745 100644
--- a/src/linux/btop_collect.cpp
+++ b/src/linux/btop_collect.cpp
@@ -2117,6 +2117,7 @@ namespace Mem {
auto use_fstab = Config::getB("use_fstab");
auto only_physical = Config::getB("only_physical");
auto zfs_hide_datasets = Config::getB("zfs_hide_datasets");
+ auto btrfs_group_subvolumes = Config::getB("btrfs_group_subvolumes");
auto& disks = mem.disks;
static std::unordered_map<string, future<pair<disk_info, int>>> disks_stats_promises;
ifstream diskread;
@@ -2177,6 +2178,7 @@ namespace Mem {
vector<string> found;
found.reserve(last_found.size());
string dev, mountpoint, fstype;
+ std::unordered_set<string> found_btrfs_subvolumes;
while (not diskread.eof()) {
std::error_code ec;
diskread >> dev >> mountpoint >> fstype;
@@ -2198,6 +2200,14 @@ namespace Mem {
size_t zfs_dataset_name_start = 0;
if (fstype == "zfs" && (zfs_dataset_name_start = dev.find('/')) != std::string::npos && zfs_hide_datasets) continue;
+ //? skip BtrFS subvolumes
+ if (btrfs_group_subvolumes and fstype == "btrfs") {
+ string devname = fs::canonical(dev, ec).filename();
+ if (!found_btrfs_subvolumes.insert(devname).second) {
+ continue;
+ }
+ }
+
if ((not use_fstab and not only_physical)
or (use_fstab and v_contains(fstab, mountpoint))
or (not use_fstab and only_physical and v_contains(fstypes, fstype))) {

View File

@@ -42,6 +42,7 @@ in platformConfig //
inputs.topInputs.buildproxy.overlays.default
inputs.topInputs.nix4vscode.overlays.default
inputs.topInputs.bscpkgs.overlays.default
inputs.topInputs.nix-cachyos-kernel.overlay
(final: prev:
{
nur-linyinfeng = (inputs.topInputs.nur-linyinfeng.overlays.default final prev).linyinfeng;
@@ -71,6 +72,13 @@ in platformConfig //
google-chrome = prev.google-chrome.override (prev:
{ commandLineArgs = prev.commandLineArgs or "" + " --disable-features=GlobalShortcutsPortal"; });
xray = prev.xray.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./xray.patch ]; });
btop = prev.btop.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./btop.patch ]; });
prrte = prev.prrte.overrideAttrs (prev:
{
configureFlags = prev.configureFlags or [] ++ [ "--with-lsf" ];
buildInputs = prev.buildInputs or [] ++ [ final.localPackages.lsf final.libnsl ];
});
cpptrace = prev.cpptrace.overrideAttrs (prev: { doCheck = !final.stdenv.hostPlatform.isStatic; });
}
// (
let
@@ -96,19 +104,6 @@ in platformConfig //
})
];
};
# pkgs-unstable =
# {
# source = "nixpkgs-unstable";
# overlays =
# [
# inputs.topInputs.self.overlays.default
# (_: _:
# {
# genericPackages = import inputs.topInputs.nixpkgs-unstable
# { inherit system; config = { allowUnfree = true; inherit allowInsecurePredicate; }; };
# })
# ];
# };
};
packages = name:
let flakeSource = inputs.topInputs.${source.${name}.source or source.${name}};
@@ -130,16 +125,25 @@ in platformConfig //
// (inputs.lib.optionalAttrs (prev.stdenv.hostPlatform.sse4_1Support)
{
frei0r = final.genericPackages.frei0r;
valkey = final.genericPackages.valkey;
})
// (inputs.lib.optionalAttrs (nixpkgs.march == "alderlake")
{ redis = prev.redis.overrideAttrs (prev: { doCheck = false; }); })
// (inputs.lib.optionalAttrs (nixpkgs.march == "cascadelake")
{ postgresql_17 = prev.postgresql_17.override { jitSupport = false; }; })
// (inputs.lib.optionalAttrs (nixpkgs.march != null)
{
ffmpeg_8 = prev.ffmpeg_8.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./ffmpeg.patch ]; });
ffmpeg_8-headless = prev.ffmpeg_8-headless.overrideAttrs
(prev: { patches = prev.patches or [] ++ [ ./ffmpeg.patch ]; });
ffmpeg_8-full = prev.ffmpeg_8-full.overrideAttrs
(prev: { patches = prev.patches or [] ++ [ ./ffmpeg.patch ]; });
ffmpeg = final.ffmpeg_8;
ffmpeg-headless = final.ffmpeg_8-headless;
ffmpeg-full = final.ffmpeg_8-full;
assimp = prev.assimp.override { stdenv = final.genericPackages.stdenv; };
redis = prev.redis.overrideAttrs (prev: { doCheck = false; });
wannier90 = prev.wannier90.overrideAttrs { buildFlags = [ "dynlib" ]; };
xen = prev.xen.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./xen.patch ]; });
lib2geom = prev.lib2geom.overrideAttrs (prev: { doCheck = false; });
libreoffice-qt6-still = prev.libreoffice-qt6-still.override (prev:
libreoffice-fresh = prev.libreoffice-fresh.override (prev:
{ unwrapped = prev.unwrapped.overrideAttrs (prev: { postPatch = prev.postPatch or "" +
''
sed -i '/CPPUNIT_TEST.testDubiousArrayFormulasFODS/d' sc/qa/unit/functions_array.cxx
@@ -151,11 +155,7 @@ in platformConfig //
pythonPackagesExtensions = prev.pythonPackagesExtensions or [] ++ [(final: prev:
{
picosvg = prev.picosvg.overridePythonAttrs { doCheck = false; };
aiocache = prev.aiocache.overridePythonAttrs { doCheck = false; };
})];
ctranslate2 = prev.ctranslate2.overrideAttrs (prev:
{ cmakeFlags = prev.cmakeFlags or [] ++ [ "-DENABLE_CPU_DISPATCH=OFF" ]; });
# valkey = final.redis;
})
)];
}

View File

@@ -0,0 +1,36 @@
Index: FFmpeg/libavcodec/huffyuvdsp.c
===================================================================
--- FFmpeg.orig/libavcodec/huffyuvdsp.c
+++ FFmpeg/libavcodec/huffyuvdsp.c
@@ -16,6 +16,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+// GCC Vectorize with AVX will break huffyuv unit tests.
+#if defined(__GNUC__) && !defined(__clang__)
+ #if (__GNUC__ > 6)
+ #pragma GCC optimize ("no-tree-vectorize")
+ #endif
+#endif
+
#include <stdint.h>
#include "config.h"
Index: FFmpeg/libavcodec/huffyuvenc.c
===================================================================
--- FFmpeg.orig/libavcodec/huffyuvenc.c
+++ FFmpeg/libavcodec/huffyuvenc.c
@@ -28,6 +28,13 @@
* huffyuv encoder
*/
+ // GCC Vectorize with AVX will break huffyuv unit tests.
+#if defined(__GNUC__) && !defined(__clang__)
+ #if (__GNUC__ > 6)
+ #pragma GCC optimize ("no-tree-vectorize")
+ #endif
+#endif
+
#include "config_components.h"
#include "avcodec.h"

View File

@@ -14,30 +14,13 @@ lib: rec
(
let handle = module: let type = builtins.typeOf module; in
if type == "path" || type == "string" then (handle (import module))
else if type == "lambda" then ({ pkgs, utils, ... }@inputs: (module inputs))
else if type == "lambda" && builtins.functionArgs module == {}
then ({ pkgs, utils, ... }@inputs: (module inputs))
else module;
in handle
)
moduleList);
# from: https://github.com/NixOS/nix/issues/3759
stripeTabs = text:
let
# Whether all lines start with a tab (or is empty)
shouldStripTab = lines: builtins.all (line: (line == "") || (lib.strings.hasPrefix " " line)) lines;
# Strip a leading tab from all lines
stripTab = lines: builtins.map (line: lib.strings.removePrefix " " line) lines;
# Strip tabs recursively until there are none
stripTabs = lines: if (shouldStripTab lines) then (stripTabs (stripTab lines)) else lines;
in
# Split into lines. Strip leading tabs. Concat back to string.
builtins.concatStringsSep "\n" (stripTabs (lib.strings.splitString "\n" text));
# find an element in a list, return the index
findIndex = e: list:
let findIndex_ = i: list: if (builtins.elemAt list i) == e then i else findIndex_ (i + 1) list;
in findIndex_ 0 list;
# return a list of path, including:
# - all .nix file in the directory except for default.nix
# - all directories containing a default.nix

View File

@@ -1,6 +1,6 @@
{ inputs, localLib }:
let
singles = [ "nas" "pc" "vps4" "vps6" "vps9" "r2s" ];
singles = [ "nas" "pc" "vps4" "vps6" "vps9" ];
cluster = { srv1 = 3; srv2 = 3; };
deviceModules = builtins.listToAttrs
(

View File

@@ -12,9 +12,7 @@
duc = pkgs.pkgsStatic.duc.override { enableCairo = false; cairo = null; pango = null; };
glaze = pkgs.pkgs-2411.pkgsStatic.glaze.overrideAttrs
(prev: { cmakeFlags = prev.cmakeFlags ++ [ "-Dglaze_ENABLE_FUZZING=OFF" ]; });
# pkgsStatic.clangStdenv have a bug
# https://github.com/NixOS/nixpkgs/issues/177129
biu = pkgs.pkgsStatic.localPackages.biu.override { stdenv = pkgs.pkgsStatic.gcc14Stdenv; inherit glaze; };
biu = pkgs.pkgsStatic.localPackages.biu.override { inherit glaze; };
in pkgs.pkgsStatic.localPackages.hpcstat.override
{
inherit openssh duc biu;
@@ -44,10 +42,17 @@
tokenPath = inputs.self.nixosConfigurations.pc.config.nixos.system.sops.secrets."acme/token".path;
octodns = pkgs.octodns.withProviders (_: with pkgs.octodns-providers; [ cloudflare ]);
};
archive = pkgs.writeText "archive" (builtins.concatStringsSep "\n" (builtins.concatLists
[
(inputs.nixpkgs.lib.mapAttrsToList (_: v: v.config.system.build.toplevel) inputs.self.outputs.nixosConfigurations)
[ src ]
]));
archive =
let
systemWithBuildDeps = system:
(system.extendModules { modules = [{ config.system.includeBuildDependencies = true; }]; })
.config.system.build.toplevel;
systems = inputs.nixpkgs.lib.mapAttrs (_: v: systemWithBuildDeps v) inputs.self.outputs.nixosConfigurations;
inputListFile = pkgs.writeText "input-list"
(builtins.concatStringsSep "\n" (builtins.attrValues inputs));
archive = pkgs.writeText "archive" (builtins.concatStringsSep "\n"
((builtins.attrValues systems) ++ [ src inputListFile ]));
in
archive // { passthru = archive.passthru // systems // { inherit src; inputs = inputListFile; }; };
}
// (builtins.mapAttrs (_: v: v.config.system.build.toplevel) inputs.self.outputs.nixosConfigurations)

View File

@@ -1,4 +1,4 @@
{ inputs }: let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{ inputs }: let inherit (inputs.self.packages.x86_64-linux) pkgs; inherit (inputs.nixpkgs) lib; in
{
nvhpc =
{
@@ -29,7 +29,7 @@
netboot = pkgs.fetchurl
{
url = "https://boot.netboot.xyz/ipxe/netboot.xyz.iso";
sha256 = "6GeOcugqElGPoPXeaWVpjcV5bCFxNLShGgN/sjsVzuI=";
sha256 = "0h7shj8gm3kzh7d7bcwygkp3fz5mac957accqhr9dhpjaj9dsmlr";
};
};
vasp =
@@ -84,7 +84,7 @@
};
src = pkgs.requireFile
{
name = "src";
name = "licenseManager";
sha256 = "1h93r0bb37279dzghi3k2axf0b8g0mgacw0lcww5j3sx0sqjbg4l";
hashMode = "recursive";
message = "Source file not found.";
@@ -190,22 +190,34 @@
url = "mirror://sourceforge/atomkit/Binaries/atomkit.0.9.0.linux.x64.tar.gz";
sha256 = "0y9z7wva7zikh83w9q431lgn3bqkh1v5w6iz90dwc75wqwk0w5jr";
};
guix = pkgs.fetchurl
btrfs =
{
url = "https://ci.guix.gnu.org/download/2857";
name = "guix.iso";
sha256 = "0xqabnay8wwqc1a96db8ix1a6bhvgm84s5is1q67rr432q7gqgd4";
};
peerBanHelper =
{
image = "ghostchu/peerbanhelper:v8.0.12";
imageFile = pkgs.dockerTools.pullImage
"6.12" =
{
imageName = "ghostchu/peerbanhelper";
imageDigest = "sha256:fce7047795fe1e6d730ea2583b390ccc336e79eb2d8dae8114f4f63f00208879";
hash = "sha256-7Z2ewDpGFXyvCze9HZ7KwFwn9o9R6Y4pjJDcr5Wmy1g=";
finalImageName = "ghostchu/peerbanhelper";
finalImageTag = "v8.0.12";
patch = pkgs.fetchurl
{
url = "https://github.com/kakra/linux/pull/36.patch";
sha256 = "0wimihsvrxib6g23jcqdbvqlkqk6nbqjswfx9bzmpm1vlvzxj8m0";
};
structuredExtraConfig.BTRFS_EXPERIMENTAL = lib.kernel.yes;
};
"6.18" =
{
patch = pkgs.fetchurl
{
url = "https://github.com/kakra/linux/pull/40.patch";
sha256 = "02q3x64rdyj6nx7jdknlg7x69v10xxbm0ry2xbgr069dfdm2w1ya";
};
structuredExtraConfig = { BTRFS_ALLOCATOR_HINTS = lib.kernel.yes; BTRFS_READ_POLICIES = lib.kernel.yes; };
};
};
# download include from /opt/ibm/lsfsuite/lsf/10.1/include into lsf/include
# download lib from /opt/ibm/lsfsuite/lsf/10.1/linux2.6-glibc2.3-x86_64/lib into lsf/lib and only preserve .so
lsf = pkgs.requireFile
{
name = "lsf";
sha256 = "0rij4xx705yj1vr5jd31hb8izmb35vkrdql0850qc5cn30jnkf4l";
hashMode = "recursive";
message = "lsf not found.";
};
}

View File

@@ -7,19 +7,17 @@ inputs: let inherit (inputs) topInputs; in
topInputs.nix-index-database.nixosModules.nix-index
topInputs.impermanence.nixosModules.impermanence
topInputs.nix-flatpak.nixosModules.nix-flatpak
topInputs.chaotic.nixosModules.default
{ config.chaotic.nyx.overlay.onTopOf = "user-pkgs"; }
topInputs.catppuccin.nixosModules.catppuccin
topInputs.aagl.nixosModules.default
topInputs.nixvirt.nixosModules.default
topInputs.niri.nixosModules.niri
{ config.niri-flake.cache.enable = false; }
topInputs.harmonia.nixosModules.harmonia
{ config.home-manager.sharedModules =
[
topInputs.plasma-manager.homeModules.plasma-manager
topInputs.catppuccin.homeModules.catppuccin
topInputs.dankmaterialshell.homeModules.dankMaterialShell.default
topInputs.dankmaterialshell.homeModules.dankMaterialShell.niri
topInputs.dankmaterialshell.homeModules.dank-material-shell
topInputs.dankmaterialshell.homeModules.niri
];}
] ++ (inputs.localLib.findModules ./.);
}

View File

@@ -9,6 +9,6 @@ inputs:
asusd = { enable = true; enableUserService = true; asusdConfig.source = ./asusd.ron; };
supergfxd.enable = false;
};
programs.rog-control-center = { enable = true; autoStart = true; };
programs.rog-control-center.enable = true;
};
}

View File

@@ -13,7 +13,8 @@ inputs:
{ joystick = genericOption; printer = genericOption; sound = genericOption; bolt = genericOption; };
config = let inherit (inputs.config.nixos) hardware; in inputs.lib.mkMerge
[
(inputs.lib.mkIf (hardware.joystick != null) { hardware = { xone.enable = true; xpadneo.enable = true; }; })
# TODO: enable after fix
# (inputs.lib.mkIf (hardware.joystick != null) { hardware = { xone.enable = true; xpadneo.enable = true; }; })
(
inputs.lib.mkIf (hardware.printer != null)
{

View File

@@ -37,7 +37,7 @@ inputs:
# TODO: import from nixos-hardware instead
# enableHybridCodec is only needed for some old intel gpus (Atom, Nxxx, etc)
intel = [ intel-vaapi-driver libvdpau-va-gl intel-media-driver ];
nvidia = [ vaapiVdpau ];
nvidia = [ libva-vdpau-driver ];
amd = [];
};
in packages.${gpu.type};

19
modules/packages/btop.nix Normal file
View File

@@ -0,0 +1,19 @@
{ lib, pkgs, config, ... }:
{
options.nixos.packages.btop = lib.mkOption { type = lib.types.nullOr (lib.types.submodule {}); default = {}; };
config = let inherit (config.nixos.packages) btop; in lib.mkIf (btop != null)
{
nixos =
{
packages.packages._packages = [ pkgs.btop ];
user.sharedModules =
[{
config.programs.btop =
{
enable = true;
settings.btrfs_group_subvolumes = true;
};
}];
};
};
}

View File

@@ -16,7 +16,7 @@ inputs:
# system management
# TODO: module should add yubikey-touch-detector into path
gparted wayland-utils clinfo mesa-demos vulkan-tools dracut yubikey-touch-detector btrfs-assistant snapper-gui
kdePackages.qtstyleplugin-kvantum cpu-x wl-mirror geekbench xpra
cpu-x wl-mirror geekbench xpra
(
writeShellScriptBin "xclip"
''
@@ -30,10 +30,12 @@ inputs:
remmina putty mtr-gui
# media
mpv nomacs simplescreenrecorder imagemagick gimp-with-plugins netease-cloud-music-gtk # qcm
waifu2x-converter-cpp blender paraview vlc whalebird spotify obs-studio subtitlecomposer
waifu2x-converter-cpp blender vlc whalebird spotify obs-studio subtitlecomposer
(inkscape-with-extensions.override { inkscapeExtensions = [ inkscape-extensions.textext ]; })
(paraview.overrideAttrs (prev: { nativeBuildInputs = prev.nativeBuildInputs
++ [(python3.withPackages (ps: with ps; [ numpy matplotlib ]))]; }))
# development
adb-sync scrcpy dbeaver-bin cling aircrack-ng kitty
adb-sync scrcpy dbeaver-bin cling aircrack-ng
weston cage openbox krita fprettify # jetbrains.clion
# password and key management
yubikey-manager bitwarden-desktop hashcat yubikey-personalization
@@ -51,8 +53,8 @@ inputs:
# browser
google-chrome tor-browser
# office
crow-translate zotero pandoc texliveFull poppler-utils pdftk pdfchain
ydict texstudio panoply pspp libreoffice-qt6-still ocrmypdf typst # paperwork
crow-translate zotero pandoc texliveFull poppler-utils pdftk pdfchain kdePackages.kruler kdePackages.okular
ydict texstudio panoply pspp libreoffice-fresh ocrmypdf typst # paperwork
# required by ltex-plus.vscode-ltex-plus
ltex-ls ltex-ls-plus
# matplot++ needs old gnuplot
@@ -69,58 +71,30 @@ inputs:
openai-whisper
# daily management
activitywatch super-productivity
]
++ (builtins.filter
(p: (inputs.lib.isDerivation p) && !(p.meta.broken or false)
&& !(builtins.elem p.pname or null [ "falkon" "kalzium" "calligra" "kamoso" ]))
(builtins.attrValues kdePackages.kdeGear))
++ (inputs.lib.optionals (inputs.config.nixos.system.gui.implementation == "kde")
[ inputs.topInputs.plasma-manager.packages.${inputs.pkgs.system}.rc2nix ]);
# game
lutris
];
_pythonPackages = [(pythonPackages: with pythonPackages;
[ phonopy scipy scikit-learn jupyterlab autograd inputs.pkgs.localPackages.phono3py numpy ])];
[
scipy scikit-learn jupyterlab autograd inputs.pkgs.localPackages.phono3py numpy
openai python-telegram-bot fastapi-cli pypdf2 pandas matplotlib plotly gunicorn redis jinja2 certifi
charset-normalizer idna orjson psycopg2 inquirerpy requests tqdm pydbus inputs.pkgs.localPackages.brokenaxes
# allow pandas read odf
odfpy
])];
};
user.sharedModules =
[{
config.programs =
config =
{
plasma = inputs.lib.mkIf (inputs.config.nixos.system.gui.implementation == "kde")
{
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) nixos-wallpaper;
isPicture = f: builtins.elem (inputs.lib.last (inputs.lib.splitString "." f))
[ "png" "jpg" "jpeg" "webp" ];
listDirRecursive =
let listDir = dir:
if dir.value == "directory" then builtins.concatLists
(builtins.map (f: listDir f) (inputs.localLib.attrsToList (builtins.readDir dir.name)))
else [ dir ];
in dir: listDir { name = dir; value = "directory"; };
in builtins.concatStringsSep "," (builtins.map (f: "${nixos-wallpaper}/${f.name}")
(builtins.filter (f: (isPicture f.name) && (f.value == "regular"))
(listDirRecursive 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 =
# TODO: use nixos module, enable kernel module
programs.obs-studio =
{
enable = true;
plugins = with inputs.pkgs.obs-studio-plugins; [ wlrobs obs-vaapi droidcam-obs obs-vkcapture ];
};
xdg.configFile."typora-flags.conf".text =
"--ozone-platform-hint=auto --enable-wayland-ime --wayland-text-input-version=3";
};
}];
};
@@ -130,13 +104,11 @@ inputs:
wireshark = { enable = true; package = inputs.pkgs.wireshark; };
yubikey-touch-detector.enable = true;
kdeconnect.enable = true;
kde-pim.enable = false;
coolercontrol.enable = true;
alvr = { enable = true; openFirewall = true; };
localsend.enable = true;
thunderbird.enable = true;
nh.enable = true;
};
services = { pcscd.enable = true; lact.enable = true; };
services.pcscd.enable = true;
};
}

View File

@@ -0,0 +1,15 @@
inputs:
{
options.nixos.packages.direnv = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule {});
default =
if (inputs.config.nixos.model.type == "desktop") && (inputs.config.nixos.model.arch == "x86_64") then {}
else null;
};
config = let inherit (inputs.config.nixos.packages) direnv; in inputs.lib.mkIf (direnv != null)
{
programs.direnv = { enable = true; nix-direnv.enable = true; };
nixos.user.sharedModules = [{ config.programs.direnv.enable = true; }];
};
}

View File

@@ -8,12 +8,12 @@ inputs:
[
ventoy-full
davinci-resolve
fluffychat signal-desktop qq nur-xddxdd.wechat-uos-sandboxed cinny-desktop hexchat halloy
fluffychat signal-desktop qq cinny-desktop hexchat halloy
appflowy notion-app-enhanced joplin-desktop logseq obsidian code-cursor
warp-terminal
rustdesk-flutter
yubikey-manager-qt yubikey-personalization-gui electrum jabref john crunch
nur-xddxdd.baidupcs-go wgetpaste onedrive onedrivegui rclone
wgetpaste onedrive onedrivegui rclone
];
programs =
{

View File

@@ -12,7 +12,7 @@ inputs:
{
enable = true;
languagePacks = [ "zh-CN" "en-US" ];
nativeMessagingHosts.packages = with inputs.pkgs; [ uget-integrator ];
nativeMessagingHosts.packages = [ inputs.pkgs.uget-integrator ];
};
nixos =
{
@@ -23,12 +23,7 @@ inputs:
programs.firefox =
{
enable = true;
nativeMessagingHosts = with inputs.pkgs;
(
[ uget-integrator ]
++ (inputs.lib.optionals (inputs.config.nixos.system.gui.implementation == "kde")
[ kdePackages.plasma-browser-integration ])
);
nativeMessagingHosts = [ inputs.pkgs.uget-integrator ];
# TODO: use fixed-version of plugins
policies.DefaultDownloadDirectory = "\${home}/Downloads";
profiles.default =
@@ -38,8 +33,7 @@ inputs:
tampermonkey bitwarden cookies-txt dualsub firefox-color i-dont-care-about-cookies
metamask pakkujs rsshub-radar rsspreview tabliss tree-style-tab ublock-origin
wappalyzer grammarly zotero-connector smartproxy kiss-translator
] ++ (inputs.lib.optionals (inputs.config.nixos.system.gui.implementation == "kde")
[ plasma-integration ]);
];
search = { default = "google"; force = true; };
userChrome = builtins.readFile "${inputs.topInputs.lepton}/userChrome.css";
userContent = builtins.readFile "${inputs.topInputs.lepton}/userContent.css";

View File

@@ -0,0 +1,20 @@
inputs:
{
options.nixos.packages.ghostty = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
config = let inherit (inputs.config.nixos.packages) ghostty; in inputs.lib.mkIf (ghostty != null)
{
nixos =
{
user.sharedModules =
[{
config.programs.ghostty =
{
enable = true;
settings = { scrollback-limit = 100000000; keybind = "ctrl+shift+r=reset"; };
};
}];
packages.packages._packages = [ inputs.pkgs.ghostty ];
};
};
}

View File

@@ -10,11 +10,11 @@ inputs:
[
# basic tools
beep dos2unix gnugrep pv tmux screen parallel tldr cowsay jq yq ipfetch localPackages.pslist
fastfetch reptyr duc ncdu progress libva-utils ksh neofetch dateutils glib
fastfetch reptyr duc ncdu progress libva-utils ksh neofetch dateutils glib cryptsetup
# lsxx
pciutils usbutils lshw util-linux lsof dmidecode lm_sensors hwloc acpica-tools ethtool
# top
iotop iftop htop btop powertop s-tui
iotop iftop htop powertop s-tui
# editor
nano bat
# downloader
@@ -43,6 +43,9 @@ inputs:
(octodns.withProviders (_: with octodns-providers; [ cloudflare ]))
# stupid things
toilet lolcat localPackages.stickerpicker graph-easy
# shell
# somehow fish does not compile on aarch64
(if inputs.config.nixos.model.arch == "x86_64" then kitty else emptyDirectory)
]
++ (with inputs.config.boot.kernelPackages; [ cpupower usbip ]);
};
@@ -52,9 +55,7 @@ inputs:
nix-index.enable = true;
command-not-found.enable = false;
autojump.enable = true;
direnv = { enable = true; nix-direnv.enable = true; };
mosh.enable = true;
yazi.enable = true;
};
services =
{

View File

@@ -40,7 +40,6 @@ inputs:
"${inputs.pkgs.oh-my-posh}/share/oh-my-posh/themes/atomic.omp.json"));
};
zoxide.enable = true;
direnv.enable = true;
};
}];
};

View File

@@ -27,10 +27,7 @@ inputs:
];
_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 inputs.pkgs.localPackages.brokenaxes
# allow pandas read odf
odfpy
phonopy
# for vasp plot-workfunc.py
ase
])];

View File

@@ -47,7 +47,6 @@ inputs:
host = host;
hostname = "hpc.xmu.edu.cn";
user = host;
setEnv.TERM = "chn_unset_ls_colors:xterm-256color";
};
})
[ "wlin" "hwang" ])

View File

@@ -63,6 +63,8 @@ inputs:
"ms-toolsai.jupyter" "ms-toolsai.jupyter-keymap" "ms-toolsai.jupyter-renderers"
"ms-toolsai.vscode-jupyter-cell-tags" "ms-toolsai.vscode-jupyter-slideshow"
"ms-toolsai.datawrangler"
# nushell
"TheNuProjectContributors.vscode-nushell-lang"
];
keybindings =
[
@@ -76,6 +78,14 @@ inputs:
key = "tab";
command = "-editor.action.inlineSuggest.commit";
}
{
key = "tab";
command = "-editor.action.inlineSuggest.jump";
}
{
key = "tab";
command = "-editor.emmet.action.expandAbbreviation";
}
{
key = "ctrl+enter";
command = "-editor.action.inlineSuggest.commit";
@@ -171,13 +181,8 @@ inputs:
"update.mode" = "none";
"editor.tabSize" = 2;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "nil";
"nix.serverPath" = "nixd";
"nix.formatterPath" = "nixpkgs-fmt";
"nix.serverSettings"."nil" =
{
"diagnostics"."ignored" = [ "unused_binding" "unused_with" ];
"formatting"."command" = [ "nixpkgs-fmt" ];
};
"xmake.envBehaviour" = "erase";
"git.openRepositoryInParentFolders" = "never";
"todo-tree.regex.regex" = "(//|#|<!--|;|/\\*|^|%|^[ \\t]*(-|\\d+.))\\s*($TAGS)";

15
modules/packages/yazi.nix Normal file
View File

@@ -0,0 +1,15 @@
inputs:
{
config =
{
programs.yazi.enable = true;
nixos.user.sharedModules =
[{
config.programs.yazi =
{
enable = true;
keymap.mgr.append_keymap = [{ on = "T"; run = "shell --orphan ghostty"; }];
};
}];
};
}

View File

@@ -10,7 +10,10 @@ inputs:
user.sharedModules =
[{
config.programs.zellij =
{ enable = true; settings = { show_startup_tips = false; show_release_notes = false; }; };
{
enable = true;
settings = { scroll_buffer_size = 100000000; show_startup_tips = false; show_release_notes = false; };
};
}];
};
};

View File

@@ -34,38 +34,45 @@ inputs:
home.shell.enableZshIntegration = true;
}
{
programs.zsh = inputs.lib.mkIf
(builtins.elem home-inputs.config.home.username [ "chn" "root" "aleksana" "alikia" "hjp" "lilydjwg" ])
programs =
let optional =
inputs.lib.mkIf (builtins.elem home-inputs.config.home.username
[ "chn" "root" "aleksana" "alikia" "hjp" "lilydjwg" ]);
in
{
plugins =
[
{
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{ file = "p10k.zsh"; name = "powerlevel10k-config"; src = ./p10k-config; }
{
name = "zsh-lsd";
src = inputs.pkgs.fetchFromGitHub
zsh = optional
{
plugins =
[
{
owner = "z-shell";
repo = "zsh-lsd";
rev = "65bb5ac49190beda263aae552a9369127961632d";
hash = "sha256-JSNsfpgiqWhtmGQkC3B0R1Y1QnDKp9n0Zaqzjhwt7Xk=";
};
}
];
initContent = inputs.lib.mkOrder 550
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
export PATH=~/bin:$PATH
zstyle ':vcs_info:*' disable-patterns "/nix/remote/*"
'';
oh-my-zsh.theme = "";
file = "powerlevel10k.zsh-theme";
name = "powerlevel10k";
src = "${inputs.pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{ file = "p10k.zsh"; name = "powerlevel10k-config"; src = ./p10k-config; }
{
name = "zsh-lsd";
src = inputs.pkgs.fetchFromGitHub
{
owner = "z-shell";
repo = "zsh-lsd";
rev = "65bb5ac49190beda263aae552a9369127961632d";
hash = "sha256-JSNsfpgiqWhtmGQkC3B0R1Y1QnDKp9n0Zaqzjhwt7Xk=";
};
}
];
initContent = inputs.lib.mkOrder 550
''
# p10k instant prompt
P10K_INSTANT_PROMPT="$XDG_CACHE_HOME/p10k-instant-prompt-''${(%):-%n}.zsh"
[[ ! -r "$P10K_INSTANT_PROMPT" ]] || source "$P10K_INSTANT_PROMPT"
HYPHEN_INSENSITIVE="true"
export PATH=~/bin:$PATH
zstyle ':vcs_info:*' disable-patterns "/nix/remote/*"
'';
oh-my-zsh.theme = "";
};
fzf = optional { enable = true; };
};
}
];

View File

@@ -473,7 +473,7 @@
# Don't show Git status in prompt for repositories whose workdir matches this pattern.
# For example, if set to '~', the Git repository at $HOME/.git will be ignored.
# Multiple patterns can be combined with '|': '~(|/foo)|/bar/baz/*'.
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~'
typeset -g POWERLEVEL9K_VCS_DISABLED_WORKDIR_PATTERN='~|/nix/remote/*'
# Disable the default Git status formatting.
typeset -g POWERLEVEL9K_VCS_DISABLE_GITSTATUS_FORMATTING=true

View File

@@ -59,6 +59,10 @@ inputs:
ts.chn.moe {
bind ${coredns.interface}
template IN SOA ts.chn.moe {
match ".*"
answer "{{ .Name }} 60 IN SOA vps6.chn.moe. chn.chn.moe. 2023010100 7200 3600 1209600 3600"
}
forward . 100.100.100.100
header {
response set aa

View File

@@ -57,15 +57,24 @@ inputs:
"cron.gc_lfs" = { ENABLED = true; SCHEDULE = "@monthly"; NUMBER_TO_CHECK_PER_REPO = 0; };
};
};
anubis.instances.gitea.settings =
{
OG_PASSTHROUGH = true;
TARGET = "http://127.0.0.1:3002";
BIND_NETWORK = "tcp";
BIND = "127.0.0.1:3003";
WEBMASTER_EMAIL = "chn@chn.moe";
SERVE_ROBOTS_TXT = true;
};
# prevent AI web crawlers
# https://her.esy.fun/posts/0031-how-i-protect-my-forgejo-instance-from-ai-web-crawlers/index.html
# nginx.virtualHosts."https:${gitea.hostname}".locations."/".extraConfigPre =
# ''
# if ($http_user_agent ~* "git/|git-lfs/") {
# set $bypass_cookie 1;
# }
# if ($cookie_Yogsototh_opens_the_door = "1") {
# set $bypass_cookie 1;
# }
# if ($request_method != "GET") {
# set $bypass_cookie 1;
# }
# if ($bypass_cookie != 1) {
# add_header Content-Type text/html always;
# return 418 '<script>document.cookie = "Yogsototh_opens_the_door=1; Path=/;"; window.location.reload();</script>';
# }
# '';
};
nixos =
{
@@ -77,7 +86,7 @@ inputs:
};
services =
{
nginx.https.${gitea.hostname}.location."/".proxy.upstream = "http://127.0.0.1:3003";
nginx.https.${gitea.hostname}.location."/".proxy.upstream = "http://127.0.0.1:3002";
postgresql.instances.gitea = {};
};
};

View File

@@ -1,52 +0,0 @@
inputs:
{
options.nixos.services.groupshare = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule { options =
{
users = mkOption
{
type = types.listOf types.nonEmptyStr;
default = [ "chn" "gb" "xll" "yjq" "zem" "gb" "wp" "hjp" ];
};
};});
default = null;
};
config =
let
inherit (inputs.config.nixos.services) groupshare;
users = inputs.lib.intersectLists groupshare.users inputs.config.nixos.user.users;
in inputs.lib.mkIf (groupshare != null)
{
users =
{
users = builtins.listToAttrs (map (user: { name = user; value.extraGroups = [ "groupshare" ]; }) users);
groups.groupshare.gid = inputs.config.nixos.user.gid.groupshare;
};
systemd.tmpfiles.rules = [ "d /var/lib/groupshare" ]
++ (builtins.concatLists (map
(user:
[
"d /var/lib/groupshare/${user} 2750 ${user} groupshare"
"Z /var/lib/groupshare/${user} - ${user} groupshare"
("A /var/lib/groupshare/${user} - - - - "
# d 指 default, 即目录下新创建的文件和目录的权限
# 大写 X 指仅给目录执行权限
# m 指 mask, 即对于所有者以外的用户, 该用户的权限最大为 m 指定的权限
+ (builtins.concatStringsSep "," (builtins.concatLists (map
(perm: [ "d:${perm}" perm ])
[ "u:${user}:rwX" "g:groupshare:r-X" "o::---" "m::r-x" ]))))
])
users));
home-manager.users = builtins.listToAttrs (map
(user:
{
name = user;
value = homeInputs:
{
config.home.file.groupshare.source = homeInputs.config.lib.file.mkOutOfStoreSymlink "/var/lib/groupshare";
};
})
users);
};
}

View File

@@ -0,0 +1,41 @@
inputs:
{
options.nixos.services.harmonia = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = "nix-store.chn.moe"; };
store = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
};});
default = null;
};
config = let inherit (inputs.config.nixos.services) harmonia; in inputs.lib.mkIf (harmonia != null)
{
services.harmonia-dev =
{
package = inputs.options.services.harmonia-dev.package.default.overrideAttrs
(prev: { patches = prev.patches or [] ++ [ ./harmonia.patch ]; });
cache =
{
enable = true;
signKeyPaths = [ inputs.config.nixos.system.sops.secrets."store/signingKey".path ];
settings = inputs.lib.mkIf (harmonia.store != null)
{
virtual_nix_store = "/nix/store";
real_nix_store = "${harmonia.store}/nix/store";
daemon_store = "/nix/store";
};
};
daemon =
{
enable = true;
dbPath = inputs.lib.mkIf (harmonia.store != null) "${harmonia.store}/nix/var/nix/db/db.sqlite";
};
};
nixos =
{
system.sops.secrets."store/signingKey" = {};
services.nginx.https.${harmonia.hostname}.location."/".proxy.upstream = "http://127.0.0.1:5000";
};
};
}

View File

@@ -0,0 +1,45 @@
From 310e2b2c6583710c52531785f1245d9621284310 Mon Sep 17 00:00:00 2001
From: Jack O'Sullivan <jackos1998@gmail.com>
Date: Sat, 6 Dec 2025 14:50:23 +0000
Subject: [PATCH] Expose `daemon_store` in cache as config option
---
harmonia-cache/src/config.rs | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/harmonia-cache/src/config.rs b/harmonia-cache/src/config.rs
index a683d78a..5dd9f801 100644
--- a/harmonia-cache/src/config.rs
+++ b/harmonia-cache/src/config.rs
@@ -68,6 +68,8 @@ pub(crate) struct Config {
#[serde(default = "default_daemon_socket")]
pub(crate) daemon_socket: PathBuf,
+ #[serde(default)]
+ pub(crate) daemon_store: Option<PathBuf>,
#[serde(skip, default)]
pub(crate) secret_keys: Vec<SecretKey>,
@@ -152,13 +154,19 @@ pub(crate) fn load(pool_metrics: Option<Arc<PoolMetrics>>) -> Result<Config> {
.as_encoded_bytes()
.to_vec()
});
- // For daemon communication, use real_nix_store if set (chroot mode),
+ // For daemon communication, use daemon_store, then real_nix_store if set (chroot mode),
// otherwise use the virtual store path
let daemon_store_dir = settings
- .real_nix_store
+ .daemon_store
.as_ref()
.map(|p| p.as_os_str().as_encoded_bytes().to_vec())
- .unwrap_or_else(|| virtual_store_dir.clone());
+ .unwrap_or_else(|| {
+ settings
+ .real_nix_store
+ .as_ref()
+ .map(|p| p.as_os_str().as_encoded_bytes().to_vec())
+ .unwrap_or_else(|| virtual_store_dir.clone())
+ });
settings.store = Store::new(
virtual_store_dir,
daemon_store_dir,

View File

@@ -0,0 +1,13 @@
inputs:
{
options.nixos.services.howdy = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) howdy; in inputs.lib.mkIf (howdy != null)
{
services =
{
howdy = { enable = true; settings.core.detection_notice = true; };
linux-enable-ir-emitter.enable = true;
};
};
}

View File

@@ -12,10 +12,11 @@ inputs:
ids = [ "*" ];
settings =
{
main.rightcontrol = "overload(r_ctrl, rightcontrol)";
main = { rightcontrol = "overload(r_ctrl, rightcontrol)"; prog4 = "sysrq"; };
"r_ctrl:C" = { left = "home"; right = "end"; up = "pageup"; down = "pagedown"; };
};
};
};
environment.systemPackages = [ inputs.pkgs.keyd ];
};
}

View File

@@ -0,0 +1,57 @@
inputs:
{
options.nixos.services.missgram = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) missgram; in inputs.lib.mkIf (missgram != null)
{
users =
{
users.missgram =
{ uid = inputs.config.nixos.user.uid.missgram; group = "missgram"; isSystemUser = true; };
groups.missgram.gid = inputs.config.nixos.user.gid.missgram;
};
systemd =
{
services.missgram =
{
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig =
{
User = inputs.config.users.users.missgram.name;
Group = inputs.config.users.users.missgram.group;
ExecStart =
let forwarder = inputs.pkgs.localPackages.missgram.override
{ configFile = inputs.config.nixos.system.sops.templates."missgram/config.yml".path; };
in "${forwarder}/bin/missgram";
};
};
};
nixos =
{
services =
{
nginx.https."missgram.chn.moe".location."/".proxy.upstream = "http://127.0.0.1:9173";
postgresql.instances.missgram = {};
};
system.sops =
{
templates."missgram/config.yml" =
{
owner = "missgram";
content =
let inherit (inputs.config.nixos.system.sops) placeholder;
in builtins.toJSON
{
Secret = placeholder."missgram/secret";
TelegramBotToken = placeholder."missgram/telegramBotToken";
TelegramChatId = -1003641252872;
ServerPort = 9173;
dbPassword = placeholder."postgresql/missgram";
};
};
secrets = { "missgram/secret" = {}; "missgram/telegramBotToken" = {}; };
};
};
};
}

View File

@@ -16,7 +16,7 @@ inputs:
hostName = nextcloud.hostname;
appstoreEnable = false;
https = true;
package = inputs.pkgs.nextcloud31;
package = inputs.pkgs.nextcloud32;
maxUploadSize = "10G";
config =
{

View File

@@ -1,29 +0,0 @@
inputs:
{
options.nixos.services.nix-serve = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = "nix-store.chn.moe"; };
};});
default = null;
};
config = let inherit (inputs.config.nixos.services) nix-serve; in inputs.lib.mkIf (nix-serve != null)
{
services.nix-serve =
{
enable = true;
package = inputs.pkgs.nix-serve-ng;
openFirewall = true;
secretKeyFile = inputs.config.nixos.system.sops.secrets."store/signingKey".path;
# curl -L cache.nixos.org/nix-cache-info
# use this cache after official one
extraParams = "--priority 50";
};
nixos =
{
system.sops.secrets."store/signingKey" = {};
services.nginx.https.${nix-serve.hostname}.location."/".proxy.upstream = "http://127.0.0.1:5000";
};
};
}

View File

@@ -1,16 +0,0 @@
inputs:
{
options.nixos.services.peerBanHelper = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) peerBanHelper; in inputs.lib.mkIf (peerBanHelper != null)
{
virtualisation.oci-containers.containers.peerBanHelper =
{
inherit (inputs.topInputs.self.src.peerBanHelper) image imageFile;
volumes = [ "peerBanHelper:/app/data" ];
ports = [ "9898:9898/tcp" ];
environment = { PUID = "0"; PGID = "0"; TZ = "UTC"; };
};
nixos.services.podman = {};
};
}

View File

@@ -1,46 +0,0 @@
inputs:
{
options.nixos.services.photoprism = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = null; };
config = let inherit (inputs.config.nixos.services) photoprism; in inputs.lib.mkIf (photoprism != null)
{
services.photoprism =
{
enable = true;
originalsPath = inputs.config.services.photoprism.storagePath + "/originals";
settings =
{
PHOTOPRISM_SITE_URL = "https://photoprism.chn.moe";
PHOTOPRISM_HTTP_PORT = "2342";
PHOTOPRISM_DISABLE_TLS = "true";
PHOTOPRISM_DETECT_NSFW = "true";
PHOTOPRISM_UPLOAD_NSFW = "true";
PHOTOPRISM_DATABASE_DRIVER = "mysql";
PHOTOPRISM_DATABASE_SERVER = "127.0.0.1:3306";
};
};
systemd.services.photoprism =
{
after = [ "mysql.service" ];
requires = [ "mysql.service" ];
serviceConfig.EnvironmentFile = inputs.config.nixos.system.sops.templates."photoprism/env".path;
};
nixos =
{
system.sops =
{
templates."photoprism/env".content = let inherit (inputs.config.nixos.system.sops) placeholder; in
''
PHOTOPRISM_ADMIN_PASSWORD=${placeholder."photoprism/adminPassword"}
PHOTOPRISM_DATABASE_PASSWORD=${placeholder."mariadb/photoprism"}
'';
secrets."photoprism/adminPassword" = {};
};
services =
{
mariadb.instances.photoprism = {};
nginx.https."photoprism.chn.moe".location."/".proxy = { upstream = "http://127.0.0.1:2342"; websocket = true; };
};
};
};
}

View File

@@ -1,32 +0,0 @@
inputs:
{
options.nixos.services.searx = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = "search.chn.moe"; };
};});
default = null;
};
config = let inherit (inputs.config.nixos.services) searx; in inputs.lib.mkIf (searx != null)
{
services.searx =
{
enable = true;
settings.server = { port = 8081; bind_address = "127.0.0.1"; secret_key = "@SEARX_SECRET_KEY@"; };
environmentFile = inputs.config.nixos.system.sops.templates."searx.env".path;
};
nixos =
{
system.sops =
{
templates."searx.env".content = let inherit (inputs.config.nixos.system.sops) placeholder; in
''
SEARX_SECRET_KEY=${placeholder."searx/secret-key"}
'';
secrets."searx/secret-key" = {};
};
services.nginx.https.${searx.hostname}.location."/".proxy.upstream = "http://127.0.0.1:8081";
};
};
}

View File

@@ -54,29 +54,18 @@ inputs:
{
slurm =
{
package = (inputs.pkgs.slurm.override { enableX11 = false; enableNVML = false; }).overrideAttrs
(prev:
let
inherit (inputs.config.nixos.system.nixpkgs) cuda;
inherit (inputs.pkgs.cudaPackages) cuda_nvml_dev;
additionalInputs = inputs.lib.optionals (cuda != null) [ cuda_nvml_dev cuda_nvml_dev.lib ];
additionalFlags = inputs.lib.optional (cuda != null) "-L${cuda_nvml_dev.lib}/lib/stubs";
in
{
buildInputs = prev.buildInputs or [] ++ additionalInputs;
LDFLAGS = prev.LDFLAGS or [] ++ additionalFlags;
nativeBuildInputs = prev.nativeBuildInputs ++ [ inputs.pkgs.wrapGAppsHook3 ];
postInstall =
''
pushd contribs/pmi2
make install
popd
pushd contribs/pmi
make install
popd
'' + prev.postInstall;
}
);
package = (inputs.pkgs.slurm.override { enableX11 = false; }).overrideAttrs (prev:
{
postInstall =
''
pushd contribs/pmi2
make install
popd
pushd contribs/pmi
make install
popd
'' + prev.postInstall;
});
client.enable = true;
nodeName = builtins.map
(node:
@@ -207,7 +196,7 @@ inputs:
{
services.slurm =
{
server.enable = true;
server = { enable = true; flag.i = true; };
dbdserver =
{
enable = true;

View File

@@ -23,6 +23,7 @@ inputs:
PasswordAuthentication = sshd.passwordAuthentication;
KbdInteractiveAuthentication = false;
UsePAM = true;
GatewayPorts = "yes";
};
};
}

View File

@@ -1,7 +1,10 @@
inputs:
{
options.nixos.services.tailscale = let inherit (inputs.lib) mkOption types; in mkOption
{ type = types.nullOr (types.submodule {}); default = {}; };
{
type = types.nullOr (types.submodule {});
default = if inputs.config.nixos.model.arch == "x86_64" then {} else null;
};
config = let inherit (inputs.config.nixos.services) tailscale; in inputs.lib.mkIf (tailscale != null)
{
services.tailscale =

View File

@@ -14,7 +14,7 @@ inputs:
(inputs.lib.removeSuffix ".chn.moe" submoduleInputs.config.xray.serverName);
};
};
dnsmasq =
coredns =
{
extraInterfaces = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
hosts = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
@@ -27,19 +27,26 @@ inputs:
{
services =
{
dnsmasq =
coredns =
{
enable = true;
settings =
{
no-poll = true;
log-queries = true;
server = [ "127.0.0.1#10853" ];
interface = client.dnsmasq.extraInterfaces ++ [ "lo" ];
bind-dynamic = true;
address = builtins.map (host: "/${host.name}/${host.value}")
(inputs.localLib.attrsToList client.dnsmasq.hosts);
};
config =
let
hosts = inputs.pkgs.writeText "coredns.hosts" (builtins.concatStringsSep "\n"
(inputs.lib.mapAttrsToList (n: v: "${v} ${n}") client.coredns.hosts));
in
''
. {
log
errors
bind lo ${builtins.concatStringsSep " " client.coredns.extraInterfaces}
hosts ${hosts} {
fallthrough
}
rewrite name exact git.chn.moe nas.ts.chn.moe
forward . 127.0.0.1:10853
}
'';
};
resolved.enable = false;
};

View File

@@ -1,91 +0,0 @@
inputs:
{
options.nixos.services.xray.xmuClient = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule (submoduleInputs: { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = "xserverxmu.chn.moe"; };
};}));
default = null;
};
config = let inherit (inputs.config.nixos.services.xray) xmuClient; in inputs.lib.mkIf (xmuClient != null)
{
nixos.system.sops =
{
templates."xray-xmu-client.json" =
{
owner = inputs.config.users.users.v2ray.name;
group = inputs.config.users.users.v2ray.group;
content = builtins.toJSON
{
log.loglevel = "warning";
inbounds =
[
{
port = 10983;
protocol = "dokodemo-door";
settings = { network = "tcp,udp"; followRedirect = true; };
streamSettings.sockopt.tproxy = "tproxy";
tag = "tproxy-in";
}
{ port = 10984; protocol = "socks"; settings.udp = true; tag = "socks-in"; }
];
outbounds =
[{
protocol = "vless";
settings.vnext =
[{
address = "webvpn.xmu.edu.cn";
port = 443;
users =
[{ id = inputs.config.nixos.system.sops.placeholder."xray-xmu-client/uuid"; encryption = "none"; }];
}];
streamSettings =
{
network = "xhttp";
security = "tls";
xhttpSettings =
{
path = "${inputs.pkgs.localPackages.webvpnPath xmuClient.hostname}/xsession";
mode = "packet-up";
security = "tls";
extra.headers.Cookie =
let ticket = inputs.config.nixos.system.sops.placeholder."xray-xmu-client/cookie";
in "show_vpn=0; heartbeat=1; show_faq=0; wengine_vpn_ticketwebvpn_xmu_edu_cn=${ticket}";
};
tlsSettings.alpn = [ "http/1.1" ];
};
}];
};
};
secrets = { "xray-xmu-client/uuid" = {}; "xray-xmu-client/cookie" = {}; };
};
systemd.services =
{
xray-xmu-client =
{
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
script = let config = inputs.config.nixos.system.sops.templates."xray-xmu-client.json".path; in
"exec ${inputs.pkgs.xray}/bin/xray -config ${config}";
serviceConfig =
{
User = "v2ray";
Group = "v2ray";
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
NoNewPrivileges = true;
LimitNPROC = 65536;
LimitNOFILE = 524288;
CPUSchedulingPolicy = "rr";
};
restartTriggers = [ inputs.config.nixos.system.sops.templates."xray-xmu-client.json".file ];
};
};
users =
{
users.v2ray = { uid = inputs.config.nixos.user.uid.v2ray; group = "v2ray"; isSystemUser = true; };
groups.v2ray.gid = inputs.config.nixos.user.gid.v2ray;
};
};
}

View File

@@ -1,57 +0,0 @@
inputs:
{
options.nixos.services.xray.xmuPersist = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule (submoduleInputs: { options =
{
keepAliveHost = mkOption { type = types.nonEmptyStr; default = "blog.chn.moe"; };
};}));
default = null;
};
config = let inherit (inputs.config.nixos.services.xray) xmuPersist; in inputs.lib.mkIf (xmuPersist != null)
{
nixos.system.sops =
{
templates."xray-xmu-persist-cookie.txt" =
{
owner = inputs.config.users.users.v2ray.name;
group = inputs.config.users.users.v2ray.group;
content = let cookie = inputs.config.nixos.system.sops.placeholder."xray-xmu-client/cookie"; in
''
.webvpn.xmu.edu.cn TRUE / TRUE 0 wengine_vpn_ticketwebvpn_xmu_edu_cn ${cookie}
webvpn.xmu.edu.cn FALSE / TRUE 0 show_vpn 0
webvpn.xmu.edu.cn FALSE / TRUE 0 heartbeat 1
webvpn.xmu.edu.cn FALSE / TRUE 0 show_faq 0
webvpn.xmu.edu.cn FALSE / FALSE 0 refresh 0
'';
};
secrets."xray-xmu-client/cookie" = {};
};
systemd =
{
services.xray-xmu-persist =
{
script =
let
curl = "${inputs.pkgs.curl}/bin/curl";
cookie = inputs.config.nixos.system.sops.templates."xray-xmu-persist-cookie.txt".path;
in
''
${curl} -s -o /dev/null -w "%{http_code}\n" -b ${cookie} \
"https://webvpn.xmu.edu.cn${inputs.pkgs.localPackages.webvpnPath xmuPersist.keepAliveHost}/";
'';
serviceConfig = { Type = "oneshot"; User = "v2ray"; Group = "v2ray"; };
};
timers.xray-xmu-persist =
{
wantedBy = [ "timers.target" ];
timerConfig = { OnCalendar = "*-*-* *:*:00"; Unit = "xray-xmu-persist.service"; };
};
};
users =
{
users.v2ray = { uid = inputs.config.nixos.user.uid.v2ray; group = "v2ray"; isSystemUser = true; };
groups.v2ray.gid = inputs.config.nixos.user.gid.v2ray;
};
};
}

View File

@@ -1,65 +0,0 @@
inputs:
{
options.nixos.services.xray.xmuServer = let inherit (inputs.lib) mkOption types; in mkOption
{
type = types.nullOr (types.submodule { options =
{
hostname = mkOption { type = types.nonEmptyStr; default = "xserverxmu.chn.moe"; };
};});
default = null;
};
config = let inherit (inputs.config.nixos.services.xray) xmuServer; in inputs.lib.mkIf (xmuServer != null)
{
nixos.system.sops =
{
templates."xray-xmu-server.json" =
{
owner = inputs.config.users.users.v2ray.name;
content = builtins.toJSON
{
log.loglevel = "warning";
inbounds =
[{
port = 4727;
listen = "127.0.0.1";
protocol = "vless";
settings =
{
clients = [{ id = inputs.config.nixos.system.sops.placeholder."xray-xmu-server"; }];
decryption = "none";
};
streamSettings = { network = "xhttp"; xhttpSettings = { mode = "packet-up"; path = "/xsession"; }; };
tag = "in";
}];
outbounds = [{ protocol = "freedom"; tag = "freedom"; }];
};
};
secrets."xray-xmu-server" = {};
};
systemd.services.xray-xmu-server =
{
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
script = let config = inputs.config.nixos.system.sops.templates."xray-xmu-server.json".path; in
"exec ${inputs.pkgs.xray}/bin/xray -config ${config}";
serviceConfig =
{
User = "v2ray";
Group = "v2ray";
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
NoNewPrivileges = true;
LimitNPROC = 65536;
LimitNOFILE = 524288;
};
restartTriggers = [ inputs.config.nixos.system.sops.templates."xray-xmu-server.json".file ];
};
users =
{
users.v2ray = { uid = inputs.config.nixos.user.uid.v2ray; group = "v2ray"; isSystemUser = true; };
groups.v2ray.gid = inputs.config.nixos.user.gid.v2ray;
};
nixos.services.nginx.https.${xmuServer.hostname}.location =
{ "/".return.return = "400"; "/xsession".proxy.upstream = "http://127.0.0.1:4727"; };
};
}

View File

@@ -1,36 +0,0 @@
inputs:
{
options.nixos.services.xrdp = let inherit (inputs.lib) mkOption types; in
{
enable = mkOption { type = types.bool; default = false; };
port = mkOption { type = types.ints.unsigned; default = 3389; };
hostname = mkOption { type = types.nullOr (types.nonEmptyListOf types.nonEmptyStr); default = null; };
};
config = let inherit (inputs.config.nixos.services) xrdp;
in inputs.lib.mkIf xrdp.enable (inputs.lib.mkMerge
[
{
services.xrdp =
{
enable = true;
port = xrdp.port;
openFirewall = true;
defaultWindowManager = "${inputs.pkgs.kdePackages.plasma-workspace}/bin/startplasma-x11";
};
}
(
inputs.lib.mkIf (xrdp.hostname != null)
(
let mainDomain = builtins.elemAt xrdp.hostname 0;
in
{
services.xrdp =
let keydir = inputs.config.security.acme.certs.${mainDomain}.directory;
in { sslCert = "${keydir}/full.pem"; sslKey = "${keydir}/key.pem"; };
nixos.services.acme.cert.${mainDomain} =
{ domains = xrdp.hostname; group = inputs.config.systemd.services.xrdp.serviceConfig.Group; };
}
)
)
]);
}

View File

@@ -9,6 +9,8 @@ inputs:
acpid.enable = true;
# TODO: set ipfs as separate service
# kubo = { enable = true; autoMount = true; };
# fstrim is enabled by default, disable it
fstrim.enable = false;
};
time.timeZone = "Asia/Shanghai";
boot =
@@ -56,8 +58,12 @@ inputs:
{
stateVersion = "25.05";
configurationRevision = inputs.topInputs.self.rev or "dirty";
nixos = { versionSuffix = inputs.lib.mkForce ""; tags = [ inputs.topInputs.self.config.branch ]; };
nixos =
{
versionSuffix = inputs.lib.mkForce "";
tags = let inherit (inputs.topInputs) self; in
[ (builtins.substring 2 6 self.lastModifiedDate) (builtins.substring 0 6 self.rev or "dirty") ];
};
};
chaotic.nyx.cache.enable = false;
};
}

View File

@@ -88,7 +88,6 @@ inputs:
resumeDevice = fileSystems.resume.device;
kernelParams = [ "resume_offset=${builtins.toString fileSystems.resume.offset}" ];
};
nixos.system.kernel.patches = [ "hibernate-progress" ];
systemd.sleep.extraConfig = "HibernateMode=reboot";
})
];

View File

@@ -67,7 +67,7 @@ inputs:
"/nix/persistent".users.chn.directories =
[
"bin" "Desktop" "Documents" "Downloads" "Music" "Pictures" "repo" "share" "Public" "Videos" ".config"
".local/share" ".ecdata" { directory = ".mozilla/firefox/default"; mode = "0700"; } ".steam" ".zotero"
".local" ".ecdata" { directory = ".mozilla/firefox/default"; mode = "0700"; } ".steam" ".zotero"
"Zotero" ".thunderbird"
];
})

View File

@@ -1,6 +1,6 @@
inputs:
{ lib, config, pkgs, ... }:
{
options.nixos.system.fileSystems.mount.nfs = let inherit (inputs.lib) mkOption types; in mkOption
options.nixos.system.fileSystems.mount.nfs = let inherit (lib) mkOption types; in mkOption
{
type = types.attrsOf (types.oneOf
[
@@ -8,50 +8,54 @@ inputs:
(types.submodule (submoduleInputs: { options =
{
mountPoint = mkOption { type = types.nonEmptyStr; };
neededForBoot = mkOption { type = types.bool; default = true; };
mountBeforeSwitch = mkOption { type = types.bool; default = true; };
readOnly = mkOption { type = types.bool; default = !submoduleInputs.config.mountBeforeSwitch; };
};}))
]);
default = {};
};
config =
let inherit (inputs.config.nixos.system.fileSystems.mount) nfs;
in inputs.lib.mkIf (nfs != {}) (inputs.lib.mkMerge
config = let inherit (config.nixos.system.fileSystems.mount) nfs; in lib.mkIf (nfs != {}) (lib.mkMerge
[
{
fileSystems = builtins.listToAttrs (builtins.map
(device:
fileSystems = lib.mapAttrs'
(n: v: lib.nameValuePair (v.mountPoint or v)
{
name = device.value.mountPoint or device.value;
value =
{
device = device.name;
fsType = "nfs4";
neededForBoot = device.value.neededForBoot or true;
options = builtins.concatLists
device = n;
fsType = "nfs4";
neededForBoot = v.mountBeforeSwitch or true;
options = builtins.concatLists
[
[
[
"actimeo=1" # sync every seconds
"noatime"
"x-gvfs-hide" # hide in file managers (e.g. dolphin)
]
# when try to mount at startup, wait 15 minutes before giving up
(inputs.lib.optionals (device.value.neededForBoot or true)
[ "retry=15" "x-systemd.device-timeout=15min" ])
(inputs.lib.optionals (!(device.value.neededForBoot or true))
[ "bg" "x-systemd.requires=network-online.target" "x-systemd.after=network-online.target" ])
];
};
"actimeo=1" # sync every seconds
"noatime"
"x-gvfs-hide" # hide in file managers (e.g. dolphin)
]
# when try to mount at startup, wait 15 minutes before giving up
(lib.optionals (v.mountBeforeSwitch or true) [ "retry=15" "x-systemd.device-timeout=15min" ])
(lib.optionals (!(v.mountBeforeSwitch or true))
[ "bg" "x-systemd.requires=network-online.target" "x-systemd.after=network-online.target" ])
(lib.optionals (v.readOnly or false) [ "ro" ])
];
})
(inputs.localLib.attrsToList nfs));
nfs;
systemd.mounts = builtins.map
(mount:
{
where = mount.value.mountPoint or mount.value;
what = mount.name;
overrideStrategy = "asDropin";
mountConfig.ForceUnmount = true;
})
(builtins.filter (mount: mount.value.readOnly or false) (lib.attrsToList nfs));
services.rpcbind.enable = true;
}
(inputs.lib.mkIf (builtins.any (mount: mount.neededForBoot or true) (builtins.attrValues nfs))
(lib.mkIf (builtins.any (mount: mount.mountBeforeSwitch or true) (builtins.attrValues nfs))
{
boot.initrd.systemd.extraBin =
{
"ifconfig" = "${inputs.pkgs.nettools}/bin/ifconfig";
"mount.nfs" = "${inputs.pkgs.nfs-utils}/bin/mount.nfs";
"mount.nfs4" = "${inputs.pkgs.nfs-utils}/bin/mount.nfs4";
"ifconfig" = "${pkgs.nettools}/bin/ifconfig";
"mount.nfs" = "${pkgs.nfs-utils}/bin/mount.nfs";
"mount.nfs4" = "${pkgs.nfs-utils}/bin/mount.nfs4";
};
nixos.system.initrd.network = {};
})

View File

@@ -25,7 +25,7 @@ inputs:
{
wantedBy = [ "initrd.target" ];
after = [ "cryptsetup.target" "systemd-hibernate-resume.service" ];
before = [ "local-fs-pre.target" "sysroot.mount" ];
before = [ "local-fs-pre.target" "sysroot.mount" "create-needed-for-boot-dirs.service" ];
unitConfig.DefaultDependencies = false;
serviceConfig.Type = "oneshot";
script =

View File

@@ -4,7 +4,6 @@ inputs:
{
type = types.nullOr (types.submodule { options =
{
timeout = mkOption { type = types.int; default = 15; };
windowsEntries = mkOption { type = types.attrsOf types.nonEmptyStr; default = {}; };
# "efi" using efi, "efiRemovable" using efi with install grub removable, or dev path like "/dev/sda" using bios
installDevice = mkOption { type = types.str; default = "efi"; };
@@ -15,9 +14,13 @@ inputs:
(inputs.lib.mkMerge
[
# general settings
{ boot.loader.grub = { enable = true; useOSProber = false; }; }
# grub timeout
{ boot.loader.timeout = grub.timeout; }
{
boot.loader =
{
grub = { enable = true; useOSProber = false; };
timeout = if inputs.config.nixos.model.type == "desktop" then null else 15;
};
}
# grub install
{
boot.loader =

View File

@@ -1,91 +1,121 @@
inputs:
{
options.nixos.system.gui = let inherit (inputs.lib) mkOption types; in
config = inputs.lib.mkIf (inputs.config.nixos.model.type == "desktop")
{
implementation = mkOption { type = types.enum [ "kde" "niri" ]; default = "kde"; };
};
config = let inherit (inputs.config.nixos.system) gui; in inputs.lib.mkMerge
[
# enable gui
(inputs.lib.mkIf (inputs.config.nixos.model.type == "desktop")
services =
{
services =
{
desktopManager.plasma6.enable = inputs.lib.mkIf (gui.implementation == "kde") true;
greetd =
{
enable = true;
settings.default_session.command =
let sessionData = "${inputs.config.services.displayManager.sessionData.desktops}/share";
in builtins.concatStringsSep " "
[
"${inputs.pkgs.tuigreet}/bin/tuigreet"
"--sessions ${sessionData}/wayland-sessions --xsessions ${sessionData}/xsessions"
"--time --asterisks --remember --remember-user-session"
(inputs.lib.optionalString (gui.implementation == "kde") "--cmd startplasma-wayland")
];
};
};
environment =
{
sessionVariables.GTK_USE_PORTAL = "1";
persistence."/nix/persistent".directories =
[{ directory = "/var/cache/tuigreet"; user = "greeter"; group = "greeter"; mode = "0700"; }];
};
xdg.portal.extraPortals = (builtins.map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "wlr" ])
++ [ inputs.pkgs.kdePackages.xdg-desktop-portal-kde ];
i18n.inputMethod =
greetd =
{
enable = true;
type = "fcitx5";
fcitx5.addons = with inputs.pkgs;
[ qt6Packages.fcitx5-chinese-addons fcitx5-mozc fcitx5-material-color fcitx5-gtk ];
settings.default_session.command =
let sessionData = "${inputs.config.services.displayManager.sessionData.desktops}/share";
in builtins.concatStringsSep " "
[
"${inputs.pkgs.tuigreet}/bin/tuigreet"
"--sessions ${sessionData}/wayland-sessions --xsessions ${sessionData}/xsessions"
"--time --asterisks --remember --remember-user-session"
];
};
programs.dconf.enable = true;
nixos.user.sharedModules = [(hmInputs:
# niri module will auto enable this, disable it to avoid conflict with system ssh-agent
gnome.gcr-ssh-agent.enable = false;
};
environment =
{
sessionVariables =
{
config =
GTK_USE_PORTAL = "1";
# let electron use gnome keyring https://github.com/electron/electron/issues/39789#issuecomment-3433810585
GNOME_DESKTOP_SESSION_ID = "this-is-deprecated";
};
persistence."/nix/persistent".directories =
[{ directory = "/var/cache/tuigreet"; user = "greeter"; group = "greeter"; mode = "0700"; }];
systemPackages =
[
# nautilus is needed before we use implementation from nixpkgs
inputs.pkgs.nautilus
# needed for xwayland
inputs.pkgs.xwayland-satellite
];
};
xdg.portal.extraPortals = (builtins.map (p: inputs.pkgs."xdg-desktop-portal-${p}") [ "gtk" "wlr" "gnome" ]);
qt = { enable = true; platformTheme = "qt5ct"; };
gtk.iconCache.enable = true;
i18n.inputMethod =
{
enable = true;
type = "fcitx5";
fcitx5.addons = with inputs.pkgs;
[ qt6Packages.fcitx5-chinese-addons fcitx5-mozc fcitx5-material-color fcitx5-gtk ];
};
programs = { dconf.enable = true; niri.enable = true; };
nixos.user.sharedModules = [(hmInputs:
{
config.programs =
{
dank-material-shell =
{
gtk =
{
enable = true;
theme.name = "Breeze";
gtk2 =
{
extraConfig = ''gtk-im-module="fcitx"'';
configLocation = "${hmInputs.config.xdg.configHome}/gtk-2.0/gtkrc";
force = true;
};
gtk3.extraConfig.gtk-im-module = "fcitx";
gtk4.extraConfig.gtk-im-module = "fcitx";
};
enable = true;
niri.enableKeybinds = true;
systemd = { enable = true; restartIfChanged = true; };
};
})];
})
# niri
(inputs.lib.mkIf (gui.implementation == "niri")
{
programs.niri.enable = true;
nixos.user.sharedModules = [(hmInputs:
{
config.programs.dankMaterialShell = { enable = true; niri.enableKeybinds = true; systemd.enable = true; };
})];
# niri module will auto enable this, disable it to avoid conflict with system ssh-agent and kwallet
services.gnome = { gcr-ssh-agent.enable = false; gnome-keyring.enable = inputs.lib.mkForce false; };
})
# niri setup kwallet
(inputs.lib.mkIf (gui.implementation == "niri")
{
nixos.packages.packages._packages = with inputs.pkgs.kdePackages; [ kwallet kwalletmanager kwallet-pam ];
xdg.portal.extraPortals = [ inputs.pkgs.kdePackages.kwallet ];
security.pam.services.login.kwallet = { enable = true; package = inputs.pkgs.kdePackages.kwallet-pam; };
services.dbus.packages = inputs.lib.singleton
(inputs.pkgs.writeTextDir "share/dbus-1/services/org.freedesktop.secrets.service"
''
[D-BUS Service]
Name=org.freedesktop.secrets
Exec=${inputs.pkgs.kdePackages.kwallet}/bin/kwalletd6
'');
})
];
niri.settings =
{
binds =
let
xsel = "${inputs.pkgs.xsel}/bin/xsel";
wl-copy = "${inputs.pkgs.wl-clipboard}/bin/wl-copy";
wl-paste = "${inputs.pkgs.wl-clipboard}/bin/wl-paste";
in
{
"Mod+WheelScrollDown" = { action.focus-column-right = {}; cooldown-ms = 50; };
"Mod+WheelScrollUp" = { action.focus-column-left = {}; cooldown-ms = 50; };
"Mod+Left".action.focus-column-left = {};
"Mod+Right".action.focus-column-right = {};
"Mod+MouseMiddle".action.close-window = {};
"Mod+L".action.spawn = [ "dms" "ipc" "lock" "lock" ];
"Mod+W".action.move-workspace-to-monitor-next = {};
"Mod+Ctrl+C".action.spawn = [ "sh" "-c" "${xsel} -ob | ${wl-copy}" ];
"Mod+Ctrl+V".action.spawn = [ "sh" "-c" "${wl-paste} -n | ${xsel} -ib" ];
"Mod+S".action.screenshot = {};
"Mod+F".action.switch-preset-column-width = {};
"Mod+T".action.spawn = [ "ghostty" ];
"Mod+B".action.spawn = [ "firefox" ];
"Mod+Escape".action.power-off-monitors = {};
};
outputs =
{
"Tianma Microelectronics Ltd. TL134ADXP03 Unknown" =
{ scale = 1; position = { x = 0; y = 0; }; mode = { width = 2560; height = 1600; refresh = 180.; }; };
"Xiaomi Corporation Mi Monitor 0x00000001" =
{
scale = 1;
position = { x = 0; y = -2160; };
mode = { width = 3840; height = 2160; refresh = 160.; };
};
};
input =
{
touchpad.dwt = true;
keyboard.numlock = true;
power-key-handling.enable = false;
focus-follows-mouse = { enable = true; max-scroll-amount="10%"; };
};
layout =
{
default-column-width.proportion = 0.5;
preset-column-widths = [ { proportion = 0.5; } { proportion = 1.; } ];
};
spawn-at-startup =
[
{ argv = [ "Telegram" "-startintray" ]; }
{ argv = [ "steam" "-silent" ]; }
{ argv = [ "element-desktop" "--hidden" ]; }
{ argv = [ "discord" "--start-minimized" "--no-startup-id" ]; }
];
};
};
})];
# use polkit from dms
systemd.user.services.niri-flake-polkit.enable = false;
};
}

109
modules/system/kernel.nix Normal file
View File

@@ -0,0 +1,109 @@
inputs:
{
options.nixos.system.kernel = let inherit (inputs.lib) mkOption types; in
{
variant = mkOption
{
type = types.nullOr
(types.enum [ "nixos" "xanmod-lts" "xanmod-latest" "xanmod-unstable" "cachyos" "cachyos-rc" ]);
default = { x86_64 = "xanmod-lts"; aarch64 = "nixos"; }.${inputs.config.nixos.model.arch};
};
patches = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
};
config = let inherit (inputs.config.nixos.system) kernel; in
{
boot =
{
kernelModules = [ "br_netfilter" ];
# modprobe --show-depends
initrd.availableKernelModules =
[
"bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "sd_mod"
"sr_mod" "usbcore" "usbhid" "usbip-core" "usb-common" "usb_storage" "vhci-hcd" "virtio" "virtio_blk"
"virtio_net" "virtio_ring" "virtio_scsi" "cryptd" "libaes"
"ahci" "ata_piix" "nvme" "sdhci_acpi" "virtio_pci" "xhci_pci"
# network for nas
"igb"
# disk for srv1
"megaraid_sas"
# disks for cluster
"nfs" "nfsv4"
# netowrk for srv1
"bnx2x" "tg3"
# network for srv2
"e1000e" "igb" "atlantic" "igc" "tg3"
# network for srv3
"igb"
# touchscreen for one
"i2c-hid-acpi"
# bridge network
"bridge"
# disk for nas
"ahci" "nvme" "igc"
# tf card for pc
"sdhci_pci"
# to mount some fat32 disk
"nls_ascii"
]
# touchscreen for one
++ (inputs.lib.optionals (inputs.config.nixos.model.arch == "x86_64") [ "pinctrl-tigerlake" ]);
extraModulePackages = inputs.lib.optionals (inputs.pkgs.stdenv.hostPlatform.linuxArch == "x86_64")
[ inputs.config.boot.kernelPackages.zenpower ];
kernelParams = inputs.lib.mkMerge
[
[ "delayacct" ]
(inputs.lib.mkIf (builtins.elem "btrfs" kernel.patches) [ "btrfs.read_policy=queue" ])
];
kernelPackages = inputs.lib.mkIf (kernel.variant != null)
{
nixos = inputs.pkgs.linuxPackages;
xanmod-lts = inputs.pkgs.linuxPackages_xanmod;
xanmod-latest = inputs.pkgs.linuxPackages_xanmod_latest;
cachyos = inputs.pkgs.cachyosKernels.linuxPackages-cachyos-latest;
}.${kernel.variant};
kernelPatches =
let
version = inputs.lib.versions.majorMinor inputs.config.boot.kernelPackages.kernel.version;
patches =
{
btrfs = [(inputs.topInputs.self.src.btrfs.${version} // { name = "btrfs"; })];
asus = builtins.map
(file:
{
name = "asus-${file}";
patch = "${inputs.topInputs.linux-asus}/${file}";
})
[
# copy from PKGBUILD
"0001-platform-x86-asus-wmi-export-symbols-used-for-read-w.patch"
"0002-platform-x86-asus-armoury-move-existing-tunings-to-a.patch"
"0003-platform-x86-asus-armoury-add-panel_hd_mode-attribut.patch"
"0004-platform-x86-asus-armoury-add-apu-mem-control-suppor.patch"
"0005-platform-x86-asus-armoury-add-screen-auto-brightness.patch"
"0006-platform-x86-asus-wmi-deprecate-bios-features.patch"
"0007-platform-x86-asus-wmi-rename-ASUS_WMI_DEVID_PPT_FPPT.patch"
"0008-platform-x86-asus-armoury-add-ppt_-and-nv_-tuning-kn.patch"
"0001-platform-x86-asus-armoury-Fix-error-code-in-mini_led.patch"
"0002-platform-x86-asus-armoury-fix-mini-led-mode-show.patch"
"0003-platform-x86-asus-armoury-add-support-for-FA507UV.patch"
"0001-platform-x86-asus-armoury-fix-only-DC-tunables-being.patch"
"PATCH-v10-00-11-HID-asus-Fix-ASUS-ROG-Laptop-s-Keyboard-backlight-handling.patch"
"PATCH-v10-00-11-HID-asus-Fix-ASUS-ROG-Laptop-s-Keyboard-backlight-handling-id1-id2-pr_err.patch"
"0001-platform-x86-asus-wmi-fix-initializing-TUFs-keyboard.patch"
"0002-platform-x86-asus-armoury-add-keyboard-control-firmw.patch"
"0001-acpi-proc-idle-skip-dummy-wait.patch"
"PATCH-v5-00-11-Improvements-to-S5-power-consumption.patch"
"PATCH-asus-wmi-fixup-screenpad-brightness.patch"
"asus-patch-series.patch"
"0070-acpi-x86-s2idle-Add-ability-to-configure-wakeup-by-A.patch"
"0040-workaround_hardware_decoding_amdgpu.patch"
"0081-amdgpu-adjust_plane_init_off_by_one.patch"
"0084-enable-steam-deck-hdr.patch"
"sys-kernel_arch-sources-g14_files-0047-asus-nb-wmi-Add-tablet_mode_sw-lid-flip.patch"
"sys-kernel_arch-sources-g14_files-0048-asus-nb-wmi-fix-tablet_mode_sw_int.patch"
];
};
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
};
};
}

View File

@@ -1,85 +0,0 @@
inputs:
{
options.nixos.system.kernel = let inherit (inputs.lib) mkOption types; in
{
variant = mkOption
{
type = types.nullOr
(types.enum [ "nixos" "xanmod-lts" "xanmod-latest" "xanmod-unstable" "cachyos" "cachyos-rc" ]);
default = { x86_64 = "xanmod-lts"; aarch64 = "nixos"; }.${inputs.config.nixos.model.arch};
};
patches = mkOption { type = types.listOf types.nonEmptyStr; default = []; };
};
config = let inherit (inputs.config.nixos.system) kernel; in
{
boot =
{
kernelModules = [ "br_netfilter" ];
# modprobe --show-depends
initrd.availableKernelModules =
[
"bfq" "failover" "net_failover" "nls_cp437" "nls_iso8859-1" "sd_mod"
"sr_mod" "usbcore" "usbhid" "usbip-core" "usb-common" "usb_storage" "vhci-hcd" "virtio" "virtio_blk"
"virtio_net" "virtio_ring" "virtio_scsi" "cryptd" "libaes"
"ahci" "ata_piix" "nvme" "sdhci_acpi" "virtio_pci" "xhci_pci"
# network for nas
"igb"
# disk for srv1
"megaraid_sas"
# disks for cluster
"nfs" "nfsv4"
# netowrk for srv1
"bnx2x" "tg3"
# network for srv2
"e1000e" "igb" "atlantic" "igc" "tg3"
# network for srv3
"igb"
# touchscreen for one
"i2c-hid-acpi"
# bridge network
"bridge"
# disk for nas
"ahci" "nvme" "igc"
]
# touchscreen for one
++ (inputs.lib.optionals (inputs.config.nixos.model.arch == "x86_64") [ "pinctrl-tigerlake" ]);
extraModulePackages = with inputs.config.boot.kernelPackages;
[
v4l2loopback
(if inputs.pkgs.stdenv.hostPlatform.linuxArch == "x86_64" then zenpower else inputs.pkgs.emptyDirectory)
];
# force i2c-hid-acpi to load after pinctrl-tigerlake
extraModprobeConfig = "softdep i2c-hid-acpi pre: pinctrl-tigerlake";
kernelParams = inputs.lib.mkMerge
[
[ "delayacct" ]
(inputs.lib.mkIf (builtins.elem "btrfs" kernel.patches) [ "btrfs.read_policy=queue" ])
];
kernelPackages = inputs.lib.mkIf (kernel.variant != null)
{
nixos = inputs.pkgs.linuxPackages;
xanmod-lts = inputs.pkgs.linuxPackages_xanmod;
xanmod-latest = inputs.pkgs.linuxPackages_xanmod_latest;
xanmod-unstable = inputs.pkgs.pkgs-unstable.linuxPackages_xanmod_latest;
cachyos = inputs.pkgs.linuxPackages_cachyos-gcc;
cachyos-rc = inputs.pkgs.linuxPackages_cachyos-rc;
}.${kernel.variant};
kernelPatches =
let patches =
{
hibernate-progress = [{ name = "hibernate-progress"; patch = ./hibernate-progress.patch; }];
btrfs =
[{
name = "btrfs";
patch = inputs.pkgs.fetchurl
{
url = "https://github.com/kakra/linux/pull/36.patch";
sha256 = "0wimihsvrxib6g23jcqdbvqlkqk6nbqjswfx9bzmpm1vlvzxj8m0";
};
structuredExtraConfig.BTRFS_EXPERIMENTAL = inputs.lib.kernel.yes;
}];
};
in builtins.concatLists (builtins.map (name: patches.${name}) kernel.patches);
};
};
}

View File

@@ -1,128 +0,0 @@
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 5bc04bfe2db1..6e7b17b97de7 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -563,7 +563,7 @@ static int save_image(struct swap_map_handle *handle,
hib_init_batch(&hb);
- pr_info("Saving image data pages (%u pages)...\n",
+ pr_err("Saving image data pages (%u pages)...\n",
nr_to_write);
m = nr_to_write / 10;
if (!m)
@@ -578,7 +578,7 @@ static int save_image(struct swap_map_handle *handle,
if (ret)
break;
if (!(nr_pages % m))
- pr_info("Image saving progress: %3d%%\n",
+ pr_err("Image saving progress: %3d%%\n",
nr_pages / m * 10);
nr_pages++;
}
@@ -588,7 +588,7 @@ static int save_image(struct swap_map_handle *handle,
if (!ret)
ret = err2;
if (!ret)
- pr_info("Image saving done\n");
+ pr_err("Image saving done\n");
swsusp_show_speed(start, stop, nr_to_write, "Wrote");
return ret;
}
@@ -795,8 +795,8 @@ static int save_compressed_image(struct swap_map_handle *handle,
*/
handle->reqd_free_pages = reqd_free_pages();
- pr_info("Using %u thread(s) for %s compression\n", nr_threads, hib_comp_algo);
- pr_info("Compressing and saving image data (%u pages)...\n",
+ pr_err("Using %u thread(s) for %s compression\n", nr_threads, hib_comp_algo);
+ pr_err("Compressing and saving image data (%u pages)...\n",
nr_to_write);
m = nr_to_write / 10;
if (!m)
@@ -817,7 +817,7 @@ static int save_compressed_image(struct swap_map_handle *handle,
data_of(*snapshot), PAGE_SIZE);
if (!(nr_pages % m))
- pr_info("Image saving progress: %3d%%\n",
+ pr_err("Image saving progress: %3d%%\n",
nr_pages / m * 10);
nr_pages++;
}
@@ -888,9 +888,9 @@ static int save_compressed_image(struct swap_map_handle *handle,
if (!ret)
ret = err2;
if (!ret)
- pr_info("Image saving done\n");
+ pr_err("Image saving done\n");
swsusp_show_speed(start, stop, nr_to_write, "Wrote");
- pr_info("Image size after compression: %d kbytes\n",
+ pr_err("Image size after compression: %d kbytes\n",
(atomic_read(&compressed_size) / 1024));
out_clean:
@@ -1105,7 +1105,7 @@ static int load_image(struct swap_map_handle *handle,
hib_init_batch(&hb);
clean_pages_on_read = true;
- pr_info("Loading image data pages (%u pages)...\n", nr_to_read);
+ pr_err("Loading image data pages (%u pages)...\n", nr_to_read);
m = nr_to_read / 10;
if (!m)
m = 1;
@@ -1123,7 +1123,7 @@ static int load_image(struct swap_map_handle *handle,
if (ret)
break;
if (!(nr_pages % m))
- pr_info("Image loading progress: %3d%%\n",
+ pr_err("Image loading progress: %3d%%\n",
nr_pages / m * 10);
nr_pages++;
}
@@ -1133,7 +1133,7 @@ static int load_image(struct swap_map_handle *handle,
if (!ret)
ret = err2;
if (!ret) {
- pr_info("Image loading done\n");
+ pr_err("Image loading done\n");
ret = snapshot_write_finalize(snapshot);
if (!ret && !snapshot_image_loaded(snapshot))
ret = -ENODATA;
@@ -1328,8 +1328,8 @@ static int load_compressed_image(struct swap_map_handle *handle,
}
want = ring_size = i;
- pr_info("Using %u thread(s) for %s decompression\n", nr_threads, hib_comp_algo);
- pr_info("Loading and decompressing image data (%u pages)...\n",
+ pr_err("Using %u thread(s) for %s decompression\n", nr_threads, hib_comp_algo);
+ pr_err("Loading and decompressing image data (%u pages)...\n",
nr_to_read);
m = nr_to_read / 10;
if (!m)
@@ -1459,7 +1459,7 @@ static int load_compressed_image(struct swap_map_handle *handle,
data[thr].unc + off, PAGE_SIZE);
if (!(nr_pages % m))
- pr_info("Image loading progress: %3d%%\n",
+ pr_err("Image loading progress: %3d%%\n",
nr_pages / m * 10);
nr_pages++;
@@ -1485,7 +1485,7 @@ static int load_compressed_image(struct swap_map_handle *handle,
}
stop = ktime_get();
if (!ret) {
- pr_info("Image loading done\n");
+ pr_err("Image loading done\n");
ret = snapshot_write_finalize(snapshot);
if (!ret && !snapshot_image_loaded(snapshot))
ret = -ENODATA;
@@ -1593,7 +1593,7 @@ int swsusp_check(bool exclusive)
}
if (!error && swsusp_header->flags & SF_HW_SIG &&
swsusp_header->hw_sig != swsusp_hardware_signature) {
- pr_info("Suspend image hardware signature mismatch (%08x now %08x); aborting resume.\n",
+ pr_err("Suspend image hardware signature mismatch (%08x now %08x); aborting resume.\n",
swsusp_header->hw_sig, swsusp_hardware_signature);
error = -EINVAL;
}

View File

@@ -40,9 +40,9 @@ inputs:
keep-outputs = false;
connect-timeout = 5;
# https://cache.nixos.org 已经自带
substituters = [ "https://nix-store.chn.moe" "https://nix-store.nas.chn.moe" ];
substituters = [ "https://nix-store.chn.moe" ];
build-dir = "/var/cache/nix";
};
systemd.services.nix-daemon = { serviceConfig.CacheDirectory = "nix"; environment.TMPDIR = "/var/cache/nix"; };
}
# nix daemon use lower io/cpu priority
{ nix = { daemonIOSchedClass = "idle"; daemonCPUSchedPolicy = "idle"; }; }
@@ -69,8 +69,6 @@ inputs:
}
# marches
{ nix.settings.system-features = builtins.map (march: "gccarch-${march}") nix.marches; }
# includeBuildDependencies
{ system.includeBuildDependencies = inputs.topInputs.self.config.branch == "archive"; }
# remote.slave
(inputs.lib.mkIf (nix.remote.slave != null)
{

View File

@@ -41,13 +41,13 @@ inputs:
};
loginLimits =
[
{ domain = "@users"; item = "nofile"; value = 65536; }
{ domain = "@users"; item = "nofile"; value = 524288; }
{ domain = "@users"; item = "stack"; value = "unlimited"; }
];
};
sudo.extraConfig = "Defaults pwfeedback";
};
systemd.user.extraConfig = "DefaultLimitNOFILE=65536:524288";
systemd.user.extraConfig = "DefaultLimitNOFILE=524288:524288";
# needed by xray tproxy if we want to forward traffic from other machine
networking.firewall.checkReversePath = false;
};

View File

@@ -13,7 +13,6 @@ inputs:
{ id = "nngceckbapebfimnlniiiahkandclblb"; } # Bitwarden
{ id = "kbfnbcaeplbcioakkpcpgfkobkghlhen"; } # Grammarly
{ id = "ihnfpdchjnmlehnoeffgcbakfmdjcckn"; } # Pixiv Fanbox Downloader
{ id = "cimiefiiaegbelhefglklhhakcgmhkai"; } # Plasma Integration
{ id = "dkndmhgdcmjdmkdonmbgjpijejdcilfh"; } # Powerful Pixiv Downloader
{ id = "padekgcemlokbadohgkifijomclgjgif"; } # Proxy SwitchyOmega
{ id = "kefjpfngnndepjbopdmoebkipbgkggaa"; } # RSSHub Radar

View File

@@ -22,41 +22,36 @@ inputs:
ssd = inputs.lib.mkOption { type = inputs.lib.types.bool; default = false; };
};}));
};
config =
config.home =
{
programs.git.settings.user = { name = "chn"; email = "chn@chn.moe"; };
home =
{
file.groupshare.enable = false;
packages =
[
(
let
servers = inputs.localLib.attrsToList hmInputs.config.nixos.decrypt;
cat = "${inputs.pkgs.coreutils}/bin/cat";
gpg = "${inputs.pkgs.gnupg}/bin/gpg";
ssh = "${inputs.pkgs.openssh}/bin/ssh";
# generate using echo -n key | gpg --encrypt --recipient chn > xxx.key
in inputs.pkgs.writeShellScriptBin "remote-decrypt" (builtins.concatStringsSep "\n"
(
(builtins.map (system: builtins.concatStringsSep "\n"
[
"decrypt-${system.name}() {"
" key=$(${cat} ${inputs.topInputs.self}/devices/cross/luks-manual/${system.name}.key \\"
" | ${gpg} --decrypt)"
(builtins.concatStringsSep "\n" (builtins.map
(device: " echo $key | ${ssh} root@initrd.${system.name}.chn.moe cryptsetup luksOpen "
+ (if device.value.ssd then "--allow-discards " else "")
+ "${device.name} ${device.value.mapper} -")
(inputs.localLib.attrsToList system.value)))
"}"
])
servers)
++ [ "decrypt-$1" ]
))
)
];
};
packages =
[
(
let
servers = inputs.localLib.attrsToList hmInputs.config.nixos.decrypt;
cat = "${inputs.pkgs.coreutils}/bin/cat";
gpg = "${inputs.pkgs.gnupg}/bin/gpg";
ssh = "${inputs.pkgs.openssh}/bin/ssh";
# generate using echo -n key | gpg --encrypt --recipient chn > xxx.key
in inputs.pkgs.writeShellScriptBin "remote-decrypt" (builtins.concatStringsSep "\n"
(
(builtins.map (system: builtins.concatStringsSep "\n"
[
"decrypt-${system.name}() {"
" key=$(${cat} ${inputs.topInputs.self}/devices/cross/luks-manual/${system.name}.key \\"
" | ${gpg} --decrypt)"
(builtins.concatStringsSep "\n" (builtins.map
(device: " echo $key | ${ssh} root@initrd.${system.name}.chn.moe cryptsetup luksOpen "
+ (if device.value.ssd then "--allow-discards " else "")
+ "${device.name} ${device.value.mapper} -")
(inputs.localLib.attrsToList system.value)))
"}"
])
servers)
++ [ "decrypt-$1" ]
))
)
];
};
};
};

View File

@@ -23,6 +23,7 @@ inputs:
tlstimeout = 3600;
transfer.maxretries = 1;
};
user = { name = "Haonan Chen"; email = "chn@chn.moe"; };
};
};
delta =

View File

@@ -1,51 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (inputs.config.nixos.model.type == "desktop")
{
home-manager.users.chn.config.home.file =
let
programs =
{
nheko = rec
{
fileName = "nheko.desktop";
path = "${inputs.pkgs.nheko}/share/applications/${fileName}";
};
telegram = rec
{
fileName = "org.telegram.desktop.desktop";
path = inputs.pkgs.writeText fileName (builtins.replaceStrings
[ "Exec=telegram-desktop -- %u" ] [ "Exec=telegram-desktop -autostart" ]
(builtins.readFile "${inputs.pkgs.telegram-desktop}/share/applications/${fileName}"));
};
element = rec
{
fileName = "element-desktop.desktop";
path = inputs.pkgs.writeText fileName (builtins.replaceStrings
[ "Exec=element-desktop %u" ] [ "Exec=element-desktop --hidden" ]
(builtins.readFile "${inputs.pkgs.element-desktop.desktopItem}/share/applications/${fileName}"));
};
discord = rec
{
fileName = "discord.desktop";
path = inputs.pkgs.writeText fileName (builtins.replaceStrings
[ "Exec=Discord" ] [ "Exec=Discord --start-minimized" ]
(builtins.readFile "${inputs.pkgs.discord.desktopItem}/share/applications/${fileName}"));
};
crow-translate = rec
{
fileName = "org.kde.CrowTranslate.desktop";
path = "${inputs.pkgs.crow-translate}/share/applications/${fileName}";
};
};
devices.pc = [ "nheko" "telegram" "element" "discord" "crow-translate" ];
in builtins.listToAttrs (builtins.map
(file:
{
name = ".config/autostart/${programs.${file}.fileName}";
value.source = programs.${file}.path;
})
(devices.${inputs.config.nixos.model.hostname} or []));
environment.persistence."/nix/rootfs/current".users.chn.directories = [ ".config/autostart" ];
};
}

View File

@@ -1,98 +0,0 @@
inputs:
{
imports = inputs.localLib.findModules ./.;
config = inputs.lib.mkIf
(inputs.config.nixos.packages.desktop != null && inputs.config.nixos.system.gui.implementation == "kde")
{
home-manager.users.chn.config.programs.plasma = inputs.lib.mkMerge
[
# TODO: panel, discard user changed settings
# kwin
{
kwin =
{
titlebarButtons =
{
right = [ "help" "keep-below-windows" "keep-above-windows" "minimize" "maximize" "close" ];
left = [ "more-window-actions" ];
};
virtualDesktops = inputs.lib.mkIf (inputs.config.nixos.model.hostname == "pc") { rows = 2; number = 6; };
effects = { shakeCursor.enable = true; desktopSwitching.animation = "slide"; };
};
windows.allowWindowsToRememberPositions = false;
configFile =
{
plasmanotifyrc.Notifications.PopupPosition.value = "BottomRight";
kwinrc =
{
Tiling.padding.value = 4;
Wayland.InputMethod.value = "/run/current-system/sw/share/applications/fcitx5-wayland-launcher.desktop";
Windows.RollOverDesktops.value = true;
Compositing = { AllowTearing.value = false; WindowsBlockCompositing.value = false; };
};
};
}
# dolphin and file chooser
{
configFile =
{
dolphinrc =
{
General = { ShowFullPath.value = true; FilterBar.value = true; RememberOpenedTabs.value = false; };
PreviewSettings.Plugins.value = builtins.concatStringsSep ","
[
"blenderthumbnail"
"comicbookthumbnail"
"djvuthumbnail"
"ebookthumbnail"
"exrthumbnail"
"marble_thumbnail_geojson"
"marble_thumbnail_gpx"
"jpegthumbnail"
"marble_thumbnail_kmz"
"marble_thumbnail_kml"
"kraorathumbnail"
"windowsimagethumbnail"
"windowsexethumbnail"
"mltpreview"
"mobithumbnail"
"opendocumentthumbnail"
"marble_thumbnail_osm"
"palathumbcreator"
"gsthumbnail"
"rawthumbnail"
"svgthumbnail"
"imagethumbnail"
"fontthumbnail"
"directorythumbnail"
"textthumbnail"
"webarchivethumbnail"
"ffmpegthumbs"
"audiothumbnail"
];
};
kdeglobals."KFileDialog Settings" =
{
"Allow Expansion".value = true;
"Automatically select filename extension".value = true;
"Show Bookmarks".value = true;
"Show Full Path".value = true;
"Show Inline Previews".value = true;
"Show Preview".value = true;
"Show Speedbar".value = true;
"Show hidden files".value = true;
"Sort by".value = "Name";
"Sort directories first".value = true;
"Sort hidden files last".value = true;
"View Style".value = "DetailTree";
};
};
workspace.clickItemTo = "open";
}
# krunner
{ configFile.krunnerrc = { General.FreeFloating.value = true; Plugins.baloosearchEnabled.value = false; }; }
# lock screen
{ configFile.kscreenlockerrc.Daemon.Autolock.value = false; }
];
};
}

View File

@@ -1,99 +0,0 @@
inputs:
{
config = inputs.lib.mkIf
(inputs.config.nixos.model.type == "desktop" && inputs.config.nixos.system.gui.implementation == "kde")
{
home-manager.users.chn.config.programs.plasma =
{
overrideConfig = true;
resetFiles = [ "kglobalshortcutsrc" "khotkeysrc" ];
spectacle.shortcuts.captureRectangularRegion = "Print";
shortcuts = inputs.lib.mkMerge
[
# firefox
{ "firefox.desktop"._launch = "Meta+B"; }
# crow translate
{ "io.crow_translate.CrowTranslate.desktop".TranslateSelectedText = "Ctrl+Alt+E"; }
# display
{
kded5.display = [ "Display" "Meta+P" ];
kwin = { view_actual_size = "Meta+0"; view_zoom_in = [ "Meta++" "Meta+=" ]; view_zoom_out = "Meta+-"; };
org_kde_powerdevil =
{
"Decrease Screen Brightness" = "Monitor Brightness Down";
"Increase Screen Brightness" = "Monitor Brightness Up";
};
}
# volume
{
kmix =
{
decrease_volume = "Volume Down";
increase_volume = "Volume Up";
mic_mute = [ "Meta+Volume Mute" ];
mute = "Volume Mute";
};
}
# session
{
ksmserver = { "Lock Session" = [ "Meta+L" "Screensaver" ]; "Log Out" = "Ctrl+Alt+Del"; };
org_kde_powerdevil."Turn Off Screen" = "Meta+Ctrl+L";
}
# window
{
kwin =
{
ExposeAll = "Meta+Tab";
"Show Desktop" = "Meta+D";
"Suspend Compositing" = "Alt+Shift+F12";
"Walk Through Windows" = "Alt+Tab";
"Walk Through Windows (Reverse)" = "Alt+Shift+Backtab";
"Window Above Other Windows" = "Meta+Shift+Up";
"Window Below Other Windows" = "Meta+Shift+Down";
"Window Close" = "Alt+F4";
"Window Maximize" = "Meta+Ctrl+Up";
"Window Minimize" = "Meta+Ctrl+Down";
"Window Operations Menu" = "Alt+F3";
"Window Quick Tile Bottom" = "Meta+Down";
"Window Quick Tile Left" = "Meta+Left";
"Window Quick Tile Right" = "Meta+Right";
"Window Quick Tile Top" = "Meta+Up";
};
}
# virtual desktop
{
kwin =
{
"Switch to Previous Desktop" = [ "Ctrl+PgUp" "Ctrl+Num+PgUp" ];
"Switch to Next Desktop" = [ "Ctrl+PgDown" "Ctrl+Num+PgDown" ];
"Window to Previous Desktop" = [ "Meta+Ctrl+PgUp" "Meta+Ctrl+Num+PgUp" ];
"Window to Next Desktop" = [ "Meta+Ctrl+PgDown" "Meta+Ctrl+Num+PgDown" ];
};
}
# media
{
mediacontrol =
{
nextmedia = "Media Next";
pausemedia = "Media Pause";
playpausemedia = [ "Pause" "Media Play" ];
previousmedia = "Media Previous";
stopmedia = "Media Stop";
};
}
# dolphin
{ "org.kde.dolphin.desktop"._launch = "Meta+E"; }
# konsole
{ "org.kde.konsole.desktop"._launch = "Ctrl+Alt+T"; }
# krunner
{ "org.kde.krunner.desktop"._launch = "Alt+Space"; }
# settings
{ "systemsettings.desktop"._launch = "Meta+I"; }
# virt-manager
{ "virt-manager.desktop"._launch = "Meta+V"; }
# system monitor
{ "org.kde.plasma-systemmonitor.desktop"._launch = "Meta+Esc"; }
];
};
};
}

View File

@@ -1,7 +0,0 @@
inputs:
{
config = inputs.lib.mkIf (inputs.config.nixos.system.gui.implementation == "kde")
{
home-manager.users.chn.config.programs.plasma.configFile.kdeglobals.General.accentColorFromWallpaper.value = true;
};
}

View File

@@ -13,6 +13,7 @@ inputs:
xmuhk = { host = "xmuhk"; hostname = "10.26.14.64"; user = "xmuhk"; };
xmuhk2 = { host = "xmuhk2"; hostname = "183.233.219.132"; user = "xmuhk"; port = 62022; };
jykang.setEnv.TERM = "chn_unset_ls_colors:chn_cd:linwei/chn:xterm-256color";
wlin.setEnv.TERM = "xterm-256color";
"tinc0.jykang" = jykang;
};
extraConfig = inputs.lib.mkIf inputs.config.nixos.model.private

View File

@@ -41,6 +41,7 @@ inputs:
twr = 1027;
lsp = 1028;
lilydjwg = 1029;
stq = 1030;
misskey-misskey = 2000;
misskey-misskey-old = 2001;
frp = 2002;
@@ -55,6 +56,7 @@ inputs:
hpcstat = 2011;
speedtest = 2012;
tailscale = 2013;
missgram = 2014;
};
};
gid = mkOption
@@ -132,7 +134,7 @@ inputs:
{
programs.git.settings =
{
user = { name = "chn"; email = "chn@chn.moe"; };
user = { name = "Haonan Chen"; email = "chn@chn.moe"; };
# allow root operate on git repositories owned by others
safe.directory = "*";
};

1
modules/user/keys/stq Normal file
View File

@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXkM8TS8fDot22LTfU2jDVOqK20LmK8Rd7xO05vYns stq

1
nixpkgs Submodule

Submodule nixpkgs added at d8ca282fc0

View File

@@ -13,8 +13,7 @@ endif()
find_package(magic_enum REQUIRED)
find_package(fmt REQUIRED)
find_package(Boost REQUIRED COMPONENTS headers iostreams filesystem system process stacktrace_from_exception
stacktrace_backtrace)
find_package(Boost REQUIRED COMPONENTS headers iostreams filesystem system process)
find_package(range-v3 REQUIRED)
find_path(NAMEOF_INCLUDE_DIR nameof.hpp REQUIRED)
find_package(Eigen3 REQUIRED)
@@ -22,13 +21,14 @@ set(HIGHFIVE_FIND_HDF5 Off)
find_package(HighFive REQUIRED)
find_path(ZPP_BITS_INCLUDE_DIR zpp_bits.h REQUIRED)
find_package(TgBot REQUIRED)
find_path(LIBBACKTRACE_INCLUDE_DIR backtrace.h REQUIRED)
find_library(LIBBACKTRACE_LIBRARY NAMES backtrace REQUIRED)
find_package(HDF5 REQUIRED)
find_package(concurrencpp REQUIRED)
find_path(POCKETFFT_INCLUDE_DIR pocketfft.h REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(glaze REQUIRED)
find_package(cpptrace REQUIRED)
# on static build, cpptrace requires zlib
find_library(ZLIB_LIBRARY NAMES z REQUIRED)
add_library(biu src/common.cpp src/hdf5.cpp src/string.cpp)
target_include_directories(biu PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
@@ -36,7 +36,7 @@ target_include_directories(biu PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_D
${LIBBACKTRACE_INCLUDE_DIR} ${POCKETFFT_INCLUDE_DIR})
target_link_libraries(biu PUBLIC magic_enum::magic_enum fmt::fmt Boost::headers Boost::iostreams Boost::filesystem
range-v3::range-v3 Eigen3::Eigen HighFive TgBot::TgBot ${LIBBACKTRACE_LIBRARY} hdf5::hdf5 concurrencpp::concurrencpp
yaml-cpp::yaml-cpp glaze::glaze Boost::process Boost::stacktrace_from_exception Boost::stacktrace_backtrace)
yaml-cpp::yaml-cpp glaze::glaze Boost::process cpptrace::cpptrace ${ZLIB_LIBRARY})
target_compile_features(biu PUBLIC cxx_std_23)
target_compile_options(biu PUBLIC -Wno-gnu-string-literal-operator-template)
install(TARGETS biu EXPORT biuTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@@ -1,18 +1,16 @@
include("${CMAKE_CURRENT_LIST_DIR}/biuTargets.cmake")
find_package(magic_enum REQUIRED)
find_package(fmt REQUIRED)
find_package(Boost REQUIRED COMPONENTS headers iostreams filesystem system process stacktrace_from_exception
stacktrace_backtrace)
find_package(Boost REQUIRED COMPONENTS headers iostreams filesystem system process)
find_package(range-v3 REQUIRED)
find_path(NAMEOF_INCLUDE_DIR nameof.hpp REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(HighFive REQUIRED)
find_path(ZPP_BITS_INCLUDE_DIR zpp_bits.h REQUIRED)
find_package(TgBot REQUIRED)
find_path(LIBBACKTRACE_INCLUDE_DIR backtrace.h REQUIRED)
find_library(LIBBACKTRACE_LIBRARY NAMES backtrace REQUIRED)
find_package(HDF5 REQUIRED)
find_package(concurrencpp REQUIRED)
find_path(POCKETFFT_INCLUDE_DIR pocketfft.h REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(glaze REQUIRED)
find_package(cpptrace REQUIRED)

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