mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 05:29:23 +08:00
Compare commits
275 Commits
edge
...
93b1e4f146
| Author | SHA1 | Date | |
|---|---|---|---|
| 93b1e4f146 | |||
| b71484eca4 | |||
| 3c37a9288c | |||
| 2532d3cf70 | |||
| 1e65495897 | |||
| f2a9d285f3 | |||
| ef8f516ab3 | |||
| d8b96a32e8 | |||
| 085fde23ba | |||
| 5de71b4f6d | |||
| 682fb5d0a4 | |||
| a4ebf16124 | |||
| 03e89c43d2 | |||
| e8786d4ace | |||
| 7b479a158b | |||
| 3e3e62838b | |||
| 0ac3e0f4bc | |||
| ef99027542 | |||
| c86ebb17f4 | |||
| 6eb1609f3e | |||
| b6dd4555a6 | |||
| 93dc607cb5 | |||
| f653471c23 | |||
| 0416427642 | |||
| 9595bed7c0 | |||
| e2556f3a04 | |||
| f5e70e16b2 | |||
| ebc05b9911 | |||
| 6efc29a7a4 | |||
| c0c8bc3704 | |||
| 73a1490fed | |||
| 1bb6e550d8 | |||
| c9bd7b48d7 | |||
| d1d27ce194 | |||
| 3f46eb23de | |||
| 4cb983ce32 | |||
| 87c6d0fab4 | |||
| e5f7e1650e | |||
| d92b202b8e | |||
| 4c3cb5fe5f | |||
| 2147ba2f2d | |||
| 58b1c596db | |||
| 2e278b2dba | |||
| 72067d23c5 | |||
| 94670e9cbe | |||
| 3ab4ecb5d2 | |||
| 63c647ceba | |||
| fb7e9156d0 | |||
| f2e2f34cbf | |||
| 7d09abee57 | |||
| e2921059f8 | |||
| acd2845377 | |||
| b1546505a5 | |||
| e067993a14 | |||
| ffd01db99b | |||
| e1879c6625 | |||
| 8587524732 | |||
| 8fba11e9a8 | |||
| 1de9f717ab | |||
| 3a34d1e962 | |||
| f7deb945ae | |||
| c3e1d2bfb7 | |||
| 8166c7ecee | |||
| 157dd0e844 | |||
| 0c80dde1d1 | |||
| 4d1f6eb6b5 | |||
| bf922747d5 | |||
| a1b4aa7803 | |||
| 3eb2495ebb | |||
| c36e0c52d6 | |||
| 222b0829c8 | |||
| 3b7e22fc52 | |||
| 5aebb72185 | |||
| 08023306d6 | |||
| ea91a75380 | |||
| 0211a71cfa | |||
| 37a5069c3a | |||
| da9e67c25e | |||
| 94a0b81122 | |||
| 4d10cb5301 | |||
| a097f7b85e | |||
| cd96c1a4ee | |||
| a1c9487e79 | |||
| 721c0af938 | |||
| 1d6a352978 | |||
| 58ea730d48 | |||
| 298b0e05f5 | |||
| 373e8c57ce | |||
| 019aa5850a | |||
| 32babff9d5 | |||
| 5f509a036e | |||
| 5c57f5232a | |||
| 7a7b645e9e | |||
| 3ff1802ded | |||
| f7f473dac8 | |||
| 969aa0dae5 | |||
| ebc6307ca7 | |||
| 403f4bf27f | |||
| 9188ffce9d | |||
| 972155935d | |||
| e7d931d5c1 | |||
| 43f782c44f | |||
| dd850c5984 | |||
| 058aa6996d | |||
| a315cb4ef8 | |||
| 87c0bd2e74 | |||
| c507e8d69d | |||
| 5305c9ee08 | |||
| ab15e27a41 | |||
| 9afb725ed1 | |||
| 2ecad08f6e | |||
| c2c85b06f3 | |||
| 9c88a9d573 | |||
| 06eaf9a1eb | |||
| bbaca57ed0 | |||
| e92d791bc3 | |||
| 0a5bbb14fe | |||
| 07c0fc44d0 | |||
| 57f57e8b18 | |||
| 864e8c0ca6 | |||
| 838853bccf | |||
| 4576d11bb9 | |||
| d5e0282abc | |||
| 9e66c845c1 | |||
| d507fcce11 | |||
| 4c8c0c8dce | |||
| 4e6c8562a0 | |||
| aba0881a16 | |||
| aee7d98f3c | |||
| 65931dd1c1 | |||
| e43c516841 | |||
| cae87abde3 | |||
| 7c774115f8 | |||
| 09dfc1e55c | |||
| ee8e980a61 | |||
| db5bf6bb6a | |||
| 5a6a49ab5b | |||
| 57efd0fb94 | |||
| 397d8bb767 | |||
| a5fc71da87 | |||
| 6c9d2555b9 | |||
| 36c5799364 | |||
| 705c24347a | |||
| c3670d2597 | |||
| 9d6f16ddcc | |||
| e9295fea05 | |||
| 592b40e73d | |||
| db31934f46 | |||
| 73c061a350 | |||
| a0cf0045df | |||
| a3be46d70c | |||
| b973738722 | |||
| e6d17c8ca6 | |||
| f317e2db15 | |||
| 3569aa1b9a | |||
| bafe32ad98 | |||
| 959722a509 | |||
| 2a39ec4c7f | |||
| 0c37f4c330 | |||
| d32d4398bb | |||
| d037f954a2 | |||
| 58d7b36ee3 | |||
| 9de070e6be | |||
| d5c8898db9 | |||
| f3af01e6e2 | |||
| dc22e56986 | |||
| 1d5a24807a | |||
| 0d2aff16a8 | |||
| 0d0fc6a75b | |||
| 61fb833ea5 | |||
| df52b19a1e | |||
| 01098e9c83 | |||
| 6611f65657 | |||
| ac6d0fc3e1 | |||
| c9e7700aa6 | |||
| 2950ac0878 | |||
| 6c68e5348c | |||
| 98e5e95dd3 | |||
| fc0c9a0f20 | |||
| 5ebd5f0f08 | |||
| 5d654bea66 | |||
| 188694ef8c | |||
| 7fd61ef0cb | |||
| 5d3abe7b8b | |||
| e09fc0e745 | |||
| 20a019d687 | |||
| 354543db24 | |||
| 6a1f8f4278 | |||
| 31999eada5 | |||
| af3750fa8b | |||
| faaff1cc61 | |||
| cb6b13638c | |||
| f03d4c366b | |||
| c12842ea3c | |||
| bf29b9d756 | |||
| e1c47cb73e | |||
| e296f09a77 | |||
| 18e18ebc24 | |||
| 5d54c09cb0 | |||
| bae5f8128d | |||
| 9d52c21faf | |||
| b8e1ed7078 | |||
| 1db32b29a2 | |||
| 37ba4f34e7 | |||
| 56d605f909 | |||
| 4c66ea44d0 | |||
| f83e3a9599 | |||
| ec1f9d7796 | |||
| bd8d336215 | |||
| bbca1b88d6 | |||
| f29e305dac | |||
| e74b8a4540 | |||
| 60bd4d124c | |||
| 115d215203 | |||
| cb9f11f184 | |||
| 84f96aa489 | |||
| 0e4d718c41 | |||
| e135d6bcd6 | |||
| dba82d6fb1 | |||
| 80431046a9 | |||
| ad5ae4e374 | |||
| 8f538040e1 | |||
| 475e245bec | |||
| 4e659c10a8 | |||
| f4fa1a80ef | |||
| 2ba6dc5b2e | |||
| 90a3e94060 | |||
| f8a641615d | |||
| 18202905a0 | |||
| 22a8ce2c62 | |||
| c49b6dee8f | |||
| 4815bd0236 | |||
| 19e568052f | |||
| 8af3fb18eb | |||
| 164f250860 | |||
| d5ece0aec5 | |||
| 16d882b022 | |||
| 78461b199f | |||
| 4306244d81 | |||
| 2cf730b48f | |||
| 21beab6252 | |||
| ad8711c2f4 | |||
| eb32b0c72c | |||
| 4e2354c202 | |||
| ef592ca014 | |||
| b1cfc26648 | |||
| bdf56d01cc | |||
| b03d8cfa06 | |||
| 715b15f9a5 | |||
| b10e890aa4 | |||
| 01f46ccc6a | |||
| ac6c528eba | |||
| ac60d7cd7f | |||
| 13ee2e6c7d | |||
| 8b102a87ef | |||
| d2145b713b | |||
| 1e3f630aa9 | |||
| 8685cfd3b2 | |||
| 64d691ba54 | |||
| cf479ec30d | |||
| b2a7dfadd3 | |||
| 5a02aaa27a | |||
| 56ca103c46 | |||
| 0bea81e0e1 | |||
| 4984093a1f | |||
| 2a7865fcbd | |||
| 64f658473a | |||
| 4fafc47e38 | |||
| 49c57b6ff7 | |||
| 84bfd59173 | |||
| 5bea46c07f | |||
| 52c4b028f0 | |||
| 9be88b4d4d | |||
| d016e5846c | |||
| 5fbda61b60 |
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1 +0,0 @@
|
||||
flake/branch.nix merge=ours
|
||||
@@ -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.
|
||||
|
||||
@@ -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})))
|
||||
];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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; }; };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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" # 孙天骐
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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 =
|
||||
{
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
9
devices/wlin/bsub.nix
Normal 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 ];
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
2
devices/wlin/files/.config/nix/nix.conf
Normal file
2
devices/wlin/files/.config/nix/nix.conf
Normal 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
|
||||
@@ -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
|
||||
|
||||
805
flake.lock
generated
805
flake.lock
generated
File diff suppressed because it is too large
Load Diff
38
flake.nix
38
flake.nix
@@ -3,39 +3,35 @@
|
||||
|
||||
inputs =
|
||||
{
|
||||
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-unstable";
|
||||
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-25.11";
|
||||
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,7 +52,6 @@
|
||||
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; };
|
||||
@@ -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}"; };
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
"production"
|
||||
@@ -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" ];
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
10
flake/dns/config/tailscale.nix
Normal file
10
flake/dns/config/tailscale.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
vps4 = 7;
|
||||
vps6 = 2;
|
||||
vps9 = 6;
|
||||
pc = 1;
|
||||
nas = 3;
|
||||
srv2-node0 = 4;
|
||||
srv2-node1 = 5;
|
||||
srv2-node2 = 8;
|
||||
}
|
||||
76
flake/lib/buildNixpkgsConfig/btop.patch
Normal file
76
flake/lib/buildNixpkgsConfig/btop.patch
Normal 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))) {
|
||||
@@ -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;
|
||||
})
|
||||
)];
|
||||
}
|
||||
|
||||
36
flake/lib/buildNixpkgsConfig/ffmpeg.patch
Normal file
36
flake/lib/buildNixpkgsConfig/ffmpeg.patch
Normal 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"
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 ./.);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
19
modules/packages/btop.nix
Normal 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;
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
15
modules/packages/direnv.nix
Normal file
15
modules/packages/direnv.nix
Normal 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; }];
|
||||
};
|
||||
}
|
||||
@@ -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 =
|
||||
{
|
||||
|
||||
@@ -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";
|
||||
|
||||
20
modules/packages/ghostty.nix
Normal file
20
modules/packages/ghostty.nix
Normal 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 ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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 =
|
||||
{
|
||||
|
||||
@@ -40,7 +40,6 @@ inputs:
|
||||
"${inputs.pkgs.oh-my-posh}/share/oh-my-posh/themes/atomic.omp.json"));
|
||||
};
|
||||
zoxide.enable = true;
|
||||
direnv.enable = true;
|
||||
};
|
||||
}];
|
||||
};
|
||||
|
||||
@@ -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
|
||||
])];
|
||||
|
||||
@@ -47,7 +47,6 @@ inputs:
|
||||
host = host;
|
||||
hostname = "hpc.xmu.edu.cn";
|
||||
user = host;
|
||||
setEnv.TERM = "chn_unset_ls_colors:xterm-256color";
|
||||
};
|
||||
})
|
||||
[ "wlin" "hwang" ])
|
||||
|
||||
@@ -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
15
modules/packages/yazi.nix
Normal 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"; }];
|
||||
};
|
||||
}];
|
||||
};
|
||||
}
|
||||
@@ -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; };
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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; };
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -65,6 +65,7 @@ inputs:
|
||||
BIND = "127.0.0.1:3003";
|
||||
WEBMASTER_EMAIL = "chn@chn.moe";
|
||||
SERVE_ROBOTS_TXT = true;
|
||||
METRICS_BIND = "/run/anubis/anubis-gitea/anubis-metrics.sock";
|
||||
};
|
||||
};
|
||||
nixos =
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
}
|
||||
41
modules/services/harmonia/default.nix
Normal file
41
modules/services/harmonia/default.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
}
|
||||
45
modules/services/harmonia/harmonia.patch
Normal file
45
modules/services/harmonia/harmonia.patch
Normal 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,
|
||||
13
modules/services/howdy.nix
Normal file
13
modules/services/howdy.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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 ];
|
||||
};
|
||||
}
|
||||
|
||||
57
modules/services/missgram.nix
Normal file
57
modules/services/missgram.nix
Normal 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" = {}; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -16,7 +16,7 @@ inputs:
|
||||
hostName = nextcloud.hostname;
|
||||
appstoreEnable = false;
|
||||
https = true;
|
||||
package = inputs.pkgs.nextcloud31;
|
||||
package = inputs.pkgs.nextcloud32;
|
||||
maxUploadSize = "10G";
|
||||
config =
|
||||
{
|
||||
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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 = {};
|
||||
};
|
||||
}
|
||||
@@ -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; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -23,6 +23,7 @@ inputs:
|
||||
PasswordAuthentication = sshd.passwordAuthentication;
|
||||
KbdInteractiveAuthentication = false;
|
||||
UsePAM = true;
|
||||
GatewayPorts = "yes";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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"; };
|
||||
};
|
||||
}
|
||||
@@ -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; };
|
||||
}
|
||||
)
|
||||
)
|
||||
]);
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
})
|
||||
];
|
||||
|
||||
@@ -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"
|
||||
];
|
||||
})
|
||||
|
||||
@@ -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 = {};
|
||||
})
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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
109
modules/system/kernel.nix
Normal 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);
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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);
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -3,7 +3,11 @@ inputs:
|
||||
config =
|
||||
{
|
||||
# only preserve the last 7 days of logs
|
||||
services.journald.extraConfig = "MaxRetentionSec=7d";
|
||||
services =
|
||||
{
|
||||
journald.extraConfig = "MaxRetentionSec=7d";
|
||||
logind.settings.Login.HandleLidSwitch = "ignore";
|
||||
};
|
||||
systemd =
|
||||
{
|
||||
settings.Manager =
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" ]
|
||||
))
|
||||
)
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -23,6 +23,7 @@ inputs:
|
||||
tlstimeout = 3600;
|
||||
transfer.maxretries = 1;
|
||||
};
|
||||
user = { name = "Haonan Chen"; email = "chn@chn.moe"; };
|
||||
};
|
||||
};
|
||||
delta =
|
||||
|
||||
@@ -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" ];
|
||||
};
|
||||
}
|
||||
@@ -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; }
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -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"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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
1
modules/user/keys/stq
Normal file
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILvXkM8TS8fDot22LTfU2jDVOqK20LmK8Rd7xO05vYns stq
|
||||
@@ -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}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
stdenv, cmake, lib,
|
||||
magic-enum, fmt, boost, eigen, range-v3, nameof, zpp-bits, highfive, tgbot-cpp, libbacktrace, hdf5, concurrencpp,
|
||||
pocketfft, yaml-cpp, glaze
|
||||
pocketfft, yaml-cpp, glaze, cpptrace
|
||||
}: stdenv.mkDerivation rec
|
||||
{
|
||||
name = "biu";
|
||||
@@ -10,6 +10,7 @@
|
||||
[
|
||||
magic-enum fmt boost range-v3 nameof zpp-bits eigen libbacktrace hdf5
|
||||
concurrencpp pocketfft yaml-cpp glaze (highfive.override { inherit boost; }) (tgbot-cpp.override { inherit boost; })
|
||||
cpptrace
|
||||
];
|
||||
propagatedBuildInputs = buildInputs;
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# pragma once
|
||||
# include <map>
|
||||
# define BOOST_STACKTRACE_USE_BACKTRACE
|
||||
# include <boost/stacktrace.hpp>
|
||||
# include <biu/atomic.hpp>
|
||||
|
||||
namespace biu
|
||||
@@ -53,15 +51,6 @@ namespace biu
|
||||
// List of objects that is being monitored by ObjectMonitor, {address, type}
|
||||
protected: static Atomic<std::multimap<const void*, std::string_view>> Objects_;
|
||||
|
||||
public: template <typename FinalException> class Exception : public std::exception
|
||||
{
|
||||
protected: const std::string Message_;
|
||||
protected: const boost::stacktrace::stacktrace Stacktrace_;
|
||||
|
||||
public: explicit Exception(const std::string& message);
|
||||
public: const char* what() const noexcept final {return Message_.c_str();}
|
||||
};
|
||||
|
||||
public: template <typename Function> static void try_exec(Function&& function);
|
||||
|
||||
// Monitor the start and end of a function, as well as corresponding thread.
|
||||
@@ -94,12 +83,6 @@ namespace biu
|
||||
public: [[gnu::always_inline]] inline void error(const std::string& message) const;
|
||||
public: [[gnu::always_inline]] inline void info(const std::string& message) const;
|
||||
public: [[gnu::always_inline]] inline void debug(const std::string& message) const;
|
||||
|
||||
public: [[gnu::always_inline]] inline void print_exception
|
||||
(
|
||||
std::optional<std::pair<std::string, std::string>> type_and_message,
|
||||
const boost::stacktrace::stacktrace& stacktrace
|
||||
) const;
|
||||
};
|
||||
friend class Guard;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user