Compare commits

..

32 Commits

Author SHA1 Message Date
chn
8a245389f5 add notice 2025-01-09 18:13:17 +08:00
chn
f21dd4f767 users: add hss 2024-12-31 09:58:27 +08:00
chn
a211ef996a packages.hpcstat: fix 2024-11-25 16:57:33 +08:00
chn
d0de71b376 devices.jykang.xmuhpc: add lyj's bin to PATH 2024-11-19 15:08:27 +08:00
chn
205d7963ea modules.user: add yxf 2024-11-15 22:22:28 +08:00
chn
9afd96aae7 modules.user: add lly 2024-10-26 20:27:51 +08:00
chn
a0ef9a8987 update lammps 2024-10-14 16:01:15 +08:00
chn
88aefc1dfc modules.packages.lammps: init 2024-10-11 17:35:55 +08:00
chn
3e29d59895 modules.hardware: fix printer security issue 2024-10-02 23:51:01 +08:00
chn
ed53e8e1a1 devices.xmupc1: change gpu 2024-09-19 23:06:32 +08:00
chn
531b7bca0b devices.xmupc2: remove substituters 2024-09-13 22:17:27 +08:00
chn
6ae91d0abe modules.nix: fix substituters 2024-09-13 20:02:57 +08:00
chn
47832e0ad4 devices.xmupc2: add substituters 2024-09-13 15:14:51 +08:00
chn
32ea9a26eb devices.xmupc2: add more march support 2024-09-13 15:03:42 +08:00
chn
ebb3f25fa2 devices.xmupc1: remove zzn 2024-09-08 19:23:35 +08:00
chn
c30d67188a devices.xmupc2: add windows entry 2024-09-06 13:37:15 +08:00
chn
ed0c30099c modules.user: add wm 2024-09-04 12:44:15 +08:00
chn
48c5edd728 services.slurm: auto resume node after drain 2024-09-01 17:42:02 +08:00
chn
fcd333e764 users.chn.konsole: fix 2024-09-01 17:26:31 +08:00
chn
80df1ebece users.zzn: fix ssh key 2024-09-01 10:06:53 +08:00
chn
b0ed492117 devices.xmupc1: add zzn 2024-09-01 00:00:41 +08:00
chn
6ce9a1d5f3 users: add zzn 2024-09-01 00:00:41 +08:00
chn
bd0ba03d8b devices.xmupc2: remove p5000 2024-08-30 15:40:44 +08:00
chn
85d0962a0b users: add hjp wp 2024-08-30 14:43:48 +08:00
chn
6c05889259 packages.desktop: add openai-whisper 2024-08-27 12:58:28 +08:00
chn
1676f45b51 Revert "users.zqq: add ssh key"
This reverts commit c7f7a46c2d.

Revert "users.zqq: init"

This reverts commit a682c67fac.
2024-08-27 12:55:08 +08:00
chn
50df623c23 users.zqq: add ssh key 2024-08-21 19:09:51 +08:00
chn
5f373767f3 users.zqq: init 2024-08-21 17:57:47 +08:00
chn
a83aa70c7f Revert "devices.xmupc2: add archive directories"
This reverts commit 9429674b54.
2024-08-21 17:51:43 +08:00
chn
d4bb6c52a3 devices.nas: move hpcstat to xmupc1 2024-07-22 10:36:22 +08:00
chn
9429674b54 devices.xmupc2: add archive directories 2024-07-07 14:55:03 +08:00
chn
d6a98d1f8e fix ssh cve 2024-07-02 13:47:55 +08:00
370 changed files with 6211 additions and 7211 deletions

1
.gitattributes vendored
View File

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

1
.gitignore vendored
View File

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

View File

@@ -1,7 +1,6 @@
keys: # cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
- &chn age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
- &pc age1ffvr5pqd2lfj24e3fh53s92z6h76fda3du4y4k6r3yjumdwvpfgqzj033a
- &vps4 age1yvrl4y0r6yzcxzzkgfwshlrtsjt8uuya6rfwks09pnft7esfcyvqmrtm5q
- &vps6 age164tyqklwhdm57tfm5u863mdt2xrzrrzac4py8a0j9y6kzqcjy9zsp073t6
- &vps7 age137x7csalutwvfygvvzpemlsywvdxj3j4z93a50z2sjx03w6zau8q3r5902
- &surface age1ck5vzs0xqx0jplmuksrkh45xwmkm2t05m2wyq5k2w2mnkmn79fxs6tvl3l
@@ -9,21 +8,12 @@ keys: # cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age
- &xmupc1 age1hnarptkze0ujpp05dqr8uma04cxg9zqcx68qgpks5uf5l6rpk5gqhh8wxg
- &xmupc2 age1l4stuz0vr7gs7pqwjrmezam44702jp2vmqaqyxw0l0r42kf9updq4dfhrw
- &pi3b age1yjgswvexp0x0de0sw4u6hamruzeluxccmx2enxazl6pwhhsr2s9qlxdemq
- &srv1-node0 age1nzetyehldf3gl6pr6mu5d2cv387p8wjqn6wfpll7a3sl8us6n38s0ds633
- &srv1-node1 age1wj33xt8nj7rhnsenepsf6k3lmq5vk4wn84jwr55qy9cwu05xn5cspg3h7t
- &srv1-node2 age16e7ykphshal6qhwfvat698hl48s8yr0jvzh27ecdyfh5uk7t9u6s753jgy
- &srv1-node3 age1lee0kl24f0ntss6m69zu2s2e7njdpkv9nl7rlf4nn7rvv0mlgvfqrte2y5
creation_rules:
- path_regex: devices/pc/.*$
key_groups:
- age:
- *chn
- *pc
- path_regex: devices/vps4/.*$
key_groups:
- age:
- *chn
- *vps4
- path_regex: devices/vps6/.*$
key_groups:
- age:
@@ -59,23 +49,3 @@ creation_rules:
- age:
- *chn
- *pi3b
- path_regex: devices/srv1/node0/.*$
key_groups:
- age:
- *chn
- *srv1-node0
- path_regex: devices/srv1/node1/.*$
key_groups:
- age:
- *chn
- *srv1-node1
- path_regex: devices/srv1/node2/.*$
key_groups:
- age:
- *chn
- *srv1-node2
- path_regex: devices/srv1/node3/.*$
key_groups:
- age:
- *chn
- *srv1-node3

View File

@@ -37,6 +37,9 @@ fi
if [ -z "${BASHRC_SOURCED-}" ]; then
export PATH=$HPCSTAT_SSH_BINDIR:$PATH:$HOME/bin:$HOME/linwei/chn/software/scripts
export BASHRC_SOURCED=1
if [ "${HPCSTAT_SUBACCOUNT}" == "lyj" ]; then
export PATH=$HOME/wuyaping/lyj/bin:$PATH
fi
fi
[ -n "$CHN_LS_USE_COLOR" ] && alias ls="ls --color=auto"

View File

@@ -7,6 +7,9 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCW2fx1Sim7X2i/e/RBPEl1q/XbV7wa9pmZfnRINHIv
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMRpyIU8ZuYTa0LvsVHmJZ1FA7Lbp4PObjkwo+UcpCP8 wp@xmupc1
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGRZp8xp9hVO7e/6eflQsnFZj853IRVywc97cTevnWbg hjp@xmupc1
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGwUhEAFHjkbUfOf0ng8I80YbKisbSeY4lq/byinV7lh wm
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5bg5cayOLfnfUBJz8LeyaYfP41s9pIqUgXn6w9xtvR lly
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBoDGk9HYphkngx2Ix/vef2ZntdVNK1kbS9pY8+TzI41 yxf
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJi6O1Sf1BBV1dYyH1jcHiws+ntwVfV29+6Paq1CQaET hss
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCmJoiGO5YD3lbbIOJ99Al2xxm6QS9q+dTCTtlALjYI5f9ICGZJT8PEGlV9BBNCRQdgb3i2LBzQi90Tq1oG6/PcTV3Mto2TawLz5+2+ym29eIq1QIhVTLmZskK815FpawWqxY6+xpGU3vP1WjrFBbhGtl+CCaN+P2TWNkrR8FjG2144hdAlFfEEqfQC+TXbsyJCYoExuxGDJo8ae0JGbz9w1A1UbjnHwKnoxvirTFEbw9IHJIcTdUwuQKOrwydboCOqeaHt74+BnnCOZhpYqMDacrknHITN4GfFFzbs6FsE8NAwFk6yvkNXXzoe60iveNXtCIYuWjG517LQgHAC5BdaPgqzYNg+eqSul72e+jjRs+KDioNqvprw+TcBBO1lXZ2VQFyWyAdV2Foyaz3Wk5qYlOpX/9JLEp6H3cU0XCFR25FdXmjQ4oXN1QEe+2akV8MQ9cWhFhDcbY8Q1EiMWpBVC1xbt4FwE8VCTByZOZsQ0wPVe/vkjANOo+brS3tsR18= 00@xmuhpc
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCxcIWDQxVyIRqCGR4uWtrh4tLc025+q6du2GVsox8IzmBFkjNY8Au5GIMP5BKRstxFdg3f/wam8krckUN9rv5+OHB9U8HGz77Xs0FktqRVNMaDPdptePZQJ9A9eW3kkFDfQnORJtiVcEWfUBS3pi0QFOHylnG27YyC/Vjx9tjvtJWKsQEVTFJbFHPdi+G7lHTpqIGx+/a2JN9O6uVujXXYvjSVXsd+CWB9VMZMvYCIz2Ecb6RqR3brj4FhRRl8zyCj+J4ACYFdGWL98fTab2uPHbpVeKrefFFA43JOD/4zwBx/uw7MAQAq0GunTV3FpBfIAQHWgftf2fSlbz20oPjCwdYn9ZuGJOBUroryex7AKZmnSYM3biLHcctQfZtxqVPEU3W/62MUsI/kZb9RcF24JRksMoS2XWTiv2HFf5ijQGLXXOjqiTlGncwiKf65DwkDBsSxzgbXk5Uo86viq6UITFXPx/RytU+SUiN4Wb7wcBTjt/+tyQd1uqc7+3DCDXk= 01@xmuhpc

View File

@@ -10,11 +10,12 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/627D-1FAA" = "/boot";
vfat."/dev/disk/by-uuid/13BC-F0C9" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/0e184f3b-af6c-4f5d-926a-2559f2dc3063"."/boot" = "/boot";
"/dev/mapper/nix"."/nix" = "/nix";
"/dev/mapper/root3" =
"/dev/mapper/root1" =
{
"/nix/rootfs" = "/nix/rootfs";
"/nix/persistent" = "/nix/persistent";
@@ -24,11 +25,13 @@ inputs:
};
};
};
luks.manual =
decrypt.manual =
{
enable = true;
devices =
{
"/dev/disk/by-uuid/5cf1d19d-b4a5-4e67-8e10-f63f0d5bb649".mapper = "root1";
"/dev/disk/by-uuid/aa684baf-fd8a-459c-99ba-11eb7636cb0d".mapper = "root2";
"/dev/disk/by-uuid/a47f06e1-dc90-40a4-89ea-7c74226a5449".mapper = "root3";
"/dev/disk/by-uuid/b3408fb5-68de-405b-9587-5e6fbd459ea2".mapper = "root4";
"/dev/disk/by-uuid/a779198f-cce9-4c3d-a64a-9ec45f6f5495" = { mapper = "nix"; ssd = true; };
@@ -36,25 +39,29 @@ inputs:
delayedMount = [ "/" "/nix" ];
};
swap = [ "/nix/swap/swap" ];
rollingRootfs.waitDevices = [ "/dev/mapper/root4" ];
rollingRootfs.waitDevices = [ "/dev/mapper/root2" "/dev/mapper/root3" "/dev/mapper/root4" ];
};
initrd.sshd.enable = true;
grub.installDevice = "efi";
nixpkgs.march = "silvermont";
nix.substituters = [ "https://nix-store.chn.moe?priority=100" ];
networking.networkd = {};
networking = { hostname = "nas"; networkd = {}; };
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
services =
{
snapper.enable = true;
samba = { enable = true; hostsAllowed = "192.168. 127."; shares = { home.path = "/home"; root.path = "/"; }; };
sshd = {};
xray.client = { enable = true; dnsmasq.hosts."git.nas.chn.moe" = "127.0.0.1"; };
groupshare = {};
smartd.enable = true;
beesd.instances =
{
root = { device = "/"; hashTableSizeMB = 4096; threads = 4; };
nix = { device = "/nix"; hashTableSizeMB = 128; };
};
nginx = { enable = true; applications.webdav.instances."local.webdav.chn.moe" = {}; };
wireguard =
{
enable = true;
@@ -62,8 +69,9 @@ inputs:
publicKey = "xCYRbZEaGloMk7Awr00UR3JcDJy4AzVp4QvGNoyEgFY=";
wireguardIp = "192.168.83.4";
};
misskey.instances.misskey = {};
gitea = { enable = true; hostname = "git.nas.chn.moe"; ssh = { hostname = "office.chn.moe"; port = 5440; }; };
};
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
};
}

View File

@@ -2,14 +2,21 @@ xray-client:
uuid: ENC[AES256_GCM,data:97aX07G5FPumdWcDxnYOs6fRgljXWuwyNXGg1d7zdbUUfNnb,iv:+wAC/DZXsg+evYFA4DMfLw5Ut3ExQl1RgZ/2AsNQDpo=,tag:ebD77muITHof+FQMydWobg==,type:str]
acme:
token: ENC[AES256_GCM,data:OrYgBRU1VPpkpDzYMFHINfPSHsXEKABdZOcgiAiBJKcreBoaSVHUvg==,iv:XIeZPJhzmUi5ZHKBCYN5UA9HWH1K+26SvcIWVrHAYDA=,tag:3F93syLBZjcHwnRRkUEjlw==,type:str]
users:
xll: ENC[AES256_GCM,data:XLSsz6fZ23PPaJS1Y5C3FAOks3wzb2f+Pv8TgyKrDBfMeoLk1M37A00OGJ2wsYxkuR0JV6Uoh+hhRpTUjOQnmLfQrBxPxxP8DA==,iv:jxEZX/flxxduM1sdrYfGHfMtFMYduMg0Lr6hY1pkAPg=,tag:CYy0y1e2S2Txz1OSh+XDHA==,type:str]
zem: ENC[AES256_GCM,data:VCVLfGO9a06XhAOBciFf1u7A5jaQikAt2wZf+dCAi1BglXpM6Hof1yAunadYOwLOBFgGlP19kX53CBBlZtaqZFL2GRDzXP0woQ==,iv:AFYtHCCkzNrllN/fjQ8GKYs2TyV3uj3BsU5n1tBQAmM=,tag:5dP7c5N4yG2NS4T+Vg0Zpg==,type:str]
yjq: ENC[AES256_GCM,data:yn6eGrySCxlRsFioaE2p1qlTHkIGC9l64+edjuDvt232xc+iFeD03EYfuulyr0GxYFwnlAwtaJnyMi5eOrSd1W6HeV3Canzdbw==,iv:qTc6vA8uQza8CB+BvffEN9GqHkiwNM4h9RkqQR14ylk=,tag:UZ2GYCJLjcWLuVXlscLviw==,type:str]
gb: ENC[AES256_GCM,data:jIR3EVdATYUgWmW4J8RdURJRmDBC84t0S/c2EzWwtFMtjgKlqg52fIfQ66i7RnIYRAoF+s4Ex0aLSejWgzQ69NA/AF0AIS7Y/Q==,iv:mvTCTP0E74QlvM8TcY4o49G5kNGs5HFx3YUrj6mCrwM=,tag:LXfIOyAB10XuHA6Cg7LBeQ==,type:str]
nginx:
detectAuth:
chn: ENC[AES256_GCM,data:44vsExbVhO3gnD4Gme92eQ==,iv:LyDvZebs1sDL1/hZQiZdHoPBm4hXtBy56jR73zSH6Aw=,tag:w5xPHnK9XOSS0+97q8b5gQ==,type:str]
maxmind-license: ENC[AES256_GCM,data:JbAnFQiDcJGwvb89sG2ro77nwwOWcDnqVcA902jwb2zzZci7PpXROw==,iv:eifkWK0oN73Ekn3oWzy6XbYK2GU+4tlnLPJ+96WOWJY=,tag:35ulsshxtUfOsSQOLgAt0g==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:VPlB4wSbWqSYw3rYRwfAMa39xrPcPZfz7sV2Cq3rmOhifnUPwggxnA+51do=,iv:utnyrB6Yfe5O94Oq4HDVFm/lQ9ZBoyvUT68r2G2PdwA=,tag:snm01vA+z2yKK8d2i5i2ig==,type:str]
nginx:
maxmind-license: ENC[AES256_GCM,data:ezBawTyn+oPKKy6sQuj2BQXhnO4PTbxYWRpQR9URCxqD7bFlnmWU1Q==,iv:eD4yLDA209x6HFtDaqyj8kRxTImdyZCgOminHWb9vt4=,tag:mx+qPp4L9jHRvL90XH1RwA==,type:str]
redis:
misskey-misskey: ENC[AES256_GCM,data:daHnurnqW0MI2uHd3gNT+ZczmytRdwBSsHGkCwNH9hJFMJW/U56HtjG5ivOQzYprWJ5uzgN98ivocbwzJEAGfg==,iv:aE9kvEErN06FNPPFQNchbmg/+SJCKT3QzCN/JTlZovk=,tag:iMo3MTssxKKT02zi8gCZPA==,type:str]
postgresql:
misskey_misskey: ENC[AES256_GCM,data:QhsmKzYmAV0kGPhtRjTK7npt/Nop5JM9EFPpD8K6KfUJ48w+r+4vTORmERu7D2+fE3XDXxNZeSJg//bGxMmhfg==,iv:qkjkrqepjQ4kbwoaceQSzEP5TjLsiY7ih/ESj5RFpHw=,tag:UtZVW30xcsbGUjU2HjoUvw==,type:str]
gitea: ENC[AES256_GCM,data:qssnsnlaEKwEnLbnpX+XDs7JK/2DdK1cxD6U2NddpCPnwfOinP2cuc1HLnteWQfYZXTuYM3VOXDEXQB9CexILA==,iv:+TVoTuqmxIsTlNPngMBBWgIvP5EQD5ROHZI4u0mSJGE=,tag:6X8hewc5a6C6nbuD5WozCQ==,type:str]
mail:
bot: ENC[AES256_GCM,data:ugfBeRM4Ks7j+V4lLOqHrA==,iv:QwXeSrfw+TTN5N42DaaA7YgpaIJX/E+kTv9p6eWSxEk=,tag:fLUDBhsvCbOiYqhq9TCzmw==,type:str]
sops:
kms: []
gcp_kms: []
@@ -34,8 +41,8 @@ sops:
by9Rd0U0bzNiK21BQTNxN1RuQ09DQVkKJmSlzV5ppEkZFljsS17ZWmoI++fz4tJh
kTdoAStG1zsKASHyZTsmdm3RBDO3qV1KhQC2gC7d4EiwNZngxOOZJg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-10-05T02:43:05Z"
mac: ENC[AES256_GCM,data:NyXFwcVCCRfU+QSJVwov38SzRag1vhgfyQ0xtOheKtK/UaA+2Vqiqatp/lKWeri9ltpw5xWBYQnmE6aBHEkrj5RvoXeho3CUWiSqsB/3COn3FSfXGGJ2M642dnCtWqHfTrGNW7bhq/lBisODvtv+SAs108R5yYXhXWotUs/p+W0=,iv:Wsel2unj5X/dBCwt5sLzHmUIqm9c0uqzzpfnUkxq5cc=,tag:a5/I8GWuUOy4F4lOx9TH+w==,type:str]
lastmodified: "2024-07-22T02:34:37Z"
mac: ENC[AES256_GCM,data:QnueDSyFfBD1LE6q3WIppswts9Nvkys10tBgbbWnHOWaqyo6J2uNnycSD5p9rHeShaarV1hOL5BvIaVhmrw8JPgC2vngJYeKWRjBgV566PcuTbpkmnJK21pChf9TbMtEQ55818FiMlmVdGUQ0/0jOXfIVOVCarEP3q4YxCY6f3A=,iv:e6HZkAhIy4Ix+mqjGzWdt2++FVvdq6gYy14fzoAFEUc=,tag:tv4IzkC539YapDAiKK18iA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.8.1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -10,20 +10,29 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/7A60-4232" = "/boot";
btrfs."/dev/mapper/root1" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
vfat."/dev/disk/by-uuid/E58F-416A" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/066be4fd-8617-4fe1-9654-c133c2996d33"."/" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
luks.auto =
decrypt.auto =
{
"/dev/disk/by-uuid/4c73288c-bcd8-4a7e-b683-693f9eed2d81" = { mapper = "root1"; ssd = true; };
"/dev/disk/by-uuid/4c73288c-bcd8-4a7e-b683-693f9eed2d81" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/4be45329-a054-4c20-8965-8c5b7ee6b35d" =
{ mapper = "swap"; ssd = true; before = [ "root1" ]; };
{ mapper = "swap"; ssd = true; before = [ "root" ]; };
};
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = {};
};
grub.windowsEntries."645C-284C" = "Windows";
grub =
{
# TODO: install windows
# windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
installDevice = "efi";
};
nix =
{
marches =
@@ -36,7 +45,7 @@ inputs:
# FXSR HLE LZCNT PREFETCHW RDRND SAHF XSAVE
"broadwell"
# FXSR HLE LZCNT PREFETCHW RDRND SAHF SGX XSAVE
"skylake" "cascadelake"
"skylake"
# AVX-VNNI CLDEMOTE GFNI-SSE HRESET KL LZCNT MOVDIR64B MOVDIRI PCONFIG PREFETCHW PTWRITE RDRND
# SERIALIZE SGX WAITPKG WIDEKL XSAVE XSAVEOPT
"alderlake"
@@ -46,13 +55,8 @@ inputs:
};
nixpkgs =
{ march = "znver4"; cuda = { enable = true; capabilities = [ "8.9" ]; forwardCompat = false; }; };
kernel =
{
variant = "cachyos";
patches = [ "hibernate-progress" ];
modules.modprobeConfig =
[ "options iwlwifi power_save=0" "options iwlmvm power_scheme=1" "options iwlwifi uapsd_disable=1" ];
};
kernel = { variant = "cachyos"; patches = [ "cjktty" "hibernate-progress" ]; };
networking.hostname = "pc";
sysctl.laptop-mode = 5;
gui.enable = true;
};
@@ -62,12 +66,15 @@ inputs:
gpu =
{
type = "amd+nvidia";
nvidia = { prime.busId = { amd = "6:0:0"; nvidia = "1:0:0"; }; dynamicBoost = true; driver = "latest"; };
nvidia = { prime.busId = { amd = "6:0:0"; nvidia = "1:0:0"; }; dynamicBoost = true; driver = "beta"; };
};
legion = {};
};
packages.packageSet = "workstation";
virtualization =
{
waydroid.enable = true;
docker.enable = true;
kvmHost = { enable = true; gui = true; };
nspawn = [ "arch" "ubuntu-22.04" "fedora" ];
};
@@ -77,6 +84,7 @@ inputs:
samba =
{
enable = true;
private = true;
hostsAllowed = "192.168. 127.";
shares =
{
@@ -101,9 +109,9 @@ inputs:
"log-upload.mihoyo.com" "uspider.yuanshen.com" "ys-log-upload.mihoyo.com"
"dispatchcnglobal.yuanshen.com"
])
++ [{ name = "4006024680.com"; value = "192.168.199.1"; }]
);
};
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
acme.cert."debug.mirism.one" = {};
frpClient =
{
@@ -127,51 +135,23 @@ inputs:
slurm =
{
enable = true;
master = "pc";
node.pc =
{
name = "pc"; address = "127.0.0.1";
cpu = { cores = 16; threads = 2; };
memoryMB = 90112;
gpus."4060" = 1;
};
partitions.localhost = [ "pc" ];
tui = { cpuMpiThreads = 4; cpuOpenmpThreads = 4; gpus = [ "4060" ]; };
cpu = { cores = 16; threads = 2; mpiThreads = 2; openmpThreads = 4; };
memoryMB = 90112;
gpus."4060" = 1;
};
ollama = {};
waydroid = {};
docker = {};
ananicy = {};
keyd = {};
};
bugs = [ "xmunet" "backlight" "amdpstate" "plasma" ];
};
boot =
{
kernelParams = [ "acpi_osi=!" ''acpi_osi="Windows 2015"'' ];
loader.grub =
{
extraFiles =
{
"DisplayEngine.efi" = ./bios/DisplayEngine.efi;
"SetupBrowser.efi" = ./bios/SetupBrowser.efi;
"UiApp.efi" = ./bios/UiApp.efi;
"EFI/Boot/Bootx64.efi" = ./bios/Bootx64.efi;
};
extraEntries =
''
menuentry 'Advanced UEFI Firmware Settings' {
insmod fat
insmod chain
chainloader @bootRoot@/EFI/Boot/Bootx64.efi
}
'';
xrdp = { enable = true; hostname = [ "pc.chn.moe" ]; };
};
bugs = [ "xmunet" "backlight" "amdpstate" ];
};
boot.kernelParams =
[
"acpi_osi=!" ''acpi_osi="Windows 2015"''
"mt7921e.disable_aspm=y" # 避免休眠恢复后无wifi
"amdgpu.sg_display=0" # 混合模式下避免外接屏幕闪烁,和内置外接屏幕延迟
"acpi.ec_no_wakeup" # 睡眠时避免开盖唤醒
];
# 禁止鼠标等在睡眠时唤醒
services.udev.extraRules = ''ACTION=="add", ATTR{power/wakeup}="disabled"'';
# 允许kvm读取物理硬盘
users.users.qemu-libvirtd.extraGroups = [ "disk" ];
networking.extraHosts = "74.211.99.69 mirism.one beta.mirism.one ng01.mirism.one";
services.colord.enable = true;
environment.persistence."/nix/archive" =
@@ -179,7 +159,7 @@ inputs:
hideMounts = true;
users.chn.directories = builtins.map
(dir: { directory = "repo/${dir}"; user = "chn"; group = "chn"; mode = "0755"; })
[ "BPD-paper" "kurumi-asmr" "BPD-paper-old" "SiC-20240705" ];
[ "lammps-SiC" "BPD-paper" "kurumi-asmr" "linwei-stuff" "BPD-paper-old" ];
};
specialisation =
{
@@ -192,11 +172,6 @@ inputs:
};
system.nixos.tags = [ "nvidia" ];
};
xanmod.configuration =
{
nixos.system.kernel.variant = inputs.lib.mkForce "xanmod-latest";
system.nixos.tags = [ "xanmod" ];
};
};
};
}

View File

@@ -22,10 +22,6 @@ nix:
remote: ENC[AES256_GCM,data:uosYkxTCB0wiY+Uufk//OcBZFN3EzbZoQGZ95M9eZMjQ5AobAZqosi4laE+EMcZL1CqYqlWXaSoEUOB8biUaZPseo+1AX1TlmUgZ7QpkfOX0VKZu01C6C+lVyqVqMFq6z1BFyX/oeITMIfnd4a/2KwJCHLAZ4hMkJ5p+aJwByKGa3N/2m41HH/1S3z7pYQWj7YJxunTPPG6WNSiRncQki11rvmddwnXmsBF89+jW1Phge8U295haC57T5oIGPxR645IeTK4ZUlL8eVuZ+BhsnwbkYcaxvjSwe+DOIVPupR8GW+gis7KxwE89kqvnQhinamexcPUz4lGHlqO/Xn6jrJx6T/wXF+19epAzeHapYte3dTWNsdPwPLPJihT16YT5fwrLnH3zq8kexWz1crmnCGUoaBs4S2tHWHLgv2lTv0IHLx5F6ijpDBj/Avg9YILIURzdeea+rBxdycHasUDTVlJtYKRH5J+WbAKWI+oJ5qmXjIRUYL+O9xIUfOGO+1b3xs8MYxRWuvDV2P88N8vN,iv:yQQp5wjbSVn1oia5yL7d6GF9Vo704G0iOQRGMbzQHzg=,tag:bpBag5y5n+7ojOa8QOcDvA==,type:str]
github:
token: ENC[AES256_GCM,data:59z1zSofzUyv2Qfn8oS7dZplzJDtOD/zxhPm07MLbVLHt8mE57IGcw==,iv:nZ4JmIE1h496RN6BChvqo7XWHjur76jP4HMgqGBbMJQ=,tag:pUSGsofG7hvkvJxCRwkg1Q==,type:str]
age: ENC[AES256_GCM,data:EPjip4/tz50e+blPko9NpzDamLRO6BVy64kDnGAhUJJ/bMw6V9Of8RzuiqUupIjEmFiUcgWf9ZsV5RZO3Ai9udq0W7mYS1Y/zn4=,iv:TBs/o6mp8t+S3Ma5/QhnLhzgl852HB3sEzKy9SvKJjU=,tag:2yMUVWPua2g0VOkaXpJzKQ==,type:str]
user:
#ENC[AES256_GCM,data:a4mHxr7bn7BV,iv:FYQk3yv3XgxNO9CnrQefo3WqhO0Sf8Mihfp+Iw4AcWM=,tag:jebxvG+xUidghf5dOlvDYA==,type:comment]
zzn: ENC[AES256_GCM,data:xBSve41JclBYQULPN7yV/1Eyo3u+CHAewVetKHwjvl6Te0kk/+aLx6gs8EpOJGmVaiSAdt6F2ayHXUD8RXXpJIOnnEHk88kqbw==,iv:XPxMLvlVtaZvpWnau5Jwlj/5ty5Zyw4F44ix5G64Z84=,tag:uJfWb0PCebdMtxXMfueULQ==,type:str]
sops:
kms: []
gcp_kms: []
@@ -50,8 +46,8 @@ sops:
OUlxNjdQaXdXMkZ6bnV1ek4yZ2dpbkEKpKGOAxo5Eef2jtGrg4iSzmGCeg+vTgvu
+K8b+O19MIkGMDBm6UbYUPtc/7eqoEZRiTUzNMTmfkLVS4ul5zou9A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-04T01:39:48Z"
mac: ENC[AES256_GCM,data:VkpF9zTWRLMriukAif6lfp8uy6+IcPDYUnXCQ5XLUtSstEyUoaVBjn+VVAoKkLX3MnyR6gyiYVWDDJmXrsyNoQpjRVQR0yu0p6p7sB3voGKiNxhw5qGwZj4IIXnHFWvktgWiawCiUkmSTUUHxe0XjAh7AWxjGqgAs/oyWGq/YfE=,iv:IQbJAhW/y18s57CAwRPeypQreBqQb0KkJAgIZ90QXJU=,tag:a0AB3l83j31Ex6PH9ziHRg==,type:str]
lastmodified: "2024-05-24T03:34:07Z"
mac: ENC[AES256_GCM,data:+nJ/wuO5G6pEsCiBNEHOYrbiYyGXXIHu3ZUgEVwqLQ10W94EOGLUto61IGtkapk4xmaHYAVmUlq76g2hRGrndLVlUthGnEc5QoQKZoUmrxK7ux1R2ubv0s1k+l2HpRerr/I8X+hHyV0fdxT6ivkpq6OsEzHDnxgewDvYNZGQS4k=,iv:TuzO1Yo0MPms5RrG8+GbwSCOILp9BF7Jsv5JvcAPwFw=,tag:fUNc+ccQDE/jcMLuQ4thCQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.8.1

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

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

View File

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

View File

@@ -1,73 +0,0 @@
inputs:
{
config =
{
nixos =
{
system =
{
fileSystems =
{
mount = let inherit (inputs.config.nixos.system.cluster) clusterName nodeName; in
{
vfat."/dev/disk/by-partlabel/${clusterName}-${nodeName}-boot" = "/boot";
btrfs."/dev/disk/by-partlabel/${clusterName}-${nodeName}-root" =
{ "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
gui.enable = true;
};
hardware.cpus = [ "intel" ];
services =
{
snapper.enable = true;
sshd.passwordAuthentication = true;
smartd.enable = true;
slurm =
{
enable = true;
master = "srv1-node0";
node =
{
srv1-node0 =
{
name = "n0"; address = "192.168.178.1";
cpu = { sockets = 4; cores = 20; threads = 2; };
memoryMB = 122880;
};
srv1-node1 =
{
name = "n1"; address = "192.168.178.2";
cpu = { sockets = 4; cores = 8; threads = 2; };
memoryMB = 30720;
};
srv1-node2 =
{
name = "n2"; address = "192.168.178.3";
cpu = { sockets = 4; cores = 8; threads = 2; };
memoryMB = 61440;
};
srv1-node3 =
{
name = "n3"; address = "192.168.178.4";
cpu = { sockets = 4; cores = 8; threads = 2; };
memoryMB = 38912;
};
};
partitions =
{
localhost = [ "srv1-node0" ];
old = [ "srv1-node1" "srv1-node3" ];
fdtd = [ "srv1-node2" ];
all = [ "srv1-node0" "srv1-node1" "srv1-node2" "srv1-node3" ];
};
tui = { cpuMpiThreads = 8; cpuOpenmpThreads = 10; };
setupFirewall = true;
};
};
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" "GROUPIII-1" "GROUPIII-2" "GROUPIII-3" ];
};
};
}

View File

@@ -1,46 +0,0 @@
inputs:
{
config =
{
nixos =
{
system =
{
nixpkgs.march = "cascadelake";
networking.networkd.static =
{
eno145 = { ip = "192.168.1.10"; mask = 24; gateway = "192.168.1.1"; };
eno146 = { ip = "192.168.178.1"; mask = 24; };
};
cluster.nodeType = "master";
};
services =
{
xray.client = { enable = true; dnsmasq.extraInterfaces = [ "eno146" ]; };
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; threads = 4; };
wireguard =
{
enable = true;
peers = [ "vps6" ];
publicKey = "Br+ou+t9M9kMrnNnhTvaZi2oNFRygzebA1NqcHWADWM=";
wireguardIp = "192.168.83.9";
};
nfs = { root = "/"; exports = [ "/home" ]; accessLimit = "192.168.178.0/24"; };
xrdp = { enable = true; hostname = [ "srv1.chn.moe" ]; };
samba =
{
enable = true;
hostsAllowed = "";
shares = { home.path = "/home"; root.path = "/"; };
};
};
packages.packages._prebuildPackages =
[ inputs.topInputs.self.nixosConfigurations.srv1-node1.pkgs.localPackages.vasp.intel ];
};
# allow other machine access network by this machine
systemd.network.networks."10-eno146".networkConfig.IPMasquerade = "both";
# without this, tproxy does not work
# TODO: why?
networking.firewall.trustedInterfaces = [ "eno146" ];
};
}

View File

@@ -1,56 +0,0 @@
wireguard:
privateKey: ENC[AES256_GCM,data:egNwovz+DTKoaGs/QQXR3MD7AImGlMlBnYsAZ1nuYnlgTVPM28aiLJ4iLGM=,iv:cFcf/sjqTmGqceNwHnzrhs1IvhDPRJi5YkyFVpjrsrs=,tag:yUwvNYCHjK+7+xkM2cuQNQ==,type:str]
xray-client:
uuid: ENC[AES256_GCM,data:6JzTyJ+GVzLd0jWfvCc2dBdBVWz6RFH/8Gr73TNz6dNCyQjG,iv:ddGpYbIHN9PV3w6Oh65vEvv82jTChxgMdltIRPz++DY=,tag:nbFFk3S/y0hS3NFWGLPVJQ==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:IoRiruMV+bdf4qTSQBy9Npoyf1R0HkTdvxZShcSlvxlz7uKujWnlH4fc5eR6yytHcEZ9uPLib9XbGojUQOFERA==,iv:E0ac0DyhplaHEc2WmcXY0Fjpkt/pnY9PaATe0idqCRA=,tag:Vo/DBIUO6DBFCXQ1RLrchg==,type:str]
acme:
token: ENC[AES256_GCM,data:k5QU1aHvd/hSG4yncffSwnxQvhULHd0I8wtrXD2FcOH3SWswkmzMOA==,iv:WB18Wsl0nxUQ6Om3SXP5+0BtFbNZ8fCXTyPJqj6a9Ik=,tag:dKpr52W7Wdwws87r3hQxqw==,type:str]
users:
#ENC[AES256_GCM,data:rNA32tcCmriP,iv:No3Hyee58jDzZaXOD8SJYzgQXXs58oAddwC5Q9mo55E=,tag:RgZO7fgZkAr3Pawqt0dwmQ==,type:comment]
xll: ENC[AES256_GCM,data:kq6gpuxBRbDP7Yi16WJrrsumnSfersI2kP5pT5efn5CjbL65JaW/Bff9P4OM6b3J21ObT0uRSmParBqW4OvN/UA4KXDhibqwRg==,iv:GvpNgy8kREgxp9v0cyIobgg2ZrrxylMmwq1hRaAoNA8=,tag:RpD/1FjWVglzt8sIAjjpsg==,type:str]
#ENC[AES256_GCM,data:nl+uNO7GVV4r,iv:8hUmN4uWOqJE0g1aYA5dqQq+0oCpYGKe//yuECpmyBM=,tag:79XibRYMadJNE5Uy1O+4Jw==,type:comment]
zem: ENC[AES256_GCM,data:t6zd/9ZoJWEkPhKyfaUXWQM2Y2unpUUq79SEKSt8nmWCQxlBk4PzMX031CwNde/0A4G3ARyIoU8vcFqp8NaBMA64INccKccrGQ==,iv:QOKpu7lm6uiPACNGa0QvHP81PP/4doS3r95h8/nexcs=,tag:J85l6pYh9WT/LyMbTrw+vA==,type:str]
#ENC[AES256_GCM,data:7SGmLzQyXKWo,iv:lr7nM0r7eMc+sCNO8OgwwELH41zTk3W/1i+0rnTc+9s=,tag:ZOkLRhEsFXX6bODu6wUyiQ==,type:comment]
yjq: ENC[AES256_GCM,data:8TF316O4M3UDoSA7rjBn12vUdHOcWXtrvuhqa6K65NaMhHU9rMrPHEikr0tqe5B5ojhh8PRRe+X/Dq19L4rJXThRfzdhALZzsA==,iv:2plZ2m0JuuUMQqYnyETCPH9x5jnLtNl396zvv7ay++s=,tag:X7YSLQOE9xnC63RWCht3GA==,type:str]
#ENC[AES256_GCM,data:yclOn8oHwLYQ,iv:Ba7Q84z6e9/3lv43wdN+bd/aqO/y5qR5I6Z5O6o7U6E=,tag:ecaNN9MgZqDYBCbTlsOZtw==,type:comment]
gb: ENC[AES256_GCM,data:piD2eh5iUXnCEkEyDULPkjbEG4Uc4izoVAuscbb9TPr7Q9WhCJX3FGRYrQp/wmZQ6UETR1jTejtbT9j/kI96BcN2onlwO/lqvw==,iv:oFWeoDp3GQA8aR+/AcJnhkovOWx7MgHoCKy5xdPIJMo=,tag:n2E+zuKckNAU7mOCJW+f1Q==,type:str]
#ENC[AES256_GCM,data:hfcOjdrvK+YD,iv:8rUsS1exsOx+2YEgdATNcWGKqmaCNbpY1EEq1Gv1utE=,tag:Z0lq2ctHBWDtx2tyxOSIBw==,type:comment]
wp: ENC[AES256_GCM,data:DUfGQpSg79W8KD/SWC2B4FqoPGoCrd1miczAQR5YApD00QopMmeDR28uTmHru2KU9DsjkdnWEbgfM49CwXt5FFJennqW36oYbg==,iv:D9+3CMZlJIHm+u14rAEikQoBM3jBQN8Lnx22DN2EIg4=,tag:ZegZmI1kf7Whcw3EE9dwPQ==,type:str]
#ENC[AES256_GCM,data:6pwUu43Lu5/h,iv:lZQ5F8v9VZRGuUoEMH15JLvx40N08ahTEbdEoKEuvsg=,tag:zPMQy6d9/RcukBO1cyeM4A==,type:comment]
hjp: ENC[AES256_GCM,data:dqoQ9hUbptm0//mlcFRrqLh1NpjxFPH+4jeyMG/x9Zvkszw7d71jvkO8KEPBfKnXpPBP2lvFyEqooIMWQJPYiIszHt2f0qSC7A==,iv:5nRcsaylcx74tQR1KddEpZUhmcynMvdHCcJYA7wfJnE=,tag:bGVKD1aDZJUlFg/zagP/eg==,type:str]
#ENC[AES256_GCM,data:Idordi28++/e,iv:5TR6Z14yluxPhrD7ye2mXEQpD53qS9/ZJIZ+S1sTqco=,tag:IkmLWXdxDmFQxtpJxL61pg==,type:comment]
GROUPIII-1: ENC[AES256_GCM,data:JuNtb5SRUrxfyjWFn3Be7EU51j/HlwiOpuN0m+Picf/2Bs97kflGnqGKstVRIjWEn4WzqscSaLRsbP9uFfSBHeJ152xfyOqkww==,iv:mQvIC6v+1fziRDYHYSFMOKof1ZcoFskpQDiCAF35sa0=,tag:0IL2VvdMorgE6oziscAB8Q==,type:str]
#ENC[AES256_GCM,data:kyJP952K5atd,iv:TLMUPKshuWqbQ6koiZ9eTXcoDS3jLXYy/gCZbMGrRl4=,tag:M2tLLogovoG2PCojt9CJ9Q==,type:comment]
GROUPIII-2: ENC[AES256_GCM,data:ifWnLx1YEewdviqHK8fdesM3c1m1T4g6twnz1cGv1yc4jit68pQWLrRMivdsM4tUcyU9GKwCaElVlvh+dgyy8EZQPKCbvJX6GA==,iv:T5FWReeZ0QOkGJiNfrVrUBhAhbXxlFQJKqQV2tzw9AQ=,tag:XClXGZDWGuoGxzPW7ne2Pg==,type:str]
#ENC[AES256_GCM,data:t8QUVYG4v7fE,iv:N8hDAV7wulPHcfnYTXuZRhb9dQPZqKpfMKK1+ITaZTA=,tag:eKMJDOmqoWWQbv/mm3LaAw==,type:comment]
GROUPIII-3: ENC[AES256_GCM,data:VlAA+g7SRZyhPSl0Gd1KS7dCwNgRA/o+d8anN88A7E8bSE1ckeTSp+J4YrbbUlLasLhliOZ/nDC0rti+hckGCrjMwweMorSIWg==,iv:7u1yNrN7uxHCF1MsJ2qt1jyQ0ZYYCYKUHwRff50P9oI=,tag:3raCWjdButfmcdy8mH25Jw==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZQUpac093NWh3bnZqWkFY
WGorTlk3WWJRb0RYVWVQc1JacU9GZDhFN0RnCkJkQnJoTkZtYkFEQ1JDZXA1Qzdp
dWxtc3RFbUd4TEZobXBQVWVlL3VETVEKLS0tIExoMUNidEZob2dtTWhmS0VHbDJn
RFNiU0xMOG1UNVY5TTYrcW1GTnIwb0kKyCl+eqpGtqN047+t1C/c1prIaP3tm1jk
1ObtsmGwCxDyIkayqB3WF9DWhNHipXHZXrWT+JQJTD30BABBex+ufg==
-----END AGE ENCRYPTED FILE-----
- recipient: age1nzetyehldf3gl6pr6mu5d2cv387p8wjqn6wfpll7a3sl8us6n38s0ds633
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3WXJ0dmh3RTBMci9pVVh6
cWsyNHVub2U1RFhLSnJPSFI1S2lGV21nYm1ZCll2TUQybmtaaTdYd0dGSXVNV1Y3
TC9zbWJQOENsQm1Nc1ZwUTMvczJGK0UKLS0tIHJRemNhdWpRa1pkRnhTZjhCODNM
OThDMWRsWnVTbzRGTTZqSDBkNWZJMlEKdQ/ipO7O5OvaGa81c2P7fi1ncufueSzX
2njlHHz1gJCtjpktYaVvS6KSYtJoI9oNrF0YN5D/3kKW8TicsSGKaA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-29T06:38:23Z"
mac: ENC[AES256_GCM,data:n7MVBKCUW4xpIiVO4ysBqlG89LjzpDBx9GJWQTrSenLWV/YrIGUxA6QDlRg7yhqV9ldF9Q7hDve1KHw7OxKRx5ot5OZiD3Bq3TwJfS2DarJ2vi9oc1J+CXXach8gp3m4C4RkPJ/y1i3jB2nRfSw5Z/TtdPMbvGXlHh+hhriAqxM=,iv:tyBcXMZzgeUOgYJtU1XkptPOlNoFwH+4z6xTD89aKOw=,tag:apXU989ZL+D8WhWKFTdXTg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View File

@@ -1,24 +0,0 @@
{
"data": "ENC[AES256_GCM,data:ul1xMmQ5FZVIKct4KbgnTStsT5cH3sRvmaApZez4WZ36zF3q3M4o0dcwuWXxl9Ay8+Kd1zzUCZy26FRj85IwAel6POkmIlXl51Awou3iWuGBqUlS6IL9MIERMR6lTlisOK2l2PJ7IJBichFwwDrxImnt06B68Z7JWOyrLMfQhwg=,iv:nHePsGpRWMj4CdZ8wxr4xCJAcSndHsRju+AMyK54vNw=,tag:+CC0EJbTmIjRijr1SZpF3g==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBqRTJCOTJqclZqV2ZTb3NG\nSUV1VVNnUVpqZGVCc2hlTVBkQUVtVGlQdEhVCk1aNjhhbDZuajhQL1l1allHOXV1\naGRoWEpTZ2haTFFqRDhlclEySjVmMXMKLS0tIFpPdHZvekhDaS9yam5GSEVhZFlw\nZGN1QTVYQjZuUXd0NklqdytYRjRSNWcKC+AmUlZiefdfnP1l/sbQHBUaZGN6ciT8\n/yI2ed25uFGwCo0h+yLywbuNQTv7AiBFM3R+KBSjNDkFSgiGfblVNQ==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1nzetyehldf3gl6pr6mu5d2cv387p8wjqn6wfpll7a3sl8us6n38s0ds633",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB0VHhFMi9RZ2VjeUxqTHAz\nZklRbkRGVkg3NDR2elYwbXRHZ1dSQTEwNXl3CkdidmwwVUZJWDllRVdYRWM0WEtX\ncXlHbnlZd1h1Ni9UTEtHK0Z2YzNHcWMKLS0tIHl5ME9UaDBFSkRXeEh4OWNRajZu\nOUdGcHA4Q1I4dS9RMUV0YUZBYmZyK3cKSxvVdG+P9+esK3miJdW9BqgJdEMEq4iS\njWgh5lmSQaat3UzjkOVPPp9Xu3DRpzTFq+dM8bdGDTbzAdrUhxj87w==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-09-15T11:11:36Z",
"mac": "ENC[AES256_GCM,data:bV7T1HfvM2n8+Vus9oDO5yoWDGtWYOd6d/zJ86/sXB4psg7aXVNedYSn+98SJdpYKHRcSuMJ9D4h62nAawERB6u8EmW8kxh8fuVLb6tj+9fWF1iVqinL4LE3916+XzMqGzGVZZEXaVtPHqOue/D1sYtBrBCOEMMyq0cmLFY2JrE=,iv:eSrtmJLARmwuAQ1//x4XqCKDZybJmMtyefWyLPk+1j0=,tag:M5W+vO4RjVwS18C9wTIe2w==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.9.0"
}
}

View File

@@ -1,28 +0,0 @@
inputs:
{
config =
{
nixos =
{
system =
{
nixpkgs.march = "broadwell";
networking.networkd.static.eno2 =
{ ip = "192.168.178.2"; mask = 24; gateway = "192.168.178.1"; dns = "192.168.178.1"; };
cluster.nodeType = "worker";
fileSystems.mount.nfs."192.168.178.1:/home" = "/home";
};
services.beesd.instances.root = { device = "/"; hashTableSizeMB = 256; threads = 4; };
packages.packages._prebuildPackages =
[ inputs.topInputs.self.nixosConfigurations.srv1-node0.config.system.build.toplevel ];
};
specialisation.no-share-home.configuration =
{
nixos.system.fileSystems.mount.nfs = inputs.lib.mkForce null;
system.nixos.tags = [ "no-share-home" ];
};
boot.initrd.systemd.network.networks."10-eno2" = inputs.config.systemd.network.networks."10-eno2";
# make slurm sub process to be able to communicate with the master
networking.firewall.trustedInterfaces = [ "eno2" ];
};
}

View File

@@ -1,50 +0,0 @@
users:
#ENC[AES256_GCM,data:dgM035YLtZfl,iv:h7pHQ6YFa4hxcHMihQTegHmkaCMlfPtqdCqvJxSsXt8=,tag:V2v9C2TfErIOAihtTQpnSw==,type:comment]
xll: ENC[AES256_GCM,data:/YL4vowFLFbbYv06yaKWZH5UNBKs0L6LQ+6O0IsiUZpgW5fGfp2A5JTlH6ne7RGyyTE4GNId0MC7byQbTHHwO+5zVYWpzjDCfQ==,iv:5/VKGsIohoutZf3F4Qj8PruAXSivQ0zsg1pwLwZbCLs=,tag:/vsrCISEbgQ7HnubWOtKow==,type:str]
#ENC[AES256_GCM,data:oT8PFxQdwEt6,iv:eD/wF2toUAT991S0aO7NklpKSnMDH40+73IhU83H9t4=,tag:mxxAUdfHgC/hlvmLc2MlAA==,type:comment]
zem: ENC[AES256_GCM,data:RpmSTr2ZKfUNWg5vYbKB00AG18GNQs+kgx82E9Mg5hoc3HKmbAyIzjxloMn/Bw3MOTnof6Cf1ZzVCs53Wz8YbZFClLEVdKhMKA==,iv:NQJQOxQa/RaGzvGgarq5kWL8ojB1bejEiqJUCJLxgyU=,tag:8cFFQ5kKpZji4YvEYOyzOg==,type:str]
#ENC[AES256_GCM,data:keNqy5SdClQT,iv:N5LX7VJEwLHQ5HsFINs6LupP3rv/XAWFR2e/S52N+Oc=,tag:cqBh1bL1jAEk3mT0pLDd5A==,type:comment]
yjq: ENC[AES256_GCM,data:TagWplgUyhaEAuFpup0TRIxWXIEGwsG/V+gOo/pXSGor30B/BF7+wVozYTZ/iSN7OJJw8I7IZGvxvh0v01BGz1RQO6MEEpSj5A==,iv:TeXXYlhfae78cJFdZk0Nnm24sP43wi9UM80vHwKfXFU=,tag:lhae9Ona5OMlTBAJg3PiIA==,type:str]
#ENC[AES256_GCM,data:jmRMNpJLMqEo,iv:UOfzRSPDFsJ52sa2FVaQsVcU2P2bOYPzh4JLZ/8+hCg=,tag:8rCEYFELB2geXhfUjfZ18A==,type:comment]
gb: ENC[AES256_GCM,data:RneeGyzmdxCceKPzOHaTtS1l6NzuS07NYBxYrLICMLWHPog08FTINWEZx1JmqbAloVna3wE43kPPa9s1w3VbtPBhzRpTVZfUtA==,iv:1vu79FhPiWQ2/G5xzzBdyc790yv/aYKIQFPhaDpBmoA=,tag:vkpT1bDfVufBkDmOs7RomQ==,type:str]
#ENC[AES256_GCM,data:swW/4Fii+fHz,iv:9UZ8W6RY+n3XZkDCxSP/CQQn1Ji+mo2aqgmG9wTF/I4=,tag:2ifOyc0oGzM1iM3rouvvMw==,type:comment]
wp: ENC[AES256_GCM,data:/cIBL7orNYqu6Ybahdd1UVdTbS1SHr3GGb3ib4FDxPUlp/Xr4ARMX+01N6pOahVYwE8Hwp6nr4TdvwFpe2/AE6v2rbyclSzJgA==,iv:ZGwmAgwiC15K5NhajLCTiuW2mLT2gt0KUicDFmMY+JE=,tag:8rcoY6/weOkML90FyDfiSw==,type:str]
#ENC[AES256_GCM,data:6KbDgRf0Lmsh,iv:2vhLHgIzhCrdvQ7w6lCPKOmLlOVRJ5gJ+Pw5NSiMVVc=,tag:E6PwWCsUn3tZwV95zFbwhA==,type:comment]
hjp: ENC[AES256_GCM,data:0hzP2t4ck/0GVa2OoZxETCSQvp0QYN+0MJYl5aJ5hzSOXbwBPlTcIbjckpWDacx4iKGw+skhv1Nhz9lGrhgvddzqb/o1GWkKUw==,iv:OzKTIxDm+AgDAy4rP31kts0PKHuNqBZWc0Vsvh6X8CY=,tag:7Y/6qP+TJd1o0a96gKq5JQ==,type:str]
#ENC[AES256_GCM,data:PQmtt6/8T8Nm,iv:ZDUkaQts3hUQ1nncynoGw8gNV9jYvnXz9rOaqRC6yLE=,tag:jN8sUWnqoWbMlkLEqVKNkg==,type:comment]
zzn: ENC[AES256_GCM,data:YNB9leH/qgXpApA+bnsZiBlfbQSEiOoqhDgKCbwz33zPVc8KRShSS4kWEseiMlYLv7Kfbfy94cEKLOaWBjuRmMrODmC3HZ+rtQ==,iv:Ju02Sz0PHoBftz2W818hmXQ3J/fzLacWv+gy4eGXvjU=,tag:B6mvgWUclyHXgno07jhXQw==,type:str]
#ENC[AES256_GCM,data:UVi9/5NV0ySV,iv:E7ZZvvf6lNJdT4esykilJxhpTu7gqmu9w4w8rII/RSk=,tag:pnl3G0qt7ZzXlA9YWo7LiA==,type:comment]
GROUPIII-1: ENC[AES256_GCM,data:M4LHqgN/WYk9Nh7Pawft1tplh/FiADu6GoyImyLGBk8rbNNLT5AXuNYGj97tVYxI0Hwek+zhnmcjAWdDtmkVzE7TcD1WAZbkTA==,iv:GN/jHnEikITXkLRR/tXnhYiTE5bIDOg1d9DrYeASoY4=,tag:hkoAHHYX+q1topjXkRyK2g==,type:str]
#ENC[AES256_GCM,data:EVL/9hYcFl4F,iv:EZ8PMqklNEky0i940vwyQFXrgBoQRwwGDjBgRB18KGg=,tag:cnQzCU7XZ0EO6ojGaEk4Dg==,type:comment]
GROUPIII-2: ENC[AES256_GCM,data:7HOyyFtPjhxtvz3cG561aslZ1Ct+DmR290XOxz34sA/vyA+gjvHTWoIpKPGVzSU8vGfaLLV4ta/nOUsK/VfUj00ngwTdkEDkrg==,iv:rkDAE24gaE7MzOcIUX87oMyK6ra0Pt/vUNrIV9p7aFY=,tag:24NTkSu8Fd785uC2Lwr2XQ==,type:str]
#ENC[AES256_GCM,data:sa3uVs8+996Q,iv:eN3S4x/UROkZWV3U2pZpvULgoPdh42lM/Q+jZ13ohsk=,tag:IG0q/+ti4tthAejVp7MCPw==,type:comment]
GROUPIII-3: ENC[AES256_GCM,data:jfeQWLGUWK4xfgRtS9RjjN76D+JLqTF526SI0XeYnUXtCsKhJYE88hgVnn7m/Af9g1OCj08+UDsM8cyKOJj3+m6h+IZQzCS4bg==,iv:Syf3SYAFvOtfOy4PeA/PcYbuUnABk6f5A+OmZYtdwv8=,tag:cib1RuKxGffjB7R5GSxotA==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvaHcyMnpWRTAwRzJ0MTFi
elk3QXNqdXQ2MEttNXhBOGF1Vlk5cW12YTM4ClRkUm5zUUo5NjVrNnBlSFFPOVVR
V3VxVWZQQ0VvTm9KZ2Y1L3BpRkFDTjgKLS0tIDJadStsQ1Vya0FMa21Da3ZhUDVN
RVVTQXY2NkdzbVFLY1pYYTRLSGM5WDgKbFabN/iH2YDJaSXdm+7EebKS/As1zH43
HjUp2LHN85/WQEx3VheZRGJBwpNn/Tdunhm0yTdNA1jpzQnO9bIMXg==
-----END AGE ENCRYPTED FILE-----
- recipient: age1wj33xt8nj7rhnsenepsf6k3lmq5vk4wn84jwr55qy9cwu05xn5cspg3h7t
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1TTlxNWhMS0dJbkZRSWsv
MitoM1NicmJzbVJBZnhUbnlJejBWVzU1TmpnCkxrVEs2eEE5VnVDN0NNaFZ0b3M0
SXFmc2JxblAvN29Eb2ZrR1llZkp6cmMKLS0tIGdQMjNIRXY2UGIxdGk2Q2V1MXJO
R1BkT1hoSWo1RlJnU0pCdTFYbDFoZmMKKF7cND1jSo+neTTJ+GwW4T0RTOX9mbME
58wjAtkrKSD2vDFMQ/vtPNiohAt6RMdClLVm50yh7Oh961YmvJYnbA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-29T06:38:35Z"
mac: ENC[AES256_GCM,data:UWDwXUfk4R9CfgU2gv1NZsusLq5+VTsvjGQNst99MuxLz4sox8CZuuYsDLB2dobKrJua107yqhbM8Ps42JJVHZEf3WHqP08tRbdIWNVoakYR6UJlNS3WZVR+LlheQI5PfJqPqa7VFgZeSVm7weIPCHqvHt+ak76oyJK1VsI0f+k=,iv:VL9s+LUA/TrOsJNQWC0/v0Yh+hT8uh2vitc9h1xHBEY=,tag:iA8yMpm+0ANAC+2BLN9Agw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View File

@@ -1,24 +0,0 @@
{
"data": "ENC[AES256_GCM,data:GHsftJ/b50XSTy3wCX/ms8iGhs7oQMrqw5R+7PxrjAm/VzcYJbAQjYButIeNYB2/r87IGKDEMAskowocqyuhamTZS9n6eElDBZrEoUXc9J/lZvXrNqBa2pDsR5a58X6Paj2kMn8Ke9M3vwHcgniEgZtC2h5u6VwbgPMZniqYT5w=,iv:KhGKrf0tXdLb0sWc6kB9lXjj9jOU+wsy76xGFRmwdz8=,tag:s+NBphi1n00GflKqujZcfA==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBPYWdxSzIrQzRaVnh3K292\nVGkwdWUxanpQbEllWlNvaHBoQ2VYR2pXcVZVCk14ZmxlK1pSWnpCZC8yaE84b1Ew\nNTJUTDErTUVxZzBqdGFORDc1TEo0REkKLS0tIFZJeFIvd3BDOGkwenMrWlAyVHdh\nTzRHNU02RWY4clJ4dk1IV3R4c0VTd2cKeX/tLKOnkbcAhkgCY+T4XWBgc7eUFecn\nfqd6Kxfg6P75OT6Z4ACKsHDGznGk8fYk+Ms67MSCGzr1HXaR14/eVQ==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1wj33xt8nj7rhnsenepsf6k3lmq5vk4wn84jwr55qy9cwu05xn5cspg3h7t",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBxODlXSGpsYk5BZ1piSUhX\nUnlTQXpycmV3YlhLM01SMXZ2ZzFXWEU5MVNZCnVUNFRUTTVNaWVUZWY4dklFMmhW\nWUc1azJFNGJTZFVlRkdSZEd0eUozbk0KLS0tIDhUTFE3cHpFblZTa056R0lscHR4\nSXpoT2QrOU9mcDV2ZjR1bjV4cHZCdXMKyVyxBRY9oyhfj0ZMVRtjf8TT0qRJULwN\nosghj6bPqOFl3C9zBne1Xn/2mOj5lkMZP6MAMPtaW8nvsf/LkZx/Hg==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-09-16T03:08:59Z",
"mac": "ENC[AES256_GCM,data:SjmuJVeJsamHE7Yv5Lvoyjp0CysTo3K1nyJgPI7KKp21H8Xq59g9/zbth4pCdIMHyt43MNUXFkhYD/Ox9ySoDEi2pr7H2kM9fcFM0W/ObM/gm/lt5jTLzzS+OkKys+Yw/WA2nIStSNq7rAb/SKFbHvj1P9YBsJxlOnBzTW7uu8g=,iv:tNjnqRX1D+vY8w7RxZzo+HdfjK9pXJpB5MKnb7EyUXk=,tag:PuLU5zmUH14ZxuTUPIz20Q==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.9.0"
}
}

View File

@@ -1,44 +0,0 @@
inputs:
{
config =
{
nixos =
{
system =
{
nixpkgs.march = "broadwell";
networking.networkd.static =
{
br0 = { ip = "192.168.1.12"; mask = 24; gateway = "192.168.1.1"; dns = "192.168.1.1"; };
eno2 = { ip = "192.168.178.3"; mask = 24; };
};
cluster.nodeType = "worker";
fileSystems.mount =
{
nfs."192.168.178.1:/home" = "/home";
btrfs."/dev/disk/by-partlabel/srv1-node2-nodatacow" =
{ "/nix/nodatacow" = "/nix/nodatacow"; "/nix/backups" = "/nix/backups"; };
};
};
services =
{
xray.client.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 256; threads = 4; };
};
packages.packages._prebuildPackages =
[ inputs.topInputs.self.nixosConfigurations.srv1-node0.config.system.build.toplevel ];
virtualization.kvmHost = { enable = true; gui = true; };
};
specialisation.no-share-home.configuration =
{
nixos.system.fileSystems.mount.nfs = inputs.lib.mkForce null;
system.nixos.tags = [ "no-share-home" ];
};
boot.initrd.systemd.network.networks."10-eno2" = inputs.config.systemd.network.networks."10-eno2";
# make slurm sub process to be able to communicate with the master
networking.firewall.trustedInterfaces = [ "eno2" ];
# add a bridge for kvm
# 设置桥接之后不能再给eno1配置ip需要转而给 br0 配置ip
networking.bridges.br0.interfaces = [ "eno1" ];
};
}

View File

@@ -1,52 +0,0 @@
xray-client:
uuid: ENC[AES256_GCM,data:U+unsiKt9vNo/EXEpLHR0Ny3DxQEwx7a40KmwZDZki7RQEuM,iv:7w90HNM5lfh2VY20AcUEVdu5X2uxqXxR0hARncmMR60=,tag:xIbKc+9SF5LP/tY/XoGYxA==,type:str]
users:
#ENC[AES256_GCM,data:bAA1+Mx9xsFr,iv:5GWh+DyuRydCKm8K1kaiTJIt4ReEugHFnKYfan6RAE4=,tag:VqcWjIMIYhkSj6f/ZclTVw==,type:comment]
xll: ENC[AES256_GCM,data:lqzwlETuKuKa2wh+ickMFiWyprcnIBfRBjri+NWoltxib/LWzEEbyetRc4AKyVaBiDhsOTw6MazPNy2mhcAFwb6pM+QKce5ntA==,iv:VaGQux8MJNPZeHwDpM+yJ47XvOul0qRE8xVdSWjYRhY=,tag:rBWdTPmJX9YsP0l1FtVbJw==,type:str]
#ENC[AES256_GCM,data:AgppEXaJcXhQ,iv:gI4nUzfy7w9yqaWlT1NYk1cHdErCJsrlilwYSGxxCdw=,tag:/A6zwbvQdhX9MLfAdXIVqw==,type:comment]
zem: ENC[AES256_GCM,data:t0rCwed8EzXbEuwTabzSLUd/Gln3YD9IT56JNVHwlodAvFYwtTDJe3cy7K17TmIkL1Nk/hAGzQ2BIZJxaKq7A5pSNIUO1zqMUQ==,iv:jSKCoNKQ5a91kK19w5mE0lJ9lh391ACq64UtLvJ4kLI=,tag:d6+IrgLyCw05vvLcCF5+yQ==,type:str]
#ENC[AES256_GCM,data:s39KO3hHcrOK,iv:ICtP2r9JMjcieHZdyHpj5Z1DympJUcHq2jPpjUwSOzM=,tag:Es3YS+mEg5I3SIujfs50jQ==,type:comment]
yjq: ENC[AES256_GCM,data:gOc59J2eiND+qJJRwLYvTymfrjWNRWw8IwLxDdS2cSu0yTN5SWF1eEg+tYmDqqhPmXkIlenL8VyIZD2P+Qi+Vi7l1pZMnneRCw==,iv:TsWOmHlClMgpXbNsCyvs+wkTvvKViAooA36+O4eQesk=,tag:jp5ZO9tlCPNTNZXWXCUEeg==,type:str]
#ENC[AES256_GCM,data:JmmZl+8nta5Q,iv:qWGS5i+ntmJ9x3HFClVdfypQKqSTUx827OFu/wxx3HQ=,tag:SzvgJtIQb1Z02GDwkAhveQ==,type:comment]
gb: ENC[AES256_GCM,data:pgwGyp/QC+h05grD345pJrJefm4NWd0e6mQEzrsqCbjMi9Ak2nUD+K09mIKQJ39NttC+NQZezRmKUJjDBH50s0O69nBlPOJtgA==,iv:ZLm6KUzD8fTq4YpxhdYjtp7bbDjP7Sy+0fnDO0W5GY0=,tag:H2mNHIQvHe+3YzZ9ITVdOg==,type:str]
#ENC[AES256_GCM,data:94hwxSaMkbIB,iv:4Xjukoo7rxeu4SWjwFeLo5fwSX6a8mpkTOIpnOnR/Io=,tag:XOjY6ziyDdMNo53NFSjcJQ==,type:comment]
wp: ENC[AES256_GCM,data:9/aVAQskZyQrfhVFVHfpdTWDLdoP2ZO7gG6bNcRpOJEBle3V9XqVSwmLViIIysy4XxoR3cym/7WXB96O3C8feK7sbihaRpT+Dg==,iv:WPnDArVKqV7u3EIQ0CMectK1W6gXKOo37oOybyob3As=,tag:1R/0qjRzif4/sTFSs55NuQ==,type:str]
#ENC[AES256_GCM,data:RluXnmnn8CAI,iv:OqzKfed5CARE/KKur0GXDpLBqStEva7YVoQMQX4+FnU=,tag:prOaqWk6ARxEKvnhOnCZhw==,type:comment]
hjp: ENC[AES256_GCM,data:Tb9vCi68B88UZc/ZVSxEI+esKOLlFcAPAaMk9FDmkBycZmzDjHfkUKCxVcOMtqeNSluVZ/5IFgowaYbk9ncK6yoYTjXjj1Z0lA==,iv:COs+ijt0h+UygyhWDQV23NRd/xBcfeqz6CO7D+xw7t8=,tag:RaIMaGrgHkidB9vqLR6cNw==,type:str]
#ENC[AES256_GCM,data:pymPvP+KjTd2,iv:g5tmBMQevuzES9FVlRten8Vzy5nvgamDNPo6Vy018T4=,tag:sMYZAyyAzEyS5CsAyC7xtw==,type:comment]
zzn: ENC[AES256_GCM,data:CJ8cOBjblYIc0GoiPnIbbWfYDfpQW5u31R9T/P0/aVuxi6P44wYYH0posVGthR1laqHIlu8bzgeRyTbBYir/Mw1AGokAnFLEPQ==,iv:dJXFcZ9f3xe3rcPzOLd6AMFh6EyJXlv3/+uR2x9XYsw=,tag:4I1WqtloUSXNeQ6AlVPY5g==,type:str]
#ENC[AES256_GCM,data:r1Rl1+lfgMad,iv:9RGwiYlePcXZFDxw5uc1yEwZ4N3lStmE1cGmsj5dPls=,tag:yGChsxZtIzDjMUgIkd+PdA==,type:comment]
GROUPIII-1: ENC[AES256_GCM,data:IIZpTdr5jpidbxYCQ+fODOHdoWI51upPI3yxYlrAAd+RE62t6PzAvHKFmKPivbHmQS5RZrJXE7zm9JtwiodRmPl0pYLxYNBpFQ==,iv:WQc1pOungm1gEqYPk/MITbjs1l83ikcys47CARRgoFk=,tag:sS2mXDIWl32ZZzDtictv9g==,type:str]
#ENC[AES256_GCM,data:VtrWQKVtCHtA,iv:ap/n2HxQ7dgKOA8rIfenv9LOwwAh1na8+I9O/k/wMxs=,tag:Vl03ortuZ5OS2qcBMnc59g==,type:comment]
GROUPIII-2: ENC[AES256_GCM,data:fkxYmHEQnCjx/srKBgjreIR0S7mcXyl1h3H80PFsH3A/yCGnJbFCGK1GW1++Q+tziOnEWCTLZ/l9dlPuB5BFSK7iHiVXtkOfVQ==,iv:z6duWl+LFpS5RJnCGxb3yvgHp96uJYoSsAThWrbGYfg=,tag:AKWisEg506eOgdp/4tLU7g==,type:str]
#ENC[AES256_GCM,data:e8HuWaLrvHx5,iv:ZKvfRQtOMV6v3MSCDVoPEsxldI+ZRYJBwrKAD8YZzPc=,tag:tPL3IyjC8f+S+6MoMJSd0A==,type:comment]
GROUPIII-3: ENC[AES256_GCM,data:if1S/3AxNLkWvDQJom+4EPRBOpkAPNTkEcqHHLAuEJATSNLlIhVLOPgt10cM4LWx2TdG8V2TcZip9qnr4ABHMsPF5vm6Y53r9Q==,iv:Rba0So8DXJrSC88mjwT8j2AVy84TPm0R6AVf2ZmXNBg=,tag:qiSeYLrw/6QJ7vMiPEZ66A==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB3WlJNWmp2VUxpcXR3NE92
TnNuLzg0SVZKdmt1cEVZU2FodXZPdmt6Rm5rClhrbDh3SzFlMU9LVFpEZDFLUGZZ
d2RBTVNCamNBWFVEVW9FMjYxcUE4Rm8KLS0tIHBwYjlMU2tnUTZweDBYcmZXUC9l
OWFUeE9xdldpTUQ3cDFENjU4YUVwSkUKp7yZGpvKMSm6rvsoPbcaqVznL3wzGEXB
OGzrmgY083Gyjb5P/0wPY0ShGMWfWQW6vGchoqVuwr4oHKT3APcrIg==
-----END AGE ENCRYPTED FILE-----
- recipient: age16e7ykphshal6qhwfvat698hl48s8yr0jvzh27ecdyfh5uk7t9u6s753jgy
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWRjBjdGFEMjR6QnQ0a3Nz
c2lmVWE0bFh3amRULytZOVhYS3dkL2JmRVhVClVQalh1WjJqcWcxT3ZXMWduN3Nl
UzdFNXNQUmtaaTVIVVFVYXkyZEFPUncKLS0tIExrTDA0OEJzQklQOHNJZzBJdzJP
MVU1UW9lWFJnSTE2aC9ZL0huYURUK3MK5U4cLWRMm+FFo8ATE/OoAcHzYHFMpOtV
Q5kbq5PDMdp4qvoM3T4kLsB34oU55HjFvac0pilOhNRrz4xRMQgvoQ==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-29T06:38:42Z"
mac: ENC[AES256_GCM,data:tb6UXalJcNqd1bCJ4pdWQ5lctAXMrwAJsGagNIjtAklVx/0vibEBTvtVdI3CSNA3OuDguyXc/ECGEqlPNpoRq/F5JINfnirEbaBL6KhNkFxaSLVP7mu1u0KH93qhzA2j4jofderpxj+FvOOMVZNuZkrcSPDoufPA/ypY+YaKuu8=,iv:KPyXi7AD6FSmoZKYUDh2zLZnArvdcHau5XZHk8CbwI4=,tag:7T1jUJ7eNkY9VYt2eP+brg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View File

@@ -1,24 +0,0 @@
{
"data": "ENC[AES256_GCM,data:04fSLZEkne1LqLZNYpy1tFlKTVUgQNuX9L3cL66FVHD+LqGAyWJGlAnduY+fQMZdDhbBdeEnJKXjyQ2jdDCttuqbPRiJQChtD7ztf+oiP877N143iSY2G245aCjIrAzmFORkGZaQT7nD5oxgCPiLqJzkNPzgjN4HIDsVoYz6jtw=,iv:gTbiJmdXN/62/t53ddfDrYlNLe3AoujT4G03eFQXyZs=,tag:eAYfhXPERqsVKFSkcm+Abw==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBBb3JtVi92M2JUc3dKVzRt\na1kzNU8ycE1LTmdVZVNFNDNJZmpsTEdCK3hZCjNXajNpcGxXMDJxRjhPMmhFd2la\nZy8xUFZNZXhiVHFtbG9xVmJ3Q2d0NE0KLS0tIDlNWEJqcSsvQTFzc2FxL2F2bVVs\neS9UenMrYXNKbGJVTnZzN3VscWlrRk0K24RHbcTz56GV6AbQt7Yy9+1NClMpQFtk\nf/NO2RYuS0ciHwkJQEw7M48iJuwTSiv1pflXXkNvkl6/I7wPgS/eXw==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age16e7ykphshal6qhwfvat698hl48s8yr0jvzh27ecdyfh5uk7t9u6s753jgy",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxSjFQbWd4SUhoOExTdnFk\nd3dVVytZaDAyc1F2eUowdmY0azFKbWJ2Z2pZCnhYQWJtVXVjTTRvTlI4SlVyVHh1\nZlBZTlFheVNKdzN5a0RHM3RkTDhzQncKLS0tIFlpbjRUSzdzS3ZuMW8welNRODdR\nWis0ajQrdUNqVWcwMWF4bVlUaWsrc00KfL/zF2RiAanljrNhRT99i2jPvLySMWXx\nEyzYRuTH8ZGXsX4T2VAPjreBt1ahJ/EgBWmCLibEVK62zWfdquAZKg==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-09-20T05:31:41Z",
"mac": "ENC[AES256_GCM,data:7kp2KNU4O1yuBdu7cxzg8BytPWiP8hQ0/mWVKPPn4BXjFleyo8KzLC3XZn9Ovt2fHWiF/4hMreOPIDW1W+8n/DedLa2G+zkHiQDVBCyiLJ+FCELvNPdDwR37RvOJ0Oo3RtQaSK2xBhNwS2Qs1G7DemEGFrWXrZ/SeCG5H6bI4X4=,iv:zGG9jcC3McICjeYZd1aGud+VaUhLXg3J/demAqM4vUM=,tag:RINzMA36WfaTRuEy0cTQKQ==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.9.0"
}
}

View File

@@ -1,28 +0,0 @@
inputs:
{
config =
{
nixos =
{
system =
{
nixpkgs.march = "broadwell";
networking.networkd.static.eno2 =
{ ip = "192.168.178.4"; mask = 24; gateway = "192.168.178.1"; dns = "192.168.178.1"; };
cluster.nodeType = "worker";
fileSystems.mount.nfs."192.168.178.1:/home" = "/home";
};
services.beesd.instances.root = { device = "/"; hashTableSizeMB = 256; threads = 4; };
packages.packages._prebuildPackages =
[ inputs.topInputs.self.nixosConfigurations.srv1-node0.config.system.build.toplevel ];
};
specialisation.no-share-home.configuration =
{
nixos.system.fileSystems.mount.nfs = inputs.lib.mkForce null;
system.nixos.tags = [ "no-share-home" ];
};
boot.initrd.systemd.network.networks."10-eno2" = inputs.config.systemd.network.networks."10-eno2";
# make slurm sub process to be able to communicate with the master
networking.firewall.trustedInterfaces = [ "eno2" ];
};
}

View File

@@ -1,50 +0,0 @@
users:
#ENC[AES256_GCM,data:uBjvj5Y6SIk8,iv:WxYu6Xkh2T7kb3uLqgkJJtHvCmWyvntcGfCKJfSfSmo=,tag:ueHbPNX3KOVO9RdQnw/nog==,type:comment]
xll: ENC[AES256_GCM,data:Cp2wBFygUBlZnf0oAAxB5L8/qD/LwKksp0YG4Ic7nay8E8kXJGSYDyTK5AdeVh8/MxLgVVY6LMWtUOzFe3WU1u71pgBGF4x+yw==,iv:wXfcHuJzqWmm++vysZW3z4TLEOkgWTUF/pqFDfgwny8=,tag:k9o2yp1AksTGOgREOLlprQ==,type:str]
#ENC[AES256_GCM,data:4CsCDEg/UChs,iv:ENErjaF65B1dCuD56/DCqe37WSCu1q28s2khMyF7I8E=,tag:q9mxHCAsuDGygseYU0pRDg==,type:comment]
zem: ENC[AES256_GCM,data:cPDlicY4vrQ5VTyfCVN0zH5EIV8kH2xqlFEUkmwO3TmKV69Qx0nE+6yiUhENKR72zY3p5w4ZFEtF7maqqklWvThkeSs059aFpA==,iv:g+nASIzOUZuyX5MCFcKOJKsKTQhcpSY4sIKArlVZh8o=,tag:WaAYcxHmFs6/EG3oy56xJA==,type:str]
#ENC[AES256_GCM,data:fu6KBkGEtzD/,iv:OzClxptcUbrbgmYYoQYcInG5Tl6HrjSRVrt3iIaSrqI=,tag:kc+AxJ7UI45j6eW69CiBkA==,type:comment]
yjq: ENC[AES256_GCM,data:QGpjtIrtio3Jc4kGam5cjqCHZJl2c0wWQAD8BXXhiWfwbQF+sQSTk2V3FbvOlHjqcT92ab8qWCCFjIqBH4DJUq+z/eleX6Y4wQ==,iv:aky2Q2kpEf2EhcR9UXIAyf+BSW9CIZCGbyZCp0l3X4c=,tag:RHLILdrK3duFA2iZDDigEw==,type:str]
#ENC[AES256_GCM,data:YUQ73+HZk69O,iv:wY5da+RRnPpXOD5+HdKkyYZ04ZpB3NBtRjRq5Utzlvw=,tag:BE8MhvbxTkn3rG4Pe/zitw==,type:comment]
gb: ENC[AES256_GCM,data:AkPFt/GGyeKdYtY/cW774Yi4rrxhTFRzXe/hf0rbwFESwf4pwgfdcr9e3bp6mfmNy86CCDMsUVPtg49q+DV+9CwHU1ETe1vIbg==,iv:L/kLfEjt3WEQmgAXjOAsnE2Sp45DQP9LLKcZe1FjnVs=,tag:HluImuMHEhiE8yAw3fjNQg==,type:str]
#ENC[AES256_GCM,data:WCkGncBugE2H,iv:ZN3edJuEDKrHo9OZs0jbU1ATI5+WpfVul5i7SK51ME0=,tag:rgxwqwPJcdDNMnRFlxNplA==,type:comment]
wp: ENC[AES256_GCM,data:n7S4got9Q/7s7rZQldnB1wJlB36uqjremc1UDeUmzs6I9Gp9YPj7dJBDAHBNzWruo83ciP6PygHcCmHzBojISgW/HdD5j9cgJw==,iv:ymjB5YWxJJXBA80a2MPYHXBV+bNxUhroPWu+1GJo4XY=,tag:GGVz7kzBrSomBityyZBdvg==,type:str]
#ENC[AES256_GCM,data:2aKW2wBhF2oG,iv:wXRX5ZAr5O0c/H1WvzK1+kG1NbZU92h89NgXB8lHfMk=,tag:gAW2oQxz2dUthyNvMlmxcA==,type:comment]
hjp: ENC[AES256_GCM,data:+9MKYP96nBdLFVcTkpSS/hiTLdTOf5+Rs3dpUus/ym7gl2+aA2rGtlGS+ozALeUV1seNlVAuyhclZG2dH9uhaudlQvQw5ntAzQ==,iv:eobXw5ahEl9I2HlXD+y3NtGFOlPulk+aKVFxuCRe2+g=,tag:zt6MveyltO2xxThG9grZqQ==,type:str]
#ENC[AES256_GCM,data:WLU7JBd7ZNES,iv:GkmmM1n0Squ0rundsz4Q+1dkF9BcCaV1hID8bt/gmxI=,tag:MMukyZlOeE0CcnI51VYPWg==,type:comment]
zzn: ENC[AES256_GCM,data:5uNrzv43K/TQlGDldxqUYscDoEduTJdRz0jgd5dBh3N3bMNHulZbD95IVAj87OkLgdOtlDPZz3DfB5oxKBVcV0XE/E7GwJKILg==,iv:SB/uOB1SdhC5zGCY/OzBRY6wgGQLwKYuFgekxZpX1Y4=,tag:ckOxmdXvhQjGMPssoLeMPQ==,type:str]
#ENC[AES256_GCM,data:xLPmYdIcIUz7,iv:NqaKJJgyMwfVfAYgEAMHXo1qLYfyOHhIcV++lseKcNQ=,tag:qXDuROf4A9T2H61KtrQUpQ==,type:comment]
GROUPIII-1: ENC[AES256_GCM,data:izqFF2JD0ZEeNlqrQ9sJcEcrnp/WmyJL46jszmR4fLwrFGcMoekSfOTkzjO8upogY5fIDsn02dwh4mLX74vA8DjeRTaDKZyyfw==,iv:lknYrGgDFQen2w8mtLNHewQXara1ikWvGdvVA8a6Fyg=,tag:EiiMBUhF6YOafD7MCIMA5A==,type:str]
#ENC[AES256_GCM,data:Zt6KCQ3chnLi,iv:RpMBGf2zDVWN13PpTr0Zj18ORdIZT2u34BestCjyLsU=,tag:aBuN2QGhxgnOXPC1NOoROQ==,type:comment]
GROUPIII-2: ENC[AES256_GCM,data:fAczfnHue47oHJm/8Hcu8iC+scxUQRNZlJWSCFnmtn8PzbOtPXGVLYaZJs3SRE0F7yYsOUZlHnEPaK5bFjCHioindbS0oimBfQ==,iv:F14TVM+UxXm0UbAgLmQpkI4v+jhQ84a4G8IuWRw1k/o=,tag:R+r0be31nLC0T6Isl9/sdA==,type:str]
#ENC[AES256_GCM,data:xccChTyxO80R,iv:tSxhbmVwhwD1IbXRNglS+WWMXfzUDaoJfCNqfKWqVko=,tag:XrFTahck6EKRf79NNeMRfg==,type:comment]
GROUPIII-3: ENC[AES256_GCM,data:LQAAYOKBVKRsVfwRJOr4jBCqnHKG60euQMngfuI82Dewwtnt4fKZ/iDg6otJIXwdMdiYI4ytr573GaAPyadt/UdDv+EqrLQ3qA==,iv:dD7djoiEBjrZCQCKkjzsVD+IK7T9sL02zxRG3b1uwQ8=,tag:sqJ0Q665aXVnPHWlTS0Rag==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyQy8reUxHUm5leVk4dzhx
L0h2ZVVONnlEWlBXWlhKa082aXJGRlhIaUhZCkQxSFV3SHcyQjNCN3NyK3h0V1hN
SHVZYXJjenlPR2lrL1J0ZkpoTlQ3S1kKLS0tIEZPU2c4VHpzdEwzWTVTUk9OdDFI
em9JMjA0VFk3Q0NKSWt4YllkWHpYNWMKJxCl3tXFHSUfawt8pB21WLKvUWwTn+Jl
gz52soH0P/k7bg6Lx4gs5WywIIIOWnHg7p0BJS9BCmFWvXR442c2XQ==
-----END AGE ENCRYPTED FILE-----
- recipient: age1lee0kl24f0ntss6m69zu2s2e7njdpkv9nl7rlf4nn7rvv0mlgvfqrte2y5
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBIaG1ZdERieVMzM2JjY3Zt
KzRTVCt6eVRsSmJXT3FKL0pSVHF0L25SSGlRCkg5bGVHcEhBam56bHdBcUZHRWF0
ODVkamc0RlJxNk5hRjMzTVRkYVNsam8KLS0tICsrTXdGMzZ2UmE1VmNyK3pwME1u
bHQzK1EvVEhvZFI5MjVxL0Q5UVZYdGsKJl2M3eOB0lRyu2VO1qDjW1pNJ9HhwAS6
g5yOa2fxLJn4bvmQAJYeNJ1Wi6sYaBvkbeOegjaKjW4ZvwhP5kWqRA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-29T06:38:50Z"
mac: ENC[AES256_GCM,data:pQDphBruG5s5trIOY1fvcCAnLDx+NcVJ6cEP48u92JRnM5cojYXbiFt6Mlq+bYLxkXb2PoKMBoohRbsNdYLRgz3BGAY//Kc5OHGWzi7r9t4/iuhcouZsV/6wHGnrJ0yECS2+LPkT+/JXnYv1ZJTpUR0TSmTvnCgJI6xpWt8HDSA=,iv:Oyn7UESWVDqh3kDFAX3opbC/XEYOa1s3wmGolc1uhTM=,tag:aasXTc9+bgLgCaLDNfbJGA==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0

View File

@@ -1,24 +0,0 @@
{
"data": "ENC[AES256_GCM,data:9uBZv+GmpEqEbpE1E4szW3EPA6AJPUprWMQs2XwXq/VfrOfVG+Dz6PsAfPgOgii9KMPZb+358lfdhXbKF2cjflMw9Iz1wc2eU8vrbbU7toisLnuYBm2676wKzatQVbL0SHvlyScVIEwNphTJdIPJuMD0JrFMfDV7J/jdgwdpPRE=,iv:fk1YA7IXX/9/jU9jqAg4YrFZrprm9zoBw5avnKtvBnw=,tag:rfsCsir2C4UsUTgfvbRCVg==,type:str]",
"sops": {
"kms": null,
"gcp_kms": null,
"azure_kv": null,
"hc_vault": null,
"age": [
{
"recipient": "age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAzRm9wakd5Z2cwblM4a3c3\nVURGS3prTHJ5R1RzOGpXaXFOcFlNWGJCTGtjCmt3Q2M1Z0FaTGRscDlOamI2L2Yy\nQUlaNWJMcHdEVVIzMzdYVXdVZVpHd3MKLS0tIGlscllCSnJCS1JDNEVXWXhJVUNa\naFlPSU9lZnpPbFY3VkI3NkNtVlNTWHcKfRcjJroaUVDePl+mg22NndJfFciAuolg\nsOEaEZCH/cIJg0XTXfM18ZRUl4IuMmR3D2L4KAhzbfADNmC81mpMLw==\n-----END AGE ENCRYPTED FILE-----\n"
},
{
"recipient": "age1lee0kl24f0ntss6m69zu2s2e7njdpkv9nl7rlf4nn7rvv0mlgvfqrte2y5",
"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZeDBPMWZnRXRPbkRXQVpm\nL0pwWDE4blRuYUV6QVJyOHBITUJjU1ViR25rCjRJTmF0MDhjNEhFQVNHZ3M4QUJ4\nQ05DbTlVbjhMMDhTdGlZN01tRUxOZE0KLS0tIEExMXZTSzJjeEdqcHBNWjhGSFIx\nQmJaSHh4dHdUTjRmWUZIUFdmVkI3YncKvCunmgurC7YO0Y5FssulaJ/VDvuiR5Y+\nOxfMe34ilsF+k8bTBAuYLlDCl8uQ14cPiOLAhAw1vdFgs9o8cs9MUg==\n-----END AGE ENCRYPTED FILE-----\n"
}
],
"lastmodified": "2024-09-20T06:03:27Z",
"mac": "ENC[AES256_GCM,data:sEMEYJDZhhza1HvtmQ9maK9gXgBNfNGDhvSySoz/GuiTrs2Hhae/YI+o6DvYHPDUoOJGVwLjHVhfoIYw9CvoCZNm8Gn3fUSeP372x2kRAjFJYJ56qovU5hz7H/m1Mm9CQ38PvnsWMgc+dB1q0h01g4x7/URfjJDlU+Rq4n3f6B4=,iv:v/P0xSTBjGrmhzeAiS0eaQ4Y7pls9xCKPq9gysLuINY=,tag:SsCPc1av/pGpZS5AqzJdxA==,type:str]",
"pgp": null,
"unencrypted_suffix": "_unencrypted",
"version": "3.9.0"
}
}

View File

@@ -11,38 +11,39 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/4596-D670" = "/boot";
btrfs."/dev/mapper/root1" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
vfat."/dev/disk/by-uuid/7179-9C69" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/c6d35075-85fe-4129-aaa8-f436ab85ce43"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
luks.auto =
decrypt.auto =
{
"/dev/disk/by-uuid/eda0042b-ffd5-47d1-b828-4cf99d744c9f" = { mapper = "root1"; ssd = true; };
"/dev/disk/by-uuid/41d83848-f3dd-4b2f-946f-de1d2ae1cbd4" = { mapper = "swap"; ssd = true; };
"/dev/disk/by-uuid/4f7420f9-ea19-4713-b084-2ac8f0a963ac" = { mapper = "root"; ssd = true; };
"/dev/disk/by-uuid/88bd9d44-928b-40a2-8f3d-6dcd257c4601" =
{ mapper = "swap"; ssd = true; before = [ "root" ]; };
};
swap = [ "/dev/mapper/swap" ];
resume = "/dev/mapper/swap";
rollingRootfs = {};
};
nixpkgs.march = "skylake";
grub.installDevice = "efi";
nix = { substituters = [ "https://nix-store.chn.moe?priority=100" ]; githubToken.enable = true; };
kernel = { variant = "xanmod-latest"; patches = [ "surface" "hibernate-progress" ]; };
kernel = { variant = "xanmod-lts"; patches = [ "cjktty" "lantian" "surface" "hibernate-progress" ]; };
networking.hostname = "surface";
gui.enable = true;
};
hardware = { cpus = [ "intel" ]; gpu.type = "intel"; };
packages.packageSet = "desktop-extra";
virtualization = { docker.enable = true; waydroid.enable = true; };
services =
{
snapper.enable = true;
sshd = {};
xray.client =
{
enable = true;
dnsmasq.hosts = builtins.listToAttrs (builtins.map
(name: { inherit name; value = "0.0.0.0"; })
[
"log-upload.mihoyo.com" "uspider.yuanshen.com" "ys-log-upload.mihoyo.com"
"dispatchcnglobal.yuanshen.com"
]);
};
xray.client.enable = true;
firewall.trustedInterfaces = [ "virbr0" ];
wireguard =
{
enable = true;
@@ -51,17 +52,15 @@ inputs:
wireguardIp = "192.168.83.5";
};
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
waydroid = {};
docker = {};
};
bugs = [ "xmunet" "suspend-hibernate-no-platform" "plasma" ];
packages.vasp = null;
bugs = [ "xmunet" "suspend-hibernate-no-platform" ];
};
environment.systemPackages = with inputs.pkgs; [ maliit-keyboard maliit-framework ];
powerManagement.resumeCommands = ''${inputs.pkgs.systemd}/bin/systemctl restart iptsd'';
services.iptsd.config =
{
Touchscreen = { DisableOnPalm = true; DisableOnStylus = true; Overshoot = 0.5; };
Contacts = { Neutral = "Average"; NeutralValue = 10; };
Touch = { DisableOnPalm = true; DisableOnStylus = true; Overshoot = 0.5; };
Contacts = { Neutral = "Average"; NeutralValue = 100; };
};
};
}

View File

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

View File

@@ -12,26 +12,19 @@ inputs:
{
btrfs =
{
"/dev/disk/by-uuid/403fe853-8648-4c16-b2b5-3dfa88aee351"."/boot" = "/boot";
"/dev/disk/by-uuid/24577c0e-d56b-45ba-8b36-95a848228600"."/boot" = "/boot";
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
luks.manual =
{
enable = true;
devices."/dev/disk/by-uuid/bf7646f9-496c-484e-ada0-30335da57068" = { mapper = "root"; ssd = true; };
delayedMount = [ "/" ];
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "/dev/disk/by-path/pci-0000:00:04.0";
grub.installDevice = "/dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0";
nixpkgs.march = "znver2";
nix.substituters = [ "https://nix-store.chn.moe?priority=100" ];
initrd.sshd.enable = true;
networking.networkd = {};
nix-ld = null;
binfmt = null;
networking = { hostname = "vps4"; networkd = {}; };
kernel.variant = "cachyos-server";
};
services =
{
@@ -39,7 +32,6 @@ inputs:
sshd = {};
fail2ban = {};
beesd.instances.root = { device = "/"; hashTableSizeMB = 64; };
xray.server = { serverName = "xserver.vps4.chn.moe"; userNumber = 4; };
};
};
};

View File

@@ -1,25 +1,58 @@
acme:
cloudflare.ini: ENC[AES256_GCM,data:X1v1QuOZemIuxldd1bzIvbUsq+8HMGLh91zUB+fnrxaW40z0OQh9L1rF/0Nj3gmUmgT4KEV7nkHFYYpZBp4/Kyc=,iv:fQmbhx9wV3l+DVPaBrAyJbTCsS3q3s5F9Go1F7pZ2pQ=,tag:P4vuruX460YSOUsx6zGHXQ==,type:str]
frp:
token: ENC[AES256_GCM,data:T8b1ku4HNCNSJ+33QgIt1GILFA4wTu3Qd0rDqHPVgdqsGo0R90k0u8z+dElSO7q9PapTqUbZ,iv:hwnMu6JxfYLgw4TyhujX5dI2IAytgZh+Bexhgta6ATQ=,tag:lqgwvXlS/jGPxasmk5Vh3w==,type:str]
xray-server:
clients:
#ENC[AES256_GCM,data:d7cv,iv:RHzGIDLuuKejCTQ5YlNNITkCS3VoprsqH/kHckdpAv0=,tag:3cYw7uyUmXALo3v7SiqLJA==,type:comment]
user0: ENC[AES256_GCM,data:o2wxpSzoqsPxs6grgYRLtPutMVwSqtzUWBrj7+7QuWWd1a1z,iv:2/5SxXq8Iw4J/LzBeclHbkrZXHitguip0WN+MINym8s=,tag:v/3oly53ORM9XAwbOzp06g==,type:str]
#ENC[AES256_GCM,data:0nHZmEPPaw==,iv:BtOZ8/U0yg3fthHrwerNQX3+KD/H9+fcUylYGnZqiIM=,tag:DkFGSFfq//LmWfg6DGm1aA==,type:comment]
user1: ENC[AES256_GCM,data:7ev7GuKLeJbPReMy0FnX02fLv5nNCpxdzfnQyAA+/IviwDMQ,iv:YbESsyIAiEAyvrHnj9A4lITX7NtRkuRhCrTv6hoG9Qs=,tag:8uledxLXqpXXLBh+cczm4g==,type:str]
#ENC[AES256_GCM,data:3KN/1hzeR2I=,iv:iaqJJD6iURTUlIL8e8P7fsAzJYo+y3NGZXgWmPX+4ao=,tag:e8g/JgVrMrWJamUMpiv2pQ==,type:comment]
user2: ENC[AES256_GCM,data:58PnLCwDayOYinsPCYPeMvuKiF7b4tZtbmEJFWEl+2Nu6HL2,iv:hSv3jCtkLm4rrm/4+ot10CBhobGwtnK5db5wR1S/XrU=,tag:SQbynYp8pDSqj4tAK6JBMQ==,type:str]
#ENC[AES256_GCM,data:uTZDsA==,iv:6cxvQycfji/x+DW1CnO45r+yNTLwkhYkiJwDaSpUCwo=,tag:8pMw+sYeOyZBN1idHoM9+g==,type:comment]
user3: ENC[AES256_GCM,data:WCVr0ylGm2SHtOGulb8TD/cI2xJXrbvY1d6+STXGxf0d0izb,iv:vhNshb38AVpwKCFRwUVruCQ0SxhHrOmwQ+IoQZeUj1k=,tag:OfdIjRrTAuVZBOEXTtnrQQ==,type:str]
private-key: ENC[AES256_GCM,data:akNIeVp2bfKvnzlS6KLAdqAo7qsGfPatzCZpN1tNRLhRVXmJCcUDVSmVoA==,iv:2Rny8ioDJ2x+NR+n7/Aluv7JZ+Om3MuJKsXiwONYntg=,tag:a3xubIr7hpVjRiHjFL/q5Q==,type:str]
acme:
token: ENC[AES256_GCM,data:JBeN7SVxKGOe6er0eS7/v8YrXdv0nCK/KZc8Ygq0G7FIGu4hO662kg==,iv:rf59MgUCYlAA5h18wtdWoUyb2VPB13OPuJjz1VsI2dU=,tag:ViPrwduD8aWf8i8vmBG78A==,type:str]
#ENC[AES256_GCM,data:DXEC,iv:SZ1AhmK6fWQ/HGDk97kDUcRN84zQMp99eiz4SpRhig8=,tag:Fkdf28ZvB8XKCxSYdjuuHw==,type:comment]
user0: ENC[AES256_GCM,data:rJ00sfe/oJSry6Ixn4Bn+p41syqsOrdWv6fRGVCwPvn/unMY,iv:htTvFMvhIRkORA/gIU8J7CgA+tOncYQWh7sUh+F6XDs=,tag:VrSJBD7ti9WtSLHoWjMClw==,type:str]
#ENC[AES256_GCM,data:OVgDU+zqcQ==,iv:8KuEqBuL5Ca6pUOFFA+vySJx/h3BhGAAC0CgnxiW46o=,tag:TY1MajSSy2RjKVI2SSAAFw==,type:comment]
user1: ENC[AES256_GCM,data:S3IHO9FcVHTJOsRxjSohM9MgnrEwLdDpFU+efLkQaXT2jNJG,iv:KOesvPzjDfm1EDLFiegbk0wgjp7di5mUwUuuY2hwvOQ=,tag:ZsYyUyyEhO5S3weCw/gPMw==,type:str]
#ENC[AES256_GCM,data:OQOPobpbbhajgA==,iv:4jG3bHKzWcR+JnvSlJsc0Qlv5kywqVN5UE96J31CP7Q=,tag:P+jJkRxPu99tLXyO5k6dRA==,type:comment]
user2: ENC[AES256_GCM,data:e7ITe2ZouKr8dXT7SYATyzbzHaVeu6AKt1OcQKk3U0nsQgoa,iv:UbOOuojy6OAFEH8lGhKe5Hs+2K6FX5MZ8Br9AB007gs=,tag:5XeB4YngzTcHZvCpXe/ZXA==,type:str]
#ENC[AES256_GCM,data:93BxR0AEdQ==,iv:rf69GWpuxYt7fu1Fyv55pynuQDhi+TA5CwZK3cc3yBo=,tag:/hLy6atNMxLw6G3/qgMM4g==,type:comment]
user3: ENC[AES256_GCM,data:r+6jXaIj4HJoYLnJcnjJB+WEZlGaoSy/ktc1Aw77hFtNrrGp,iv:P+YUKns1yaOZokH5WkDB0jssGyHg3ncc54tF1PyA7Oc=,tag:/pxMEr7l4ye5EDAOsllxJA==,type:str]
#ENC[AES256_GCM,data:4gqZh391hg==,iv:No22DrD6EBs2FA4/qH8msWEjs20fc+ZpEeZep+HIv+c=,tag:aHrYNbI83POI4PRj1nd+Yw==,type:comment]
user4: ENC[AES256_GCM,data:ujiml/r4aFiKOkSJkaD/KE8rKuBtLSnpZREBH3vRJUzDT0QM,iv:a3VFlXpMLNFihvFa7gloANtHmBLg4szTL5LTm8E2kNs=,tag:W9KZ1GAVx9IBKfda7Zedng==,type:str]
#ENC[AES256_GCM,data:PTYBkBHs16U=,iv:qr3u7OveM1CmTBIf9gZK4fTRuLCpcZCwf8jmnd1L3Co=,tag:w3O41NG7yCwCVqPGh/6SXA==,type:comment]
user5: ENC[AES256_GCM,data:iDuLRb4dhLUOjpamioMwoTYrn7Cy+Ln4SaedVXkwVD05rjJ0,iv:AqzBBvLpJuIJCUJq0IyDcHrlqb0e84nQC0c94Rj85uw=,tag:0xou1i/iwAxGngO74OIMXg==,type:str]
#ENC[AES256_GCM,data:D5xiJW0Oyg==,iv:9a/6myiT9Crf/fff6ZkXj/obW2k95cABUNqQdPmcwcc=,tag:chs8BA8YtVkM9m3Ey9ETlA==,type:comment]
user6: ENC[AES256_GCM,data:YzLlf37SxKmU1/QA7gUIJsGid3KZNoAGOew8xR7cmw5l8ZmX,iv:SfKubo2jfjtxKn9odDiokMEZyPFfYZ/wwyYtBrgvgmM=,tag:+hxwIU5uBhzQyrKX4r3oiw==,type:str]
#ENC[AES256_GCM,data:8FxApg==,iv:vPa5p3QVHAvw+ECusWGqx1ugTcHh42CVFDQcMhG59wM=,tag:lHiZtydcYFBQiXnWh8pCrw==,type:comment]
user7: ENC[AES256_GCM,data:H/jje9ONEY6XuBXTZmTVGIcWUgGSMf5OB1NNRPtqGCgRP1ei,iv:xew+0BkRqz3nfOoBXTPbBv5hRczy/3tgYSKq432q4iw=,tag:da2ljcffiCVJCsMZaNPZyQ==,type:str]
#ENC[AES256_GCM,data:QdaYYH3RGJ4qIg==,iv:79NBTEKCPtgVVv3G7wg+vdoLOWxc+bdqT1lF4HJpTC8=,tag:8mRFGjy7lBrdyGyX9vaSOQ==,type:comment]
user8: ENC[AES256_GCM,data:H1gPtqF8vryD0rVH7HYzpMuZ3lufOBYczKwaTr4PidQtTyQK,iv:wh7NwFc/1ogNrnTTpm5L9dBqDVkvWiIsJZelR2mtR4Q=,tag:oEFdMFZJ9UYhsSVdefJ4rg==,type:str]
#ENC[AES256_GCM,data:aYWIiLxs1UvupQ==,iv:AisokHuAzD5B6fEF6ak8WfAe151CM3a8MsaWC4uJPnw=,tag:cdk5S4n9ulyWrqsD+jcqYg==,type:comment]
user9: ENC[AES256_GCM,data:HVK9KvGfOcwn1joc3VrkjBjE6hrxQPOBD5RTtQUgBPepToh6,iv:VK9aQ64L/GajpledBxC8PNB1BdNYEqwcdL3GKttgxvs=,tag:O/piztCYBARtAFxTMNXGaA==,type:str]
#ENC[AES256_GCM,data:b839t/OihMOmz0gIcTo43r2MIw==,iv:8kaAFG7DhFOoitcvbFaAvE1NUSLFrFhy1KiMrqs4r/c=,tag:G4vSADa52ZfN5y5ytoFJoQ==,type:comment]
user10: ENC[AES256_GCM,data:xjVkr/wy7OxRuNZKfQagfNxdVxTEyQP1ZhnR6jHy2gjBQ0RD,iv:G6iOBCHOqlvfEENY/ega/TUm81wgT2OOdZKZ6bPfg9o=,tag:p8AMa3bGsIl0hWQ09lSzgA==,type:str]
#ENC[AES256_GCM,data:+s3MMeNU5Q==,iv:CUrg+nNxCpJFbHQmMNXmSE+JcZK6Dfu8cGwtznx3CFY=,tag:G5CYMtao+hz3hs0fPVPmcw==,type:comment]
user11: ENC[AES256_GCM,data:BIZ2zRgGv5/9AexiZZvu+m4A62YUWtAkjWWMu89GteqpWMBq,iv:13IJcDf18LjoxJk7uoKnuFZT6Ihxrxsy7DBaAaiFqus=,tag:RN7wj+uPneCkqNlMRyYrXw==,type:str]
#ENC[AES256_GCM,data:spyQkQIHwg==,iv:7+0DUK95MPH7lpr+GMbbLu4/5yA11/4gTuLhQKlStfE=,tag:G/gIXML8UhYoCi9FfoTvSA==,type:comment]
user12: ENC[AES256_GCM,data:FAF9lXOzXW9CrZgnQ1a2+E8snZj2+JHqP5Gny92k09o/Wzga,iv:/qZuAtFmUQE7A9lMzJUoCvGx+3Sv9Ioh2ahch3puaC4=,tag:urwbLwGkSX3e85NCjyPhhg==,type:str]
#ENC[AES256_GCM,data:HueqiREBet2bxQ==,iv:WCjTAGg2gXgBSvY3zc/YyB/1X0XjvphPduVXLsjOwH8=,tag:wC+On6lyyYQ1Dt/BHDvONw==,type:comment]
user13: ENC[AES256_GCM,data:ExbnvWDIBqga5+k2mpoT8AKBOXAvUNMjBTPXUKrmtWzz4l+L,iv:UI7CvSx2FHYGf6BEHS4e3iwHZZWkl2Zt5xg2WdKbLvY=,tag:ad0c7YW2Bxo+Dn+BoSZ0Ng==,type:str]
#ENC[AES256_GCM,data:R8lN5T0=,iv:FXLf8Vtjg+PkwNhxXWDViMKqwn7tFMaPhio9zhnudZw=,tag:34gxRH+P9lmkUxlOPKcYMg==,type:comment]
user14: ENC[AES256_GCM,data:dgNPPlJD5JOFPbKhlvlRHBLmUNKeDm/JAiawUVpBE7H07Box,iv:w+t9BkqYvlxVKr+x0MwtBz0/YSR/7z1OnZLIoPdW4gc=,tag:CR3GLbaO0jSQgA2HuwzRqg==,type:str]
telegram:
token: ENC[AES256_GCM,data:xsJoGgQ8pLeZqA2alGKkCyrvnjY6rVF5TlXn4GWDrStFBl65XXzwVY/9ZZthYQ==,iv:qTLfpRUyuIGFM668URfknhSRtx3WEHp/WTGzGUPuFd4=,tag:p8mF0tM+t02g7v2EQZN3Vg==,type:str]
chat: ENC[AES256_GCM,data:X1JxFQw0bPCu,iv:hf+TOSH2p9RdnXDFKxTpSRzxDLdJyzNHVV8MfOQuGWY=,tag:iiWw9IFiBGOOyOSl9Jj2wQ==,type:str]
private-key: ENC[AES256_GCM,data:ts/LRGFAsYqvGvkvlxUI42IW1a8cGsSkpZhMDd3QVceRKvhPb1SRDaXoSw==,iv:6xX9xFIFUNlLBZ6CPBOz9JbHpvC4+QG9ZaCZcWdl12c=,tag:DYIa+QTV8vyl1l7OKKykTw==,type:str]
nginx:
detectAuth:
chn: ENC[AES256_GCM,data:lQHDpv8/Yl5/nycHoeTnCw==,iv:ernNxRpcTOSAllDpqRFVFg3qEw/slEEPPXDFq1AhNL0=,tag:2AVALUf9cDyOgCqI9wwgQQ==,type:str]
led: ENC[AES256_GCM,data:zyCiiH21,iv:iEYyNClDsCpWE2oNjt2NqQZ88xOOlMr0yycjKTPdmlw=,tag:kQfbshXfTBA5PtUAgpgCcA==,type:str]
chat: ENC[AES256_GCM,data:pXu0WPWmvUzvl2expDpQPqWwi1A4abg72npsaYXDXRcg6aVU0Ec+tgM2+uz2hT9rh3mNoBxadYXDc/zeOL1UCg==,iv:iln5UGGBK2s5pGS03PtolWTkx6KrnYBAWCFnI0V2Bag=,tag:EahTDoPIBkgWnp4MOoTCmw==,type:str]
maxmind-license: ENC[AES256_GCM,data:8OioibcXQ9IZ0OQhJ/zHSBQjfdHzkoqwUx5zR8Zq0atNw6SSf7vKrg==,iv:z6WTI2yeqP0h7EqKG114nRQpFVJlNzZspgS6gIFtpt4=,tag:a0dBt9pXJnncBiSKt9dsAQ==,type:str]
telegram:
token: ENC[AES256_GCM,data:Si6yTh48HpA8OkkkvgHwtJYFhF8tW3oaQbldjwBc09QJxp9AoKgASMnZtbDZYA==,iv:GrNyZXjaZMviSjy/LGHHrYTr5PFvDkCXmT3MU4+SLpc=,tag:YifB1tKFLqsgXB/YLqYK4w==,type:str]
chat: ENC[AES256_GCM,data:ydPky0W4ZWqn,iv:uWQrZDz2GCxiKRaijM89Npt0fQeSNHbQzDefkZCkUAE=,tag:OJQwV/889Vp2/4wjbN41JA==,type:str]
#ENC[AES256_GCM,data:85LrqdTMIhSa,iv:mIQPYz8VPd5AxeMCQEdTGMD0Iqa5QEAa5+8JVFaj3JM=,tag:TcZd7S3WRPpEV9lHI1fzbw==,type:comment]
#ENC[AES256_GCM,data:rVTLpe3uIQ5LArPnEY8N8kjtHq8kZddbqR+nyUaia72Y7PWEfHzy6wgx3Q==,iv:AZEufH3zfVL0XbUh3CQZGYcx6zIMFV4tF+jHf73IplU=,tag:B/UbtQh5dGrctNih2uoO8w==,type:comment]
#ENC[AES256_GCM,data:InzwjKl3R4SJSXTz5u1Pt0kf2HYEtKfSkJO0cbPhhXADNp2/Tn0nwQJFy9EzpMvK9mw8+l5LadbY0tIwmTVvV5yxUQo78HcgXWInfp/zJ+GG1L/RQOHck74lEA==,iv:UBMRYPd0loOQBs3mNyndiKPu72aRA8HbOKWDfUWPQg8=,tag:t/ONqdwpWcbo/2vy5TOjlA==,type:comment]
#ENC[AES256_GCM,data:HTinhnsAbVujUOuLIVT/CkvdtTN9Nk7wZKZ5SyrPC+vZ/cB9E10FffMYLQ==,iv:Clby9A7MIUSknNFkzKuWEDL0yUW/ctd6KShCIEYrDZA=,tag:CJKORoXrspDjRmaSHUnlqw==,type:comment]
#ENC[AES256_GCM,data:cwAb68VgebTwCCeAFUbOG0CUAuggfRnLNv9NWldJN+E9NY4WKxs12Nz7yX/vtelcqqJ2TOUL78uAR88Nzavv7VtCTZRivWjRG6GvAUyRdv8lAZo=,iv:PScTSTCuVnsoZlvyTVL+ZgqqEm4m2/fUqWzPwE+PvuY=,tag:1jeRsHqgMheXbcnhRicsnw==,type:comment]
#ENC[AES256_GCM,data:V5XRrTvyeezkcJqw1/BhhZz5K/egpl+PtNwjAGELjWRp7IqDfRsInxBKEg==,iv:LdOTkL22HvaNbiUi6hG8o0ownfZ22OKFGxCuGPqG8xU=,tag:/06I/mLzBlgS489iuwFTuw==,type:comment]
#ENC[AES256_GCM,data:i9PXzaO1od7HimP/6vxYfh30SxFbdXRDcnXujH3VrvngFcWaVcXgigncp3cboi6RoERSZ6yakxviVyEBIS4v0qRfombj2UtJg8N3Kg==,iv:aohIMhAYfZhlGDrcEvi+Qc16nF8ZgrPUGhWj/7nl8Fs=,tag:o70qsk/2cAbZgbVBwfl3Ew==,type:comment]
maxmind-license: ENC[AES256_GCM,data:sESU6uK9EYLido9/0sXO2Zw1SjuKmxPh4r3giJcaG7068gn1kByjsA==,iv:htnFgnLrH35zSvmlRAdoRDLFIpKroKO5dW9TNK9soUc=,tag:6pJuc54SrKP5n0kJJ7fGyA==,type:str]
send:
redis-password: ENC[AES256_GCM,data:6zVKw9AmKwSWvHUZhzy0F2KcJW96uFoZY/N1Zq8ilUJOLZeX,iv:viwLIgJz9v8oadr8784OgETbEsxzGsJvVoxmOwWEFxo=,tag:XEYFnoCGwlnrkqaUbgeH+Q==,type:str]
coturn:
auth-secret: ENC[AES256_GCM,data:50KqO4GQ1ERbCnK4IjYu6aywT+IPMtVlTzh/TE4MwWApU4pO9yqz25ENGUAKRLi4p+Ecug+Rn3InRl1b+q6bAQ==,iv:SgHkHvHg/+yA1Z5E9effgCnZMVXv5amGNUsVKErai54=,tag:PoYLV9Xr0IXXsA39n7wiTQ==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:4DKPPqQkjb33rQzFIz863A2arDRQA9AivWFBaWTf0xXDX4hWvJFiIlJQfvE=,iv:0R2TH3CMxHgwVjojzjE2Gnp8SXonmBDLWF7hB33NiX0=,tag:vgtV8JkuCdspleN/SvgIqQ==,type:str]
sops:
kms: []
gcp_kms: []
@@ -29,23 +62,23 @@ sops:
- recipient: age19ax6vm3pv8rph5tq3mmehd9sy9jk823tw8svsd790r0lkslycquqvlwz9m
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNamN1TytweDd3blJsR2ZH
ZmlocFZjT3ZaUjlVbG1vVSt4a2s2SjJIaGtRCjRneDV6cHYwdGJOY1BDVS9DeDVC
cDdNbUdtSGRHNU1yZFpPc1MzRS92ME0KLS0tIFpmamNmTFYrRGRqbTFVSzBhUlNa
VllXdzZ3bEc3UFY0YjZRKzBUcGgyVkUKqI1ojiLbF87alAkEwyrm8wuW2fLbmj8d
YBIpoDCZ7AwR5uHWQAtl7BWJV1zab+rA3zvaf2BsrVA1A+RWOtYT/Q==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA1QXc4NzREZHlhMDV2WXlM
a2I4d1pjWm9Xd2gzUDUwZ1ZSTkFGR1ZQNDJzCmJwcWFxRWNNVGxTNno2b1NxNktO
aHhINXBjdmE3alFGYk9kUHZ1UzdJUk0KLS0tIFdKMDlvb1Z2Qi8xRjl0MXpKMDMz
cVVNdDRDNmtHZlJEcVRXR1FLVkZrMWcKn2iTHH7/52fJNXcbDFbzOxNAaiQRA0nO
we74EeNzcaaQwuEmBQPKxd/g7/kjhnHzTkoX3OneXMd/gBZMn2knXw==
-----END AGE ENCRYPTED FILE-----
- recipient: age1yvrl4y0r6yzcxzzkgfwshlrtsjt8uuya6rfwks09pnft7esfcyvqmrtm5q
- recipient: age164tyqklwhdm57tfm5u863mdt2xrzrrzac4py8a0j9y6kzqcjy9zsp073t6
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWWitsSnRVSzJDZG9ZSE5I
bmt2NEFDanR3aFJyYVNnU1NlUldRb2RUVXhNClQrTkgzR1dPNWp3endZTUl5SmRs
dEtkSWk4aWJEc2hhbWlXZkxpNGhacFUKLS0tIGZNSG43R0NKYmdFMzdXbmJjSExJ
Ri9hM3NRTkM4Q1lDdmdPemEweEFBUmcKNLL5qH+JeFWX0GovkPFVVAnz+4tmfG6/
1jN8YqbMIxf5/L8tauXPf0iIiHa6pUcjtDZPr/OEmeXebmF6Bh9u9Q==
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBycEw1bXA4QUZkUzJ0Z3pM
Z0xHam5SLzRGV21XYUtxTFh1VnhQUk1NbzAwCkU1Z3VTR1FtZ05GOWNDOENlZTgz
SitzYXo2Q2VEaGtLTGE2UGRoUDkxN28KLS0tIHhRS2Y1cnQreC9Fc2FLdGR1ZXdJ
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-25T03:19:55Z"
mac: ENC[AES256_GCM,data:v6yb7ZYcnPw/8SqEJnSWzmlE17PenjnBH2X8HZp+kIDXzNFyNvD19FcbCBZjwyjBLvN1ZF4M9FS7Y4+CvvMrN/4JcFufcY/V1NrOd8IZisfAT5N3WuopPee4IN9WEyPVOsbFnesZo6/wJKuqlV1UR8UZxCd3/wHXob9Lkz45cBw=,iv:XKIUiRfP0lj8V/Z1HbvhBankdcAjQqM8Way6TWjJJMY=,tag:PLYsVj6BmR132oWsxEKnfg==,type:str]
lastmodified: "2024-03-28T10:31:05Z"
mac: ENC[AES256_GCM,data:6Z+ltjbvQaYhDPoiCN7ajQeWcp6vj3TIcUXUm/r/tZU4mIOvfxA7hxW971b76bYPTeVwgp7ZB9qQy9emDHV9i+aSyJpTPKQHRRz5J+T+NJhTP/IL3R3VmG89ssC6NH8FSk0S487JkPd8tNz+G6bvwFCPRxRLNj1pXX0Dp6tgwIw=,iv:xLw2iX1ODAbJCTJ8fEvG7SdZ1GnGwADIckH8DibVM2Y=,tag:TTzlHdcyIQr/92ZHmViRXQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.8.1

View File

@@ -16,7 +16,7 @@ inputs:
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
luks.manual =
decrypt.manual =
{
enable = true;
devices."/dev/disk/by-uuid/4f8aca22-9ec6-4fad-b21a-fd9d8d0514e8" = { mapper = "root"; ssd = true; };
@@ -29,14 +29,14 @@ inputs:
nixpkgs.march = "sandybridge";
nix.substituters = [ "https://nix-store.chn.moe?priority=100" ];
initrd.sshd.enable = true;
networking.networkd = {};
networking = { hostname = "vps6"; networkd = {}; };
# do not use cachyos kernel, beesd + cachyos kernel + heavy io = system freeze, not sure why
};
services =
{
snapper.enable = true;
sshd = {};
xray.server = { serverName = "vps6.xserver.chn.moe"; userNumber = 22; };
xray.server = { serverName = "vps6.xserver.chn.moe"; userNumber = 18; };
frpServer = { enable = true; serverName = "frp.chn.moe"; };
nginx =
{
@@ -52,22 +52,17 @@ inputs:
// (builtins.listToAttrs (builtins.map
(site: { name = "${site}.chn.moe"; value.upstream.address = "wireguard.vps7.chn.moe"; })
[
"xn--s8w913fdga" "synapse" "syncv3.synapse" "matrix" "syncv3.matrix"
"send" "kkmeeting" "api" "git" "grafana" "vikunja" "write" "peertube"
]))
// (builtins.listToAttrs (builtins.map
(site: { name = "${site}.chn.moe"; value.upstream.address = "wireguard.nas.chn.moe"; })
[
"misskey"
"xn--s8w913fdga" "misskey" "synapse" "syncv3.synapse" "matrix" "syncv3.matrix"
"send" "kkmeeting" "api" "git" "grafana" "vikunja"
]));
applications =
{
element.instances."element.chn.moe" = {};
synapse-admin.instances."synapse-admin.chn.moe" = {};
catalog.enable = true;
blog.enable = true;
main.enable = true;
nekomia.enable = true;
blog = {};
};
};
coturn = {};
@@ -77,7 +72,7 @@ inputs:
wireguard =
{
enable = true;
peers = [ "pc" "nas" "vps7" "surface" "xmupc1" "xmupc2" "pi3b" "srv1-node0" ];
peers = [ "pc" "nas" "vps7" "surface" "xmupc1" "xmupc2" "pi3b" ];
publicKey = "AVOsYUKQQCvo3ctst3vNi8XSVWo1Wh15066aHh+KpF4=";
wireguardIp = "192.168.83.1";
listenIp = "74.211.99.69";
@@ -86,10 +81,5 @@ inputs:
beesd.instances.root = { device = "/"; hashTableSizeMB = 64; };
};
};
specialisation.generic.configuration =
{
nixos.system.nixpkgs.march = inputs.lib.mkForce null;
system.nixos.tags = [ "generic" ];
};
};
}

View File

@@ -40,14 +40,6 @@ xray-server:
user16: ENC[AES256_GCM,data:fo6KJXlPDn7+FmxjEJQo9d79rDYemLFx6LanYZcJpKJR7Gxq,iv:yEUKPNZ9idrSqyVO9fhksP/7bjPMT/LzNK2VSq503/c=,tag:M87D44SIo9JzDB3ZyKu7fA==,type:str]
#ENC[AES256_GCM,data:/Kec+CdtnT11EA==,iv:DnmbWfgriaE6XAnMqq2UXhHhN+Rd/3YRodKVUCJo6p4=,tag:NimqZpbslKxwzoljaZqEdw==,type:comment]
user17: ENC[AES256_GCM,data:gQInIcNFxJuCSsMDGq4yTp5JdMMmJRy1tY3PGLoLuuIXWV0a,iv:ya4n9Z7T9/bxeHqi5QqwJprEzDMsT6X0BuEXRS67wWk=,tag:RcjQfAHv8uc3PgN5c4bySA==,type:str]
#ENC[AES256_GCM,data:h7E4P6BiGjktYg==,iv:DhkK3NNppBqo3sXt9U7kbgfaBPYcSEX2hu6VOAesDiE=,tag:XoVbZklwCmU1EBhv0ujcSw==,type:comment]
user18: ENC[AES256_GCM,data:dssxPEv8srXydunolaaDAYYo+BOXhp2PoqidOWH3z6NYBpyB,iv:WCLcMMwQJiHZBwreQpaOZp2saXvjBwgYUqSf7HQhMgA=,tag:5jsAVcgAgO+7JhBINz6tzQ==,type:str]
#ENC[AES256_GCM,data:qGsMmWrUIzVdHw==,iv:DXayEA5zquwOzm+TqECYNHM98r0WSzcP3gA8zkzdPy4=,tag:OKTx12RqP9VxJQOnrBLkmw==,type:comment]
user19: ENC[AES256_GCM,data:+Mh15DR9xvFAwks86iuHEA9FpObKWTSuVOEzUDpBUS/h0hOz,iv:zYIkic2bibvwCBpomnJ9465mda1rbm3RERBZY9twXuc=,tag:bwdL6DAGgkGYhYFI2C4A+A==,type:str]
#ENC[AES256_GCM,data:1g2gohLbiixMes8=,iv:E3HA6cAdv3BdLMcrrcWW4Zsc2KLtW7L8Xrk9Z57l49o=,tag:rZ7W9ckf7lzJ23u5zwQiwg==,type:comment]
user20: ENC[AES256_GCM,data:3UbVnn9oMRc0zZR46tWxwM9VFOvMOYm690csUomEVBcS3xPm,iv:KHuPXttLAFr7WT/qa/UYLY8GRsPWYZPyKNmdUh4iFQQ=,tag:jN8rQ0Gv+qnhwOWGH+CwlA==,type:str]
#ENC[AES256_GCM,data:GzxXsTbEvdHV7A0=,iv:uxUG4hnYEsmJtnqbEwamwhtLt3UClt7ktmkGyAFdxsc=,tag:sF8YQ2cejAezI3Bbp9qKIw==,type:comment]
user21: ENC[AES256_GCM,data:hgDJ11crZaWcKrc+ZDQklXwpnvt/sMbARkx3sLZfQGZqQZeA,iv:2Re+hdJuT5yg/qTymfpN+KdU3criOmwuqqg+SHb8iAo=,tag:s16N6u5cRDaoWxnrCkamuw==,type:str]
private-key: ENC[AES256_GCM,data:ts/LRGFAsYqvGvkvlxUI42IW1a8cGsSkpZhMDd3QVceRKvhPb1SRDaXoSw==,iv:6xX9xFIFUNlLBZ6CPBOz9JbHpvC4+QG9ZaCZcWdl12c=,tag:DYIa+QTV8vyl1l7OKKykTw==,type:str]
nginx:
#ENC[AES256_GCM,data:85LrqdTMIhSa,iv:mIQPYz8VPd5AxeMCQEdTGMD0Iqa5QEAa5+8JVFaj3JM=,tag:TcZd7S3WRPpEV9lHI1fzbw==,type:comment]
@@ -91,8 +83,8 @@ sops:
ZXFTU3ZCaW1pTVh0RUJzdDdGdHlPYTgK2mlgcX2kEc8+2UDdBnhUm6IIuh8V6agW
ooxH9OEPXUVI/4JcDo4v8ZUhAyU1ehLH0Ef7PJCChOZe2KZmWSNbhA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-09-26T04:24:17Z"
mac: ENC[AES256_GCM,data:AXhLmyZWGD6KvMkyHqmCERE6eNE3pD5Pa/9mRBWZe4hiXL4mKTzCn5C/ODGQ1ZeQjDdP+awjJRvLRjMiYFhVlU8rKpg/f2G1gDr4cIbr61sCdzXKX8wFW0G7bJWxxpAC4X59+u9EJ3sNcyf7bJrMdkTzTYpgXh29mtl2bprcdJQ=,iv:pK4hYexcWng3GwOmWGqgyMsmATnXgcwR3NH4UxCwpvE=,tag:zpv64JWoXc5cDCukDuW51g==,type:str]
lastmodified: "2024-05-25T09:01:19Z"
mac: ENC[AES256_GCM,data:xYK5VTYHwryDcH0fhnezn5aYQ+XAPAJ7PIrL1ygKw3F/rAwRQlWk0/zmqypmpqbPX4mAJKzDfgoTNh8iUtF8ehmfOS+7OPUTuKVRvPI39HfcJbRN3/oOdN40AXSa5cZjgKrAGdhWvwyw0WdDMkRfwJztAR5Jj0dKzZ5THW+5zSs=,iv:Y5UUe1I95ltiVcUPBUcmIpnKHFfAlQmcF8ZlxZht1i4=,tag:3mA/epV254+P7WkkuhDOqg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.8.1

View File

@@ -16,7 +16,7 @@ inputs:
"/dev/mapper/root" = { "/nix" = "/nix"; "/nix/rootfs/current" = "/"; };
};
};
luks.manual =
decrypt.manual =
{
enable = true;
devices."/dev/disk/by-uuid/db48c8de-bcf7-43ae-a977-60c4f390d5c4" = { mapper = "root"; ssd = true; };
@@ -26,10 +26,10 @@ inputs:
rollingRootfs = {};
};
grub.installDevice = "/dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0";
nixpkgs.march = "znver2";
nixpkgs.march = "broadwell";
nix.substituters = [ "https://nix-store.chn.moe?priority=100" ];
initrd.sshd.enable = true;
networking.networkd = {};
networking = { hostname = "vps7"; networkd = {}; };
};
services =
{
@@ -37,14 +37,15 @@ inputs:
sshd = {};
rsshub.enable = true;
wallabag.enable = true;
misskey.instances.misskey.hostname = "xn--s8w913fdga.chn.moe";
misskey.instances =
{ misskey.hostname = "xn--s8w913fdga.chn.moe"; misskey-old = { port = 9727; redis.port = 3546; }; };
synapse.instances =
{
synapse.matrixHostname = "synapse.chn.moe";
matrix = { port = 8009; redisPort = 6380; slidingSyncPort = 9001; };
};
vaultwarden.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
beesd.instances.root = { device = "/"; hashTableSizeMB = 1024; };
photoprism.enable = true;
nextcloud = {};
freshrss.enable = true;
@@ -62,20 +63,12 @@ inputs:
peers = [ "vps6" ];
publicKey = "n056ppNxC9oECcW7wEbALnw8GeW7nrMImtexKWYVUBk=";
wireguardIp = "192.168.83.2";
listenIp = "144.126.144.62";
listenIp = "95.111.228.40";
};
vikunja.enable = true;
chatgpt = {};
xray.server = { serverName = "xserver.vps7.chn.moe"; userNumber = 4; };
writefreely = {};
docker = {};
peertube = {};
};
};
specialisation.generic.configuration =
{
nixos.system.nixpkgs.march = inputs.lib.mkForce null;
system.nixos.tags = [ "generic" ];
};
};
}

View File

@@ -10,15 +10,16 @@ redis:
rsshub: ENC[AES256_GCM,data:uPnZIjbnRRoWIHlWkZNZkMpIb3Ujnnpb+AisVSVGFv4sfDAuDlAjt39pRdnWkCXJPqtXjJzQ+FeT34cqxTf8Bg==,iv:/jcyAHkxByFnbkmCAYQwda2QRmhW7L/ICoLuCgsVLCI=,tag:M5Q+dh/Bn7FiNpqQGYus4Q==,type:str]
wallabag: ENC[AES256_GCM,data:WkiqS9TOHxYalDp7Ssgg2x7vj4D58psQ5au4a0e3LZBecERwzUKmrhbVKRuDvNTwWbYxSds9SAca0wN+pWmrmA==,iv:QqHlzSXG1I4+p8wd58lcQs8TqAF3foxiYVdgL8L3IpA=,tag:CPtFgIeFL5W25gtd6NFkrg==,type:str]
misskey-misskey: ENC[AES256_GCM,data:OHjt9o+m++NT5aaFbwBT/wSMdUdgf4zscd/JxjCo5HDhC3WeWMJV7z//kATI5Dg4BWAhvPlL02Vrly4RraIzLw==,iv:sQB4/D2SsOuDR3bTrmlNg7o+6ehFznDsqVc3BX9pK20=,tag:tcwTBt/JhyW8ZTAIWIkWBA==,type:str]
misskey-misskey-old: ENC[AES256_GCM,data:amUqMycdXUFvjg66pXKnlZqiESBYMci0k8iYzj824SaEqHl3Nq/I0TjYX++xEUg+RGYyTIcSaj96HUANTKpc1A==,iv:ND1mQLHxltRlOdpJ80ywheGo6hkl7OgRyk9TguJMuTw=,tag:dhCCwnCOnyT2iXdEMK0szg==,type:str]
nextcloud: ENC[AES256_GCM,data:jwN/CqwkU/5Rd6w75/bV2Yej9b0CoxZaiJEcZXFx+9XUPY3Xg1tQdEr1SALG8xzOEdoL6WBVs14NvrrL25GeTQ==,iv:p5+0AB52QqScJwMhNIrM/7HAcRPdD9Z8xV6uwIDOwIg=,tag:f1XbNDDRXvGl/dkV9Wp2Ug==,type:str]
send: ENC[AES256_GCM,data:IGxj3cgp+fQBdupfK+IgPEQSPuXdM9LRSLGSATNIkzUWC6sQw1aaKTDuRc8cU2BG6quthRwuWnK/F7k3KrUi8Q==,iv:LI9MkaF4e47FPUyL7AXZpO+CdgF91ScdiqjrE8PZjJ4=,tag:eNugln5M0AhU1xmVWFN7Aw==,type:str]
mastodon: ENC[AES256_GCM,data:E5aMRzqd1dqcw66uZwWoT+LDH30mg1vZjk3lhKIXKPd36MANE6z04aBPcAHyHT71jEYsect9JXagC4MUJBuSSQ==,iv:4IjTTNSTraL33fInlTkB2ZylcEaaKi5pgvugZIk24e0=,tag:32JSTNpF2cxYh/NEAS6jZQ==,type:str]
synapse-synapse: ENC[AES256_GCM,data:8CVbcN2FG4mRT4PnlOGsS7tDfS+6ojIJFvq2EwItxn1gg2Ghd/Bmx+5tS/Do2FrYp/Xiv1EqucomM50r5bXnmg==,iv:TT7zBKQ4M10XYVCn5aeSu9IqjrIEHHazPUCOTmgRAU0=,tag:0+Q9hZMBVDj1TnHj3xoTBA==,type:str]
synapse-matrix: ENC[AES256_GCM,data:eJ9GXDVLPg1C+Zjpj3NnWUyZxDbOZ61f+gs/bkZgdWjeu61MEMtU/Hh+p/ceAn3y0aPi0ZTcd+zSgIPIkcj+qg==,iv:uTdS4uguNJErc+DDW4H6dsRFkqlkHtaCfR8LR/d9nvY=,tag:UhY9xbe1r7FUpyid2nSt5Q==,type:str]
peertube: ENC[AES256_GCM,data:cN+cClNV1JD+Z1Wlp07MY7BmLr/EZYZZt04mxKKKN8RG1ZSMGykbc3hd00E14ubhCittJXSPbIWyO63lCGGEPg==,iv:3z1BR0j26LGfXwDDPYU/i8Qx/7529KKoar+xGZanirI=,tag:g/NSGDE1iEYJ1MStrV3rpg==,type:str]
postgresql:
wallabag: ENC[AES256_GCM,data:ANwvEE3K/W/hU34Y7RvlbUuJNo2bOaRfeusYM9pRxXQOdG4XpwYfd/DprsrVjlkrMFuTurUR5j6UNHWh+ILDbQ==,iv:K8doqhVosz+OosMrLJXrSxairr84EeGs3EWgVQjpkS8=,tag:WjDzy7ubm/GVlBkW0O3znQ==,type:str]
misskey_misskey: ENC[AES256_GCM,data:lRbSz7bbiWEdK/cRD41fLvFJF4WYsclKHVykFcU3LIz9vnKlR3VdczzznVqpT7JvG6OUi+TmipJii+0KzXHtdA==,iv:8sBKgVwuDJdThup0KQ6cnAV5O2liwVra1yIpDHVfpMI=,tag:DyUpaHai8ZUyllvZBUm8sg==,type:str]
misskey_misskey_old: ENC[AES256_GCM,data:Wwtd+hKI0s7m3PbEPHbnSyTsCkW0x8SYHUiCYuNSNCG8i4RAmiAbONNFfWN2hXnmTmRK79Tx/3GR+L0KMzmNGQ==,iv:BekTELToPQXUdZHyNtkuqKyZeez+moI6k907P7NhA3Q=,tag:A5YB0WIa1RkDCtzeBhiuyA==,type:str]
synapse_synapse: ENC[AES256_GCM,data:lzaggyuXM1XwsRxFHslsP89r8wEcgi6LNfbcm+pFWj6WLO8y8WaQIdOkiF3D2ToKDwcw5XgSGSt/VAk6lv+GeA==,iv:8WOL3jze797Wz9kSRq7YpY8OS1TBMqHYhfgZlluJlic=,tag:utNhs1AMbGthp6M2c0x67g==,type:str]
vaultwarden: ENC[AES256_GCM,data:Uz8GJMaLUTQ9pQbZyZLWS4bL5wmt9RvbAwNctAIDt9JrV3FaXxgKjE0MJSGklS55yj/Z/wbO6RCuCK2AWR2VKw==,iv:7hA8YcB88M1qCV8EhFYpHbfPmAZ/7xNqvTMJYZ/UcAY=,tag:mkDHJYmRoYZ/Ct0UmOp9FA==,type:str]
nextcloud: ENC[AES256_GCM,data:5UpYSMsZgUgEJHg0ou9Z1RTE+YFFUKuXwPtc6L5XxD4GNo8Gd3CvcQSNGAol+5DtyPKF3q1+ZgtScWGrqU1RyA==,iv:Zfm+Oa4eON8WiJzYUkMFawafDwo9pOnOpWkwHYLIKkk=,tag:4ECMla1dFfCrn7lILwWFNA==,type:str]
@@ -28,15 +29,12 @@ postgresql:
akkoma: ENC[AES256_GCM,data:6piRt7BbMBLVGdot+VyoJN3/S8DoPNTYHFh/1coHSLNmiA6kU/6sca4Bts1Up/Vu164oTsFAr1JsKx6tzNzAPg==,iv:qplA1GXHwzVrmjm7eagCk3PFa7DRdwaf+p7N1HLb6mw=,tag:W6WedSK3R1IgZVo/0Hr9vA==,type:str]
synapse_matrix: ENC[AES256_GCM,data:5j+TYJ3vYUqu6CdRDYAT558DsTWbX4Rh+HuukPog5HGXlhneL3RnxVeGBR9CV1rlCP1NY99Nm8roBG+BcyPYHQ==,iv:CboB6lzqxAE/8ZlzaTU3bxw94N6OAhrq8pZ0AfxQiUc=,tag:z6cM3ufgbMn5n5PzgqdRjw==,type:str]
vikunja: ENC[AES256_GCM,data:syb4NYBxL3DdmZmcC+em0klmm6bkkIL/DH/gnzShYRiaezRFskT+yay9govn++SpbuvkoCJq/GYAFxNL+hcVtw==,iv:TQUgdzYQ0gqsAmux9v3BAQFNzHnCTZ+X/OC0b9Bfya8=,tag:b1AsiAW5XzA3DzGdf8J03g==,type:str]
peertube: ENC[AES256_GCM,data:dLzOez3dTy0NqHED1Oc43Ox2AFuH196kxwOSuR6RejUw3iJuzEQCdmA/i+70zHoveAYBdPCGpM8cz0y2M+usjw==,iv:KxDqmbNBkJ6Nw0M3060L9ESDf2qAur7umlejcDyRmwA=,tag:RScP7Cny8b1Z1/REpk+daA==,type:str]
rsshub:
pixiv-refreshtoken: ENC[AES256_GCM,data:EeSOTSAAh+1Dc8+a/AaPJ0aBK5DTa3pdS6DrIMQmRw/n0SRu2QoynIF76w==,iv:dnZxi8jM1I4w3C2duYielpP/8wOAdHDjcqDIrowM0dM=,tag:8irGvLEbRJHV9TB8Jibs9g==,type:str]
youtube-key: ENC[AES256_GCM,data:OEm/ynOUPUq7ZEVzL2jgs9d+utkLTIdNq0MHE0JDujb9ndAwyJJI,iv:RRae6Cg6GdDnXAQOdtBYmcA7ZNuu70VpIg2MEezBn5k=,tag:gX4ZG345cT3Jh3ovUxtLGw==,type:str]
youtube-client-id: ENC[AES256_GCM,data:dPo4+HsfXHdxrgF9F0qJmOGcSHDCn2KIkHx3ZYZU94iv8ImiPI9dTRfoz0zq8UIN7rwIKidQu9GxCRrg9aXk34pc35SXzEh8JQ==,iv:ROVHb0QjVsNae9eJevG6qc5dc4gkrGt+Y7S2QYrzmQ4=,tag:Advoh75OKPC7CnIeL4GFbA==,type:str]
youtube-client-secret: ENC[AES256_GCM,data:c/ALpo/4qJdccMgYiSLg9ZgG7ddaMYxHwJYZ/ogJN2ED21k=,iv:CkrIq+Vpuq28CsRNwdKRLnBq6L8NF37y4xhhnmHQHqQ=,tag:SKtHpm/QZWnGViDtSKlUUQ==,type:str]
youtube-refresh-token: ENC[AES256_GCM,data:pnXQ1euCdix2H7IxudmUUcpxc2OUhciKT8OcGV89c/EpoXHgx1+eLxwY5rRszroWwjge9M001RGHngvD/ny3phfWAwYmIzMJxun2f7JCPe7ybMesWmPSkiqVBss1Zfic1uB8mNM/yw==,iv:8p8/vATY8F3YuGA1TtjekiuaKOMnQyTMjrwDBJaK4VU=,tag:/jVg9FDOuLMNrupgrywpBQ==,type:str]
twitter-auth-token: ENC[AES256_GCM,data:65SbHggbYtfSfaaxJxRgD6+HpOX4vIfjnVZmOAZ9illPMYOu9MIchQ==,iv:49UuC8n6AGj1skuHzQX39Q/QuKlB9IxogIfiiy1GBnw=,tag:Rq6b0H9UFVZ19tU8ZeelRg==,type:str]
bilibili-cookie: ENC[AES256_GCM,data:58nO7ADu2oH/OgLJNYrEEzhf1J0zt8EpuygnSANkGXJju5oSmtM7WLnaMEjC96q14OTTA9QLiFVsbxiFY1eUnraA5W7g7+6CYRXVRZaxz91D/dhKzHGTMjB/LynnNqEIc6liONlcHbyjZNQ+WIqPtjVpCKMN7Mi8cv81/cFX/1GqAwncgDD2oXh1hMPOVY4dYcGKuOG0GjlY6RgOgTPqU3HawQjnoWQjPF+lq2rnWD5HP9ZTxOYa7hm2GgPrxkq1fkRrq+kKYeDh+6M7VLDcm5Fpf+biq6F8fZWzmw4NlVZT9BG0vJFa,iv:vxYXg9Yg9qIWFQXtwTYa4Ds0KSxZYg3M6xdtXKbdaig=,tag:TzCPehk9w+BL4wwgDc1CPg==,type:str]
mail:
bot-encoded: ENC[AES256_GCM,data:HstqDfhKoLqDip9O+mwYGbNlNQ==,iv:CZSTfxJHhI6nG7501cQdJiZ9l3uKS7d5YsA8iVTUuoE=,tag:Rj3rvXJzDp8XzODV/gABog==,type:str]
bot: ENC[AES256_GCM,data:j4Y5oYeVt0sd2z2Qwuqisw==,iv:wasQCTqEMAyttbn1zm9oKck6QiByom+F7ZIMDUse9Gc=,tag:92O4ka6f0I9qnlnVy2dltA==,type:str]
@@ -56,13 +54,11 @@ synapse:
signing-key: ENC[AES256_GCM,data:hzxxDbGp1L09O7+ueUSa5lJOY/QvF2zvHdpueEHjaPQEToQt9mr2loeTQHC7ObTegfLb9UHrI1jn4A==,iv:KngfahwYZZmDQ5LeOUPWptTMGAC8TZm1G0FWcrwCwsw=,tag:U9pW6/boBIpiswn67Ezrfw==,type:str]
sliding-sync: ENC[AES256_GCM,data:BeA6g98IWDP6hnLFI77QqG6esDwB6j3OPzAv3eJxWoTajAsByHSgSYP1vHN5Iok6IgvSSmkf0/HiOJy1Ca8IIA==,iv:ca+t/rYwc/fAVUcz0JTmrRQCOcbDNscbnE8BpHkx/OE=,tag:eEfhUChUt4kRnO82XqRY4g==,type:str]
vaultwarden:
#ENC[AES256_GCM,data:yFDD8GHjZWHN/Yh53DseevKAhDVwrHX60e8sGZnF4BUsUuPA/4S2PRzj7CtlpFzUH3kb0i+HkLKRvbchg93U3as=,iv:JGG7daEKs0oMKTNVi9GS7PrXn/8rFtVkHknACsEQR+g=,tag:RSN6fojLsI4dcuPu2eTiWA==,type:comment]
admin_token: ENC[AES256_GCM,data:OpjREmxJSRj+aGVoP8KKRE7ClNqRtaV8va4WLVmpl1AO6D0q/GapJvhORHQb5s5ZjIAgvWTz1w+fh050Q9sPwRsNUke3FIcyeNy7k0PHgnnVIdxnU1Vn9KMz/SovjQ0/qEQ7tArvW/EXtKfwnP9lsz9m94VBvA==,iv:9AvDqMa2PeQOSrP2th3YBgA2RxPl3oKZTyUzi/yjRTM=,tag:HYFTQDgWvBsHQk8IZxWkfw==,type:str]
admin_token: ENC[AES256_GCM,data:muavuOY88Lm4rSEoCp4IIPp7Z+sqf36VwpnPgf+K6IwwFkUgYM1GO80ogReYWqqUM6ij1Yzl5D9ncUbq+aGTKQ==,iv:jA4MRJlz71CMmPnWjb2tGbbIoMkEsESUowhXDckKKMI=,tag:l0HaJmnU29YeFUxjOgN3Kg==,type:str]
mariadb:
photoprism: ENC[AES256_GCM,data:TF1SZVFnvzyE+7vrHYYUS4Juqhbiw9QcJx7p3Xj88xyBFcTqS1YjzAKs/9GQ1PuzdBrt6hXm/XtJILHiuktnSg==,iv:sd9sQEuIePL6LzUYbFtmdecJ57sMrkF0coalBf8KFqQ=,tag:P/knaKYTJ+aXu4l6IixISA==,type:str]
freshrss: ENC[AES256_GCM,data:ydqCbj3UbsLC1e++p5ixb5Kpmk2BsYd0urcfw8T51Is5N1/gQ7P0zgR33AOteAxw2oj85WQZhxu3eAN7BCXV5A==,iv:1oiMo1wwFNXiTZLsf4UPZSJfKFIWLI3h947TC06CVy4=,tag:Otq1oeKBnWXhqNilfsywPQ==,type:str]
huginn: ENC[AES256_GCM,data:1Tdg1WDwGgFSXdChgif8knWS24BIFYnmaiSjJXxs5uj/v/5fJ1alb4K4XHW/kFRjQbuAOFfJiJ9ogJ1KAyk17A==,iv:qLMaQpVaKrjP7g2lWzhaNLghxwiV4YJmyYY1hrpu5I8=,tag:566JCENvOxgwD7tM3aQBiw==,type:str]
writefreely: ENC[AES256_GCM,data:+5jsON4SpeWKWZWlbn233XuQ/6HDzaS3XxUxDbUqAp8S/XGmn/QuFK2f375QJEiyZsnrIYkbN/CiOjdTw+nNzg==,iv:8mKqWegyxrT6908P5G0olVZzpP+BwpE7SYODEry7F3A=,tag:HeYoT0RFJGzX6DWcBQy7Jg==,type:str]
photoprism:
adminPassword: ENC[AES256_GCM,data:gB81joOfS8h05BNy2YmD/N0cpLPa/vAduDcQBeHiY/WkcnvqSXnXsOfnvbP74KQfoP4W35oFkfyGVPUBSB83tg==,iv:AkN2NoqMXVHQA9fHTTR7xbEapEqy/D61mHn7O23hyYk=,tag:WV+siDA3VnRkOYnP4Z9Qhw==,type:str]
nextcloud:
@@ -72,18 +68,21 @@ freshrss:
huginn:
invitationCode: ENC[AES256_GCM,data:+m2AabRzUiCFy3MAKTB8d1IE05WHTcmZ,iv:ccdIPHl9N+bvPR/QCwZUwZOfWTeW6gWhhBjOpL85JRg=,tag:Ir2085K04XUGkAuoCG+7VQ==,type:str]
fz-new-order:
manager: ENC[AES256_GCM,data:qZc5U3SZQPWzcKVjN2+A2qWNae4GItcjvEQFgkThvIQ=,iv:fJpiUlViiUg1ea/zGhgedQG7TeTbeb9dPviYoiUBLqI=,tag:6T7rgJflsjgK++28SgsLtg==,type:str]
token: ENC[AES256_GCM,data:qhwWRflJbW1QMOhiPfbTIrEdQJyVtfZ1QycCgstdKD1Nh40=,iv:GvZ8MJig64l34jkvuJbMMjyNaPT5yz0/pFCc6KEPTvA=,tag:cMXo/6F9thl8k2iAhT507Q==,type:str]
uids:
#ENC[AES256_GCM,data:WJszzA==,iv:KvyEnUu69+L5ZxNbRmjtP2R+8lHKgdlMN0WuvDbYgE4=,tag:LP2FJ2HXWZJmTdvXpHflVQ==,type:comment]
user0: ENC[AES256_GCM,data:Qw18Ht6qXo3n7DD9NgNB+3IRbCmKuvJQiK5UBsg/FC8=,iv:TeeTcR0tnRrniySqKrsKfOfr2JO7+kqS3iETdCFX5ZA=,tag:rRo2yNku9JWxmILWBS/Wyw==,type:str]
#ENC[AES256_GCM,data:O3DOE3jFCg==,iv:9shUoHCLXsJPKHELlyWdreouEcyOqhsfVI2KaqwC4CU=,tag:tYKVv+/DuesSijZwWGdrig==,type:comment]
user0: ENC[AES256_GCM,data:2sieulGmi7mCYrJH24djrrmHArrFbOHZ9wUuKvY4f2k=,iv:lb5ODFOeQQ+D9HZnMw48n/DGRB7L51U4frBVcPx1mvk=,tag:MwZua6u+G478uGOwtGu4fQ==,type:str]
user1: ENC[AES256_GCM,data:vY4qTPNqdFp2H348jAgvwKktywdVVvQK/lR2NgRE4Ho=,iv:DrweeSEJ5ETomIkRtkcVboiQindzBoxvxjlSmrQIfI8=,tag:sMz1ITHkDclBc4OY91dMGg==,type:str]
#ENC[AES256_GCM,data:yeA9zF8Tug==,iv:VZuWLZnt1RBmkBWudKVvgJkYfqxIj/umEHVCfR6IG3k=,tag:1kj7HyjVT59n05VYJ1uP+w==,type:comment]
user1: ENC[AES256_GCM,data:Aw0ydspmf+PXKU27Pdzn4q/nY4sxXCADL1WGB7vm3eo=,iv:uTmVvGlW1HfdvoNbupSw3GyShsWTGVCoNrvVJ5BPUy0=,tag:k9KIoCWM6bSprwR8dmN+Hg==,type:str]
user2: ENC[AES256_GCM,data:7hlq1FEauGcKkStREDbxA3tOA5NmFo9AbXiOPUt+kZ4=,iv:urOP3ENSviWRKDIWGc1P5PkEtkoBSCSYlgGqJQznp8s=,tag:NNKCW5bFPY7t/PC7dsSJwg==,type:str]
#ENC[AES256_GCM,data:4G7DyLVVgQ==,iv:Ht/exln1QtL2BxjCaOTIXHRPDiSFYP4zIa7VaeMCuhE=,tag:btVLXf+WS/YgzRFbVFoAfQ==,type:comment]
user2: ENC[AES256_GCM,data:P5gmhaQ+VOWVOjTrsx34zUS8dsqIkzCwOImIE8TIfUc=,iv:IoJIUcNJmaBTyr0Ut6R7BN/UqyK8p4HtiwbXUl171pE=,tag:k99PGSL1cEALTmFVWH1uSg==,type:str]
user3: ENC[AES256_GCM,data:nBTbmp9OP14ayVBz1UGC5g76txfUwxL2NPQCKGxsQyw=,iv:2B8ISdT+8WpfeiU9peKoMlpwcRoGZVh11VyAnS9IKP4=,tag:uBMxqrPlb6TaftnAMqodKw==,type:str]
#ENC[AES256_GCM,data:TGrZBuCRgQ==,iv:9IOJ3Bkw9udS/y93TTtZ9o79aDq3Bb+DMEogJG77iqA=,tag:S/XcPX1f89IyfZnMoR9s/A==,type:comment]
user3: ENC[AES256_GCM,data:cAzf2X20rtQYyz1rLK6b4jo8utuUOdUHVYfCWdfPTDY=,iv:L5cg7aNdfnLTH2dKl4bWCqaujJ9tIvBJrJIoDIaBLwk=,tag:9Al6Wig4lz1my6hgozSsIA==,type:str]
user4: ENC[AES256_GCM,data:LVendDEBlPUCkXPfgbYf2X0EgJsAdLKjAudXeAgy2Is=,iv:bR0emkQa6OHUP1ucgAvJU0eEop0gp+3rwDB5XJhh4+s=,tag:YZsW9Yyr+ey9AbTO3ucWDg==,type:str]
#ENC[AES256_GCM,data:b4iJ73sUoQ==,iv:A2hmi7lCR15E5jVR8E71GQuHgF4TdjDuQadXOtBon6k=,tag:eopTJdjN16u7PtpZdhKymQ==,type:comment]
user4: ENC[AES256_GCM,data:nUJ0lPuFOUVGCtq0IRSh5dAkAna7hoow1YOtFEgSoZc=,iv:D8phoZxdbQ2/Zaeq8498eRb0a7SZD5WnVdKv+u2pBak=,tag:Obu01n34JjyAVnF0f3uKzg==,type:str]
user5: ENC[AES256_GCM,data:wG4awLnfB4B0qLWG6Aj+OslLMnViPjIzicfB4ZzkZPA=,iv:b9C1IDmZTMV0RYXqkM/Y3khZeSQEOISrQyPjhQe3WKM=,tag:cRMtLNU6TCwTQG4UVhvTng==,type:str]
config0:
username: ENC[AES256_GCM,data:p8+q8u1A,iv:9s52kS5yLB4vQuGVXNtA4amZqT3eHTTybsbsQZRiFnk=,tag:7SA4SEzMHpP9H/rwoE+UJQ==,type:str]
password: ENC[AES256_GCM,data:58+gFodT,iv:ohZlT1BwnzCYv84xHgFsLRkiPMpE8lB8QVHwr0QtDWc=,tag:XF047RnXs6IbKsTnsm0D6g==,type:str]
@@ -120,11 +119,6 @@ xray-server:
#ENC[AES256_GCM,data:j83rYg==,iv:3oEdAoVz7aMcezcy2chTO0LQTtKpTrJJoQZx3PC03BU=,tag:ABteEIyr2Y6MbGQhmrQySQ==,type:comment]
user3: ENC[AES256_GCM,data:Uk0Ax9FVzmmYs+ggWy7z6FEkuj2tppGlvnQdoW6PDI1VA9oI,iv:wSxigXleRUalQR1/TzKfdUVrdyEUuq+Wg42gSv1QMAI=,tag:qn6nBWv6MlGhMarCfI13BA==,type:str]
private-key: ENC[AES256_GCM,data:TarrinCFzWkB5zCc7i7f3B3tFfxrF+cGnrg4bw9CAGKWBazSJHCviY8Imw==,iv:azHdrc6AlgS9RPwGVsYRb8bBeC/askCdut1rnv9TA3I=,tag:AT2lLraKVgbp9GmlLJiI+w==,type:str]
writefreely:
chn: ENC[AES256_GCM,data:YvhPa69sVdiljm9Ix6yQh6YCEpFvC9iw5Yx72MBcGr7+swdbvWDAfMmGFY066mAPvhpwZX/IEivKvrS0t/OSnw==,iv:7s2yEb30YaCAtNeevbur0HL28nXHVIqmCx6Bngh+HWk=,tag:yx0JK8RNQMVcYLBSxNj+uw==,type:str]
peertube:
secrets: ENC[AES256_GCM,data:DAlig4wYCridlfS00YOqH++/4Rkssq2bkJ1bhERrsgeqdccwwnk6ADKpN2UBGANNYiTj2VUHsHT6mIWxPRcJvQ==,iv:kOedA1gAD7el6JbP8MujSCSfkkHM6CDDMSs2LwPmsGU=,tag:ZDS+LGX2hNXHw15Js2sBkQ==,type:str]
password: ENC[AES256_GCM,data:jmKmQlFqHSmImfym2M3/+ItbPxx1GwgrLRZwk7KxqXGHFvqZ1ybCnfZCN8jmA1gVJLuPLTrYA9ggHwdKgVrknw==,iv:cBSb5PJsjHBAMgrxlZaVtw1aP39AXMtdk5pnnCyyZbQ=,tag:6TLoDRY6305lm4HVapT4yQ==,type:str]
sops:
kms: []
gcp_kms: []
@@ -149,8 +143,8 @@ sops:
SnFHS1Z0SXUzTFdEd29KTy9DU3Y3R0UKfhh+rUmWDrf+UGjclP57dHipPLFoXSqy
HdelmfV6q4/c7ppx2E+oZw3VNgoZCsrxxzYZfwxHJiZb+5vkE0D8iA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-10-05T02:43:01Z"
mac: ENC[AES256_GCM,data:frMtsfATEGOCwkR5g6sOLszwtBq1rfHvofevbzDHuKwJQtI4IXpfgyohyQ64tZ7K6YLqR0bf3yP9A7zyIxAzIvgKciIDdIYI/LUCAmOsUE9On70UiVxFj8WAL700geHfr2X+1Vzl9suMBA3E8h9O02wcuuD4gumZlLgXqzmbtZE=,iv:oB8W9+KO8jJbSnICsN5CMRCRs6uM6y8xszCyWlRCkV0=,tag:JxLLwUsE/7nxDAzMmUYdjg==,type:str]
lastmodified: "2024-06-08T09:15:52Z"
mac: ENC[AES256_GCM,data:EY6sFc4EcTuxPgIZQ51HFZZZf+khb7mkNEvb6U12kCtoJAEo+i83uszwBZCo/QWw6VCCt9c//9y0mNH4FjZPJAxweJHcRtanyTXa5jdyv12qINUceYe7Uhcb7JuiiEns9DEbrr3UeAKfbPC+N5mD/2trzht0E8hqnFlWU/fysz8=,iv:saymdP4nFveEWx0JrBR2bW8SUl6xCJKhYqw+CsrfRG8=,tag:CHGvJAO8hpSMNdU2YE2OGw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.8.1

View File

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

View File

@@ -10,11 +10,10 @@ inputs:
{
mount =
{
# TODO: reparition
vfat."/dev/disk/by-uuid/467C-02E3" = "/boot";
vfat."/dev/disk/by-uuid/467C-02E3" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/2f9060bc-09b5-4348-ad0f-3a43a91d158b"."/nix" = "/nix";
"/dev/disk/by-uuid/2f9060bc-09b5-4348-ad0f-3a43a91d158b" = { "/nix" = "/nix"; "/nix/boot" = "/boot"; };
"/dev/disk/by-uuid/a04a1fb0-e4ed-4c91-9846-2f9e716f6e12" =
{
"/nix/rootfs" = "/nix/rootfs";
@@ -27,6 +26,7 @@ inputs:
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "znver3";
@@ -48,15 +48,18 @@ inputs:
};
};
gui = { enable = true; preferred = false; autoStart = true; };
networking.hostname = "xmupc1";
nix.remote.slave.enable = true;
};
hardware = { cpus = [ "amd" ]; gpu.type = "nvidia"; };
virtualization.kvmHost = { enable = true; gui = true; };
packages.packageSet = "workstation";
virtualization = { waydroid.enable = true; docker.enable = true; kvmHost = { enable = true; gui = true; }; };
services =
{
snapper.enable = true;
sshd = { passwordAuthentication = true; groupBanner = true; };
xray.client.enable = true;
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
smartd.enable = true;
beesd.instances =
{
@@ -73,16 +76,9 @@ inputs:
slurm =
{
enable = true;
master = "xmupc1";
node.xmupc1 =
{
name = "xmupc1"; address = "127.0.0.1";
cpu = { cores = 16; threads = 2; };
memoryMB = 94208;
gpus = { "p5000" = 1; "3090" = 1; "4090" = 1; };
};
partitions.localhost = [ "xmupc1" ];
tui = { cpuMpiThreads = 3; cpuOpenmpThreads = 4; gpus = [ "p5000" "3090" "4090" ]; };
cpu = { cores = 16; threads = 2; mpiThreads = 3; openmpThreads = 4; };
memoryMB = 94208;
gpus = { "p5000" = 1; "3090" = 1; "4090" = 1; };
};
xrdp = { enable = true; hostname = [ "xmupc1.chn.moe" ]; };
samba =
@@ -93,10 +89,9 @@ inputs:
};
groupshare = {};
hpcstat = {};
docker = {};
};
bugs = [ "xmunet" "amdpstate" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" "lly" "yxf" "hss" ];
};
services.hardware.bolt.enable = true;
};

View File

@@ -21,6 +21,8 @@ users:
hjp: ENC[AES256_GCM,data:Ii4P9ZsUOEh3cqt3AKWlgUH1CMNnmHln9QNWdTRR3vZXkkR5j5qKAIrAltml/i3xFlt4hftYNufnupog4UlAVWQJhYBlhCSE4g==,iv:eKWmUcKItjd1dsvVP1se5CAhIFqV/eVH03gPJhBau1E=,tag:ZTE0BTSoDpJGqECklGjs2g==,type:str]
#ENC[AES256_GCM,data:hCgqHfpmeJ1Z,iv:pEKUNxhUyNAVtniTIQ2IpMPmXr2O+twq2/3Y2lIoqdw=,tag:RTqcI0XCoOymQD3r4+yS9Q==,type:comment]
zzn: ENC[AES256_GCM,data:/CSffToFJiBotXZ5rPkz0UNgI/iC0ftusPF2Ce6Of3XckjpCcikWj6n3ahJ24XsWQjp3EvacOiBorh+Kg16LjCEl0P2RMIitTQ==,iv:u9IFdp/jw7ehTshPzQVssLeh33iBYCPjSyJSLsc5EVo=,tag:/KXgmU7dcTKG8C4Y7NcMhw==,type:str]
#ENC[AES256_GCM,data:TN/ycWtGSCNY,iv:pSilXx4zKs53XX/L0+QFbwv13rutQG11sU0EgVhaJEA=,tag:L+MpcYYlsMnSpS1JQdnwIQ==,type:comment]
lly: ENC[AES256_GCM,data:XkRaNI0SqooptH/OexBCzZ4RYvA3s7qXbpCtLVidJ4pZU/o7EHlIcvMbeRxqdujhXNQ+vbS3o7CmhwJK2JVVPCCVsd6k0gMDdw==,iv:v/2mgDuR+/lb8mtyv6sn4Z9XXnuDoXkT0DeNQ7850fU=,tag:T8xxo9C7kFSNlLDjEaZK0Q==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:qQMD8SKNmxb3PdScXNqppF9zkX7dV5i7rvljvZuhiI5zLnu77qYCHBW6ymh0mrY14N9NjxmQZhZWX/H8TvBlcg==,iv:J5N3LjCYW3QmuEkMBpl7qvPFW1Z9ZoPLkj45jKcIW9U=,tag:Tl+ld07+lVkmzt7f/f2MqQ==,type:str]
hpcstat:
@@ -52,8 +54,8 @@ sops:
ZDNHUjE2QVlCV3p0NHdKYW5IMHVBZzQKkZtfyvfroOntg3yRjMw4jQHiQj8eaB2h
IeIHfW4y01mmVT2ofbtB0xYpjcl4gtUlQ8X3tn5iJ9P8gcVo0G598A==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-31T15:59:56Z"
mac: ENC[AES256_GCM,data:zd3ivzjgdbwGZpZssHeIwwkKFfHDxo/dzvb8ptw9noZ4hDVoC5RL9M/OLN6GrRM0wtpNFZJDs7Zz0i1zMascXdVu6mou/0il6/96r+FkQVBJWbrkY36Lk7ntDAcQmZKWxSUfSF0JPHx1rbkIQSVtsLQrpui9UDxaY5DP23xjLQg=,iv:+ouEpSlo0EovK0Qh27tm7NXSYncbjEc/EMWfWHIrCqE=,tag:4CHXmsJ4LhFBmbep3Wil3w==,type:str]
lastmodified: "2024-10-26T12:26:52Z"
mac: ENC[AES256_GCM,data:TiF/QAh6Y8Xn+3B1rlg+FvZFJ4fGP+szvvopbiEzO6AWBYp8dcD6MmaZstVzJL1BrRIQ3GENcq7EVyfZMWQlW8aRsVF/RrWOSpAKI1tiWDl+10Ov3zjr+Q8sFYTfblWXYH7Tq9pcWBChj1Kj88Ri5xRRfJTuelQoL0igHQBwfFM=,iv:ikzexH8P3CYu7SrRXwWd1Ar3+PEXSSjSVj5E3jwcZyQ=,tag:i5/F33/KcDJVQ4ceYtRErQ==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.9.1

View File

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

View File

@@ -18,12 +18,14 @@
## RDP
* 地址xmupc2.chn.moe:3390
* 地址xmupc2.chn.moe
* 用户名:自己名字的拼音首字母
* 密码和 ssh 一样(使用同样的验证机制)。
## samba
因端口冲突暂时禁用。
* 地址xmupc2.chn.moe
* 用户名:自己名字的拼音首字母
* 初始密码和 ssh 一样。
其它内容请阅读 [xmupc1](../xmupc1) 的说明,两台机器的软件大致是一样的。

View File

@@ -10,16 +10,17 @@ inputs:
{
mount =
{
vfat."/dev/disk/by-uuid/23CA-F4C4" = "/boot";
vfat."/dev/disk/by-uuid/23CA-F4C4" = "/boot/efi";
btrfs =
{
"/dev/disk/by-uuid/d187e03c-a2b6-455b-931a-8d35b529edac" =
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; };
{ "/nix/rootfs/current" = "/"; "/nix" = "/nix"; "/nix/boot" = "/boot"; };
};
};
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "skylake";
@@ -41,6 +42,7 @@ inputs:
};
};
gui = { enable = true; preferred = false; autoStart = true; };
networking.hostname = "xmupc2";
nix =
{
marches =
@@ -54,12 +56,14 @@ inputs:
grub.windowsEntries."8F50-83B8" = "";
};
hardware = { cpus = [ "intel" ]; gpu.type = "nvidia"; };
virtualization.kvmHost = { enable = true; gui = true; };
packages.packageSet = "workstation";
virtualization = { waydroid.enable = true; docker.enable = true; kvmHost = { enable = true; gui = true; }; };
services =
{
snapper.enable = true;
sshd = { passwordAuthentication = true; groupBanner = true; };
xray.client.enable = true;
firewall.trustedInterfaces = [ "virbr0" "waydroid0" ];
smartd.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 16384; threads = 4; };
wireguard =
@@ -72,24 +76,16 @@ inputs:
slurm =
{
enable = true;
master = "xmupc2";
node.xmupc2 =
{
name = "xmupc2"; address = "127.0.0.1";
cpu = { sockets = 2; cores = 22; threads = 2; };
memoryMB = 253952;
gpus."4090" = 1;
};
partitions.localhost = [ "xmupc2" ];
tui = { cpuMpiThreads = 8; cpuOpenmpThreads = 10; gpus = [ "4090" ]; };
cpu = { sockets = 2; cores = 22; threads = 2; mpiThreads = 4; openmpThreads = 10; };
memoryMB = 253952;
gpus."4090" = 1;
};
xrdp = { enable = true; hostname = [ "xmupc2.chn.moe" ]; };
samba = { enable = true; hostsAllowed = ""; shares = { home.path = "/home"; root.path = "/"; }; };
groupshare = {};
docker = {};
};
bugs = [ "xmunet" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" "lly" "yxf" "hss" ];
};
};
}

View File

@@ -19,6 +19,8 @@ users:
wp: ENC[AES256_GCM,data:yjMDez28pJUo6riIHypQQgjGFbuLwy87eG4ek/+Li2w8b4Cm5JckRvs26o+S0blfICc8WqIqEJGakT2wVBE5O1jGfniKn3PhTA==,iv:dOA318XRd2EXxmTIlk6GhlAR/FBpbKkbPJJCXTwFCxM=,tag:9MkXNUuAoplAzE+4eJpr0w==,type:str]
#ENC[AES256_GCM,data:YGcTkNCeu3m7,iv:jYmVrfRFwQoX1XxeSzS23wRMAD/AnzYBXQjI76Ke2FE=,tag:WJfSmjdggzPojDcJ6GzP+A==,type:comment]
hjp: ENC[AES256_GCM,data:0R5SfBFKuLGurwINnTj31FOrwwfY9bqVS1rG/a0HqIYd+Ui8/2ffFBx0Et+tYIqcxXEJpGbvse43V0naNKmFKlLanfcy9YV/Hg==,iv:mpAUmcVHWWLoreEsG9ha09jxte8mQCLt/A7nm04iX9Y=,tag:bia9pjL0MAcs9vj1gKCVCQ==,type:str]
#ENC[AES256_GCM,data:Q3TFPjvcDmKh,iv:eZ1NXGQr9HogxWa46T26WL63nvqho2/KSji8Dgse76o=,tag:iSGPRMCMolp7LVFjJGPotg==,type:comment]
lly: ENC[AES256_GCM,data:tP/NtJcMUtZPvuAqoM6KhCMybhsTxKSq4WWW3SBzQ/O0FmUXhECQc5CQnI4J9PlalP7Ug+uUQzeBMnHN84pkKNIeHVJhqjU8Zw==,iv:7TPPuSfXypSRnnhuy8LJSXIB+KB+3vWV0G7AbCZpB6s=,tag:iSLgRxOHgUolByFyvwltNQ==,type:str]
mariadb:
slurm: ENC[AES256_GCM,data:9wLQ1zF/kDaiw0s3UaRpiHgmngU7u6hwyqpddSjev0+Z0v58Q2oiJtK8vn+2VlSxx5ACfqEFbzp0PZYAxd575w==,iv:q9JTkgDymOwkbZ/PaxRAAQrtO96QmGgZcQuLTFCMoS4=,tag:dwOHlOTgZqT/1jQ+oGf7UQ==,type:str]
sops:
@@ -45,8 +47,8 @@ sops:
M0xoL1dQR0kvMWpzN0RMNWVCTFQxNFUKj9LPjBo5NGOrGYNvu8qZ13PLYjLEWllU
LARzEn4XgkeHckouwvxZYMCx7WxmAruRWaOvnxTIczzSNP7wIrqnkA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-08-30T06:31:36Z"
mac: ENC[AES256_GCM,data:UUzv3IewuF4rhbrL2haJ0495p1d4wXA7LHa5ogc5TSv+ZAYuN/HL3VCXQzzKQrzqD3LtgC3DrGgmMNGVyAIzqVFYYxVuAwb03ov+lOp3SHvLTCMqkETbcE525aAIVWNqBXp7RBn7tKC4AD4y7AQihSYhBXO8VF1PeccjaCnN7R8=,iv:G0s8qchlgcm5HVshTKnGyt8nk+D4QYyP7n+5R0TOb8A=,tag:DspvfLf1pBs+/ol8GzT7Xw==,type:str]
lastmodified: "2024-10-26T12:27:03Z"
mac: ENC[AES256_GCM,data:q1EihAxiS23XoKWt4ogBo34pP7J6i/yFglmmvFIdWKIgwaoXWFexKrdu1oRZBIxISW+3b/NzkuUm1anu3sGFGiirDpllg8wu8ezXJJODb8yTU0HJpZ/9vjBPm+ZBt5zFzGky7kmW+qOFfUsZkr8dCiJil/Z0HrXrY2d59ksxhto=,iv:7b6ePa4xXdjrj8O2JWAptsONz8gPApS3roYMuRyrztU=,tag:uzOcc8H2W6VvGDkrex5M6A==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.0
version: 3.9.1

1460
flake.lock generated

File diff suppressed because it is too large Load Diff

178
flake.nix
View File

@@ -3,28 +3,31 @@
inputs =
{
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-unstable";
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:CHN-beta/nixpkgs/nixos-unstable";
"nixpkgs-23.11".url = "github:CHN-beta/nixpkgs/nixos-23.11";
"nixpkgs-23.05".url = "github:CHN-beta/nixpkgs/nixos-23.05";
"nixpkgs-22.11".url = "github:NixOS/nixpkgs/nixos-22.11";
"nixpkgs-22.05".url = "github:NixOS/nixpkgs/nixos-22.05";
home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; };
home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix =
{
url = "github:Mic92/sops-nix";
inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; };
};
aagl = { url = "github:ezKEa/aagl-gtk-on-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
aagl = { url = "github:ezKEa/aagl-gtk-on-nix/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs-unstable"; };
nur-xddxdd = { url = "github:xddxdd/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs"; };
impermanence.url = "github:nix-community/impermanence";
qchem = { url = "github:Nix-QChem/NixOS-QChem/master"; inputs.nixpkgs.follows = "nixpkgs"; };
deploy-rs = { url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; };
plasma-manager =
{
url = "github:pjones/plasma-manager";
inputs = { nixpkgs.follows = "nixpkgs"; home-manager.follows = "home-manager"; };
};
nix-doom-emacs = { url = "github:nix-community/nix-doom-emacs"; inputs.nixpkgs.follows = "nixpkgs"; };
nur-linyinfeng = { url = "github:linyinfeng/nur-packages"; inputs.nixpkgs.follows = "nixpkgs"; };
nixos-hardware.url = "github:CHN-beta/nixos-hardware";
envfs = { url = "github:Mic92/envfs"; inputs.nixpkgs.follows = "nixpkgs"; };
@@ -37,9 +40,7 @@
};
gricad = { url = "github:Gricad/nur-packages"; flake = false; };
catppuccin.url = "github:catppuccin/nix";
bscpkgs = { url = "git+https://git.chn.moe/chn/bscpkgs.git"; inputs.nixpkgs.follows = "nixpkgs"; };
poetry2nix = { url = "github:nix-community/poetry2nix"; inputs.nixpkgs.follows = "nixpkgs"; };
winapps = { url = "github:winapps-org/winapps/feat-nix-packaging"; inputs.nixpkgs.follows = "nixpkgs"; };
bscpkgs = { url = "git+https://pm.bsc.es/gitlab/rarias/bscpkgs.git"; inputs.nixpkgs.follows = "nixpkgs"; };
misskey = { url = "git+https://github.com/CHN-beta/misskey?submodules=1"; flake = false; };
rsshub = { url = "github:DIYgod/RSSHub"; flake = false; };
@@ -53,6 +54,8 @@
nodesoup = { url = "github:olvb/nodesoup"; flake = false; };
tgbot-cpp = { url = "github:reo7sp/tgbot-cpp"; flake = false; };
v-sim = { url = "gitlab:l_sim/v_sim"; flake = false; };
win11os-kde = { url = "github:yeyushengfan258/Win11OS-kde"; flake = false; };
fluent-kde = { url = "github:vinceliuice/Fluent-kde"; flake = false; };
rycee = { url = "gitlab:rycee/nur-expressions"; flake = false; };
blurred-wallpaper = { url = "github:bouteillerAlan/blurredwallpaper"; flake = false; };
slate = { url = "github:TheBigWazz/Slate"; flake = false; };
@@ -63,28 +66,147 @@
kylin-virtual-keyboard = { url = "git+https://gitee.com/openkylin/kylin-virtual-keyboard.git"; flake = false; };
cjktty = { url = "github:CHN-beta/cjktty-patches"; flake = false; };
zxorm = { url = "github:CHN-beta/zxorm"; flake = false; };
openxlsx = { url = "github:troldal/OpenXLSX?rev=f85f7f1bd632094b5d78d4d1f575955fc3801886"; flake = false; };
openxlsx = { url = "github:troldal/OpenXLSX"; flake = false; };
sqlite-orm = { url = "github:fnc12/sqlite_orm"; flake = false; };
sockpp = { url = "github:fpagliughi/sockpp"; flake = false; };
git-lfs-transfer = { url = "github:charmbracelet/git-lfs-transfer"; flake = false; };
nc4nix = { url = "github:helsinki-systems/nc4nix"; flake = false; };
hextra = { url = "github:imfing/hextra"; flake = false; };
nu-scripts = { url = "github:nushell/nu_scripts"; flake = false; };
py4vasp = { url = "github:vasp-dev/py4vasp"; flake = false; };
pocketfft = { url = "github:mreineck/pocketfft"; flake = false; };
blog = { url = "git+https://git.chn.moe/chn/blog.git"; flake = false; };
nixos-wallpaper = { url = "git+https://git.chn.moe/chn/nixos-wallpaper.git"; flake = false; };
spectroscopy = { url = "github:skelton-group/Phonopy-Spectroscopy"; flake = false; };
# does not support lfs yet
# nixos-wallpaper = { url = "git+https://git.chn.moe/chn/nixos-wallpaper.git"; flake = false; };
};
outputs = inputs: let localLib = import ./flake/lib.nix inputs.nixpkgs.lib; in
{
packages.x86_64-linux = import ./flake/packages.nix { inherit inputs localLib; };
nixosConfigurations = import ./flake/nixos.nix { inherit inputs localLib; };
overlays.default = final: prev:
{ localPackages = (import ./packages { inherit localLib; pkgs = final; topInputs = inputs; }); };
config = { archive = false; branch = "production"; };
devShells.x86_64-linux = import ./flake/dev.nix { inherit inputs; };
src = import ./flake/src.nix { inherit inputs; };
};
outputs = inputs:
let
localLib = import ./local/lib inputs.nixpkgs.lib;
devices = builtins.filter (dir: (builtins.readDir ./devices/${dir})."default.nix" or null == "regular" )
(builtins.attrNames (builtins.readDir ./devices));
in
{
packages.x86_64-linux =
let pkgs = (import inputs.nixpkgs
{
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [ inputs.self.overlays.default ];
});
in
{
default = inputs.nixpkgs.legacyPackages.x86_64-linux.writeText "systems"
(builtins.concatStringsSep "\n" (builtins.map
(system: builtins.toString inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel)
devices));
hpcstat =
let
openssh = (pkgs.pkgsStatic.openssh.override { withLdns = false; etcDir = null; }).overrideAttrs
(prev: { doCheck = false; patches = prev.patches ++ [ ./local/pkgs/hpcstat/openssh.patch ];});
duc = pkgs.pkgsStatic.duc.override { enableCairo = false; cairo = null; pango = null; };
in pkgs.pkgsStatic.localPackages.hpcstat.override
{ inherit openssh duc; standalone = true; version = inputs.self.rev or "dirty"; };
ufo = pkgs.pkgsStatic.localPackages.ufo.override { version = inputs.self.rev or "dirty"; };
nixpkgs = pkgs;
}
// (
builtins.listToAttrs (builtins.map
(system:
{
name = system;
value = inputs.self.outputs.nixosConfigurations.${system}.config.system.build.toplevel;
})
devices)
);
nixosConfigurations =
(
(builtins.listToAttrs (builtins.map
(system:
{
name = system;
value = inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
specialArgs = { topInputs = inputs; inherit localLib; };
modules = localLib.mkModules
[
(moduleInputs: { config.nixpkgs.overlays = [(prev: final:
# replace pkgs with final to avoid infinite recursion
{ localPackages = import ./local/pkgs (moduleInputs // { pkgs = final; }); })]; })
./modules
./devices/${system}
];
};
})
devices))
// {
pi3b = inputs.nixpkgs.lib.nixosSystem
{
system = "aarch64-linux";
specialArgs = { topInputs = inputs; inherit localLib; };
modules = localLib.mkModules
[
(moduleInputs: { config.nixpkgs.overlays = [(prev: final:
# replace pkgs with final to avoid infinite recursion
{ localPackages = import ./local/pkgs (moduleInputs // { pkgs = final; }); })]; })
./modules
./devices/pi3b
];
};
}
);
deploy =
{
sshUser = "root";
user = "root";
fastConnection = true;
autoRollback = false;
magicRollback = false;
nodes = builtins.listToAttrs (builtins.map
(node:
{
name = node;
value =
{
hostname = node;
profiles.system.path = inputs.self.nixosConfigurations.${node}.pkgs.deploy-rs.lib.activate.nixos
inputs.self.nixosConfigurations.${node};
};
})
[ "vps6" "vps7" "nas" "surface" "xmupc1" "xmupc2" "pi3b" ]
);
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib;
overlays.default = final: prev:
{ localPackages = (import ./local/pkgs { inherit (inputs) lib; pkgs = final; topInputs = inputs; }); };
config = { archive = false; branch = "production"; };
devShells.x86_64-linux =
let pkgs = (import inputs.nixpkgs
{
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [ inputs.self.overlays.default ];
});
in
{
biu = pkgs.mkShell
{
inputsFrom = with pkgs.localPackages; [ biu ];
buildInputs = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
hpcstat = pkgs.mkShell
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.hpcstat.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
sbatch-tui = pkgs.mkShell
{
inputsFrom = with pkgs.localPackages; [ sbatch-tui ];
buildInputs = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
ufo = pkgs.mkShell
{
inputsFrom = [ (inputs.self.packages.x86_64-linux.ufo.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
};
};
}

View File

@@ -1,41 +0,0 @@
{ inputs }: let inherit (inputs.self.nixosConfigurations.pc) pkgs; in
{
biu = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.biu ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
hpcstat = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ (pkgs.localPackages.hpcstat.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
sbatch-tui = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.sbatch-tui ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
ufo = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.ufo ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
chn-bsub = pkgs.mkShell
{
inputsFrom = [ pkgs.localPackages.chn-bsub ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
winjob =
let inherit (pkgs) clang-tools_18; in let inherit (inputs.self.packages.x86_64-w64-mingw32) pkgs winjob;
in pkgs.mkShell.override { stdenv = pkgs.gcc14Stdenv; }
{
inputsFrom = [ winjob ];
packages = [ clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
}

View File

@@ -1,51 +0,0 @@
{ inputs, localLib }:
builtins.listToAttrs
(
(builtins.map
(system:
{
name = system;
value = inputs.nixpkgs.lib.nixosSystem
{
system = let arch.pi3b = "aarch64-linux"; in arch.${system} or "x86_64-linux";
specialArgs = { topInputs = inputs; inherit localLib; };
modules = localLib.mkModules
[
{
config =
{
nixpkgs.overlays = [ inputs.self.overlays.default ];
nixos.system.networking.hostname = system;
};
}
../modules
../devices/${system}
];
};
})
[ "nas" "pc" "pi3b" "surface" "vps4" "vps6" "vps7" "xmupc1" "xmupc2" ])
++ (builtins.map
(node:
{
name = "srv1-${node}";
value = inputs.nixpkgs.lib.nixosSystem
{
system = "x86_64-linux";
specialArgs = { topInputs = inputs; inherit localLib; };
modules = localLib.mkModules
[
{
config =
{
nixpkgs.overlays = [ inputs.self.overlays.default ];
nixos.system.cluster = { clusterName = "srv1"; nodeName = node; };
};
}
../modules
../devices/srv1
../devices/srv1/${node}
];
};
})
[ "node0" "node1" "node2" "node3" ])
)

View File

@@ -1,29 +0,0 @@
{ inputs, localLib }: rec
{
pkgs = (import inputs.nixpkgs
{
system = "x86_64-linux";
config.allowUnfree = true;
overlays = [ inputs.self.overlays.default ];
});
hpcstat =
let
openssh = (pkgs.pkgsStatic.openssh.override { withLdns = false; etcDir = null; }).overrideAttrs
(prev: { doCheck = false; patches = prev.patches ++ [ ../packages/hpcstat/openssh.patch ];});
duc = pkgs.pkgsStatic.duc.override { enableCairo = false; cairo = null; pango = null; };
# pkgsStatic.clangStdenv have a bug
# https://github.com/NixOS/nixpkgs/issues/177129
biu = pkgs.pkgsStatic.localPackages.biu.override { stdenv = pkgs.pkgsStatic.gcc14Stdenv; };
in pkgs.pkgsStatic.localPackages.hpcstat.override
{
inherit openssh duc biu;
standalone = true;
version = inputs.self.rev or "dirty";
stdenv = pkgs.pkgsStatic.gcc14Stdenv;
};
chn-bsub = pkgs.pkgsStatic.localPackages.chn-bsub;
blog = pkgs.callPackage inputs.blog { inherit (inputs) hextra; };
}
// (builtins.listToAttrs (builtins.map
(system: { inherit (system) name; value = system.value.config.system.build.toplevel; })
(localLib.attrsToList inputs.self.outputs.nixosConfigurations)))

View File

@@ -1,4 +0,0 @@
{ inputs }: let inherit (inputs.self.packages.x86_64-linux) pkgs; in
{
git-lfs-transfer = "sha256-1cGlhLdnU6yTqzcB3J1cq3gawncbtdgkb3LFh2ZmXbM=";
}

View File

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

3
local/pkgs/biu/.clangd Normal file
View File

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

View File

@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.14)
project(biu LANGUAGES CXX)
enable_testing()
include(GNUInstallDirs)
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message("Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
find_package(magic_enum REQUIRED)
find_package(fmt REQUIRED)
find_package(Boost REQUIRED COMPONENTS headers iostreams)
find_package(Eigen3 REQUIRED)
find_package(range-v3 REQUIRED)
find_path(NAMEOF_INCLUDE_DIR nameof.hpp REQUIRED)
find_path(ZPP_BITS_INCLUDE_DIR zpp_bits.h REQUIRED)
add_library(biu src/common.cpp)
target_include_directories(biu PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ${NAMEOF_INCLUDE_DIR} ${ZPP_BITS_INCLUDE_DIR})
target_link_libraries(biu PUBLIC magic_enum::magic_enum fmt::fmt Boost::headers Boost::iostreams Eigen3::Eigen
range-v3::range-v3)
set_property(TARGET biu PROPERTY CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF)
install(TARGETS biu EXPORT biuTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(EXPORT biuTargets FILE biuTargets.cmake NAMESPACE biu:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/biu)
install(FILES biuConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/biu)
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -2,8 +2,6 @@
# include <regex>
# include <optional>
# include <filesystem>
# include <concurrencpp/concurrencpp.h>
# include <type_traits>
# include <fmt/format.h>
# include <magic_enum_all.hpp>
@@ -28,14 +26,12 @@ namespace biu
using int128_t = __int128_t;
using uint128_t = __uint128_t;
struct Empty
{
template <typename T> consteval bool operator==(const T&) const
{ return std::same_as<std::remove_cvref_t<T>, Empty>; }
};
struct Empty {};
struct CaseInsensitiveStringLessComparator
{ template <typename String> constexpr bool operator()(const String& s1, const String& s2) const; };
{
template <typename String> constexpr bool operator()(const String& s1, const String& s2) const;
};
namespace detail_
{
template <typename T> struct RemoveMemberPointerHelper { using Type = T; };
@@ -76,50 +72,37 @@ namespace biu
namespace detail_
{
struct ExecMode { bool DirectStdin = false, DirectStdout = false, DirectStderr = false, SearchPath = false; };
template <ExecMode Mode> struct ExecResult
template <bool DirectStdout, bool DirectStderr> struct ExecResult
{
int ExitCode;
std::conditional_t<Mode.DirectStdout, Empty, std::string> Stdout;
std::conditional_t<Mode.DirectStderr, Empty, std::string> Stderr;
std::conditional_t<DirectStdout, Empty, std::string> Stdout;
std::conditional_t<DirectStderr, Empty, std::string> Stderr;
operator bool() const;
};
template <ExecMode Mode> struct ExecInput
{
std::conditional_t<Mode.SearchPath, std::string, std::filesystem::path> Program;
std::vector<std::string> Args;
std::conditional_t<Mode.DirectStdin, Empty, std::string> Stdin = {};
std::map<std::string, std::string> ExtraEnv = {};
std::optional<std::chrono::milliseconds> Timeout;
};
struct ExecInput { bool DirectStdin = false, DirectStdout = false, DirectStderr = false, SearchPath = false; };
}
template <detail_::ExecMode Mode = {}> detail_::ExecResult<Mode> exec(detail_::ExecInput<Mode> input);
template <detail_::ExecInput Input = {}> requires (!Input.DirectStdin)
detail_::ExecResult<Input.DirectStdout, Input.DirectStderr> exec
(
std::conditional_t<Input.SearchPath, std::string, std::filesystem::path> program, std::vector<std::string> args,
std::optional<std::string> stdin_string = {}, std::map<std::string, std::string> extra_env = {}
);
template <detail_::ExecInput Input = {}> requires (Input.DirectStdin)
detail_::ExecResult<Input.DirectStdout, Input.DirectStderr> exec
(
std::conditional_t<Input.SearchPath, std::string, std::filesystem::path> program, std::vector<std::string> args,
std::map<std::string, std::string> extra_env = {}
);
template <typename Array> concurrencpp::generator<std::pair<Array, std::size_t>> sequence(Array from, Array to);
template <typename Array> concurrencpp::generator<std::pair<Array, std::size_t>> sequence(Array to);
namespace detail_
{
template <typename Byte> struct ReadReturnType;
template <> struct ReadReturnType<std::byte> { using Type = std::vector<std::byte>; };
template <> struct ReadReturnType<char> { using Type = std::string; };
}
template <typename Byte> detail_::ReadReturnType<Byte>::Type read(const std::filesystem::path& path);
template <typename Byte> detail_::ReadReturnType<Byte>::Type read(std::istream& input);
template<> std::vector<std::byte> read<std::byte>(const std::filesystem::path& path);
template<> std::string read<char>(const std::filesystem::path& path);
template<> std::vector<std::byte> read<std::byte>(std::istream& input);
template<> std::string read<char>(std::istream& input);
namespace detail_
{
struct ToLvalueHelper {};
template <typename T> T& operator|(T&& obj, const ToLvalueHelper&);
}
constexpr detail_::ToLvalueHelper toLvalue;
static_assert(sizeof(char) == sizeof(std::byte));
template <typename Char = std::byte, typename T> requires (std::same_as<Char, std::byte>)
std::vector<std::byte> serialize(const T& data);
template <typename Char = std::byte, typename T> requires (std::same_as<Char, char>)
std::string serialize(const T& data);
template <typename T> T deserialize(const std::string& serialized_data);
template <typename T> T deserialize(const std::vector<std::byte>& serialized_data);
}
using common::hash, common::unused, common::block_forever, common::is_interactive, common::env, common::int128_t,
common::uint128_t, common::Empty, common::CaseInsensitiveStringLessComparator, common::RemoveMemberPointer,
common::MoveQualifiers, common::FallbackIfNoTypeDeclared, common::exec, common::sequence, common::read,
common::toLvalue;
common::MoveQualifiers, common::FallbackIfNoTypeDeclared, common::exec, common::serialize, common::deserialize;
}

View File

@@ -1,9 +1,28 @@
# pragma once
# include <boost/functional/hash.hpp>
# include <zpp_bits.h>
# include <biu/serialize.hpp>
# include <biu/common.hpp>
namespace biu
namespace biu::common
{
void unused(auto&&...) {}
std::size_t hash(auto&&... objs)
{
std::size_t result = 0;
(boost::hash_combine(result, objs), ...);
return result;
}
template <typename String> constexpr bool CaseInsensitiveStringLessComparator::operator()
(const String& s1, const String& s2) const
{
return std::lexicographical_compare
(
s1.begin(), s1.end(), s2.begin(), s2.end(),
[](char c1, char c2){return std::tolower(c1) < std::tolower(c2);}
);
}
template <typename Char, typename T> requires (std::same_as<Char, std::byte>)
std::vector<std::byte> serialize(const T& data)
{
@@ -25,27 +44,7 @@ namespace biu
}
template <typename T> T deserialize(const std::string& serialized_data)
{
auto begin = reinterpret_cast<const std::byte*>(serialized_data.data());
auto end = begin + serialized_data.size();
auto begin = reinterpret_cast<const std::byte*>(serialized_data.data()), end = begin + serialized_data.size();
return deserialize<T>(std::vector<std::byte>{begin, end});
}
}
namespace std
{
template <typename Complex> constexpr auto serialize(auto & archive, Complex& complex)
requires biu::SpecializationOf<std::remove_cvref_t<Complex>, std::complex>
{
if constexpr (std::integral<decltype(archive())>) return 2;
else
{
using archive_type = std::remove_cvref_t<decltype(archive)>;
std::array<typename Complex::value_type, 2> data;
if constexpr (archive_type::kind() == zpp::bits::kind::out) data = {complex.real(), complex.imag()};
zpp::bits::errc result;
if (result = archive(data); result.code != std::errc{}) [[unlikely]] return result;
if constexpr (archive_type::kind() == zpp::bits::kind::in) complex = {data[0], data[1]};
return result;
}
}
}

View File

@@ -46,11 +46,9 @@ namespace biu
= std::is_invocable_r_v<Result, Function, Args...>;
template <typename T> concept Arithmetic = std::is_arithmetic<T>::value || SpecializationOf<T, std::complex>;
template <typename T> concept Nullptr = std::is_null_pointer_v<std::remove_cvref_t<T>>;
}
using concepts::DecayedType, concepts::SpecializationOf, concepts::CompletedType, concepts::ImplicitlyConvertibleTo,
concepts::ImplicitlyConvertibleFrom, concepts::ExplicitlyConvertibleTo, concepts::ExplicitlyConvertibleFrom,
concepts::ConvertibleTo, concepts::ConvertibleFrom, concepts::ConstevalInvokable, concepts::Enumerable,
concepts::InvocableWithResult, concepts::Arithmetic, concepts::Nullptr;
concepts::InvocableWithResult, concepts::Arithmetic;
}

View File

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

View File

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

View File

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

View File

@@ -1,24 +1,20 @@
# pragma once
# include <fmt/core.h>
# include <fmt/ranges.h>
# include <fmt/std.h>
# include <fmt/chrono.h>
# include <fmt/xchar.h>
# include <nameof.hpp>
# include <biu/format.hpp>
# include <fmt/core.h>
namespace biu
{
template <typename Char, Char... c> template <typename... Param>
std::basic_string<Char> format::detail_::FormatLiteralHelper<Char, c...>::operator() (Param&&... param) const
std::basic_string<Char> detail_::FormatLiteralHelper<Char, c...>::operator() (Param&&... param) const
{ return fmt::format(BasicStaticString<Char, c...>::StringView, std::forward<Param>(param)...); }
template <typename Char, Char... c> consteval
format::detail_::FormatLiteralHelper<Char, c...> literals::operator""_f()
detail_::FormatLiteralHelper<Char, c...> literals::operator""_f()
{ return {}; }
template <typename T, typename Char> constexpr
auto format::detail_::FormatterReuseProxy<T, Char>::parse(fmt::basic_format_parse_context<Char>& ctx)
-> typename fmt::basic_format_parse_context<Char>::iterator
template <typename T> constexpr
auto detail_::FormatterReuseProxy<T>::parse(fmt::format_parse_context& ctx)
-> std::invoke_result_t<decltype(&fmt::format_parse_context::begin), fmt::format_parse_context>
{
if (ctx.begin() != ctx.end() && *ctx.begin() != '}')
throw fmt::format_error
@@ -37,8 +33,7 @@ namespace biu
{
if (holds_alternative<T>(value))
{
if constexpr (fmt::is_formattable<T, Char>::value)
os << "({}: {})"_f(nameof::nameof_full_type<T>(), get<T>(value));
if constexpr (biu::Formattable<T, Char>) os << "({}: {})"_f(nameof::nameof_full_type<T>(), get<T>(value));
else os << "({}: {})"_f(nameof::nameof_full_type<T>(), "non-null unformattable value");
}
};
@@ -49,17 +44,16 @@ namespace biu
namespace fmt
{
template <typename Char, biu::format::detail_::OptionalWrap Wrap> template <typename FormatContext>
auto formatter<Wrap, Char>::format(const Wrap& wrap, FormatContext& ctx) const
-> typename FormatContext::iterator
template <typename Char, biu::detail_::OptionalWrap Wrap> template <typename FormatContext>
auto formatter<Wrap, Char>::format(const Wrap& wrap, FormatContext& ctx)
-> std::invoke_result_t<decltype(&FormatContext::out), FormatContext>
{
using value_t = biu::format::detail_::UnderlyingTypeOfOptionalWrap<Wrap>::Type;
using value_t = biu::detail_::UnderlyingTypeOfOptionalWrap<Wrap>::Type;
auto format_value_type = [&, this](const value_t& value)
{
if constexpr (!fmt::is_formattable<value_t, Char>::value)
return fmt::format_to(ctx.out(), "non-null unformattable value");
if constexpr (!biu::Formattable<value_t, Char>) return fmt::format_to(ctx.out(), "non-null unformattable value");
else if constexpr (std::default_initializable<formatter<value_t>>)
biu::format::detail_::FormatterReuseProxy<value_t, Char>::format(value, ctx);
biu::detail_::FormatterReuseProxy<value_t>::format(value, ctx);
else fmt::format_to(ctx.out(), "{}", value);
};
fmt::format_to(ctx.out(), "(");
@@ -79,16 +73,8 @@ namespace fmt
return fmt::format_to(ctx.out(), ")");
}
template <biu::SpecializationOf<std::sub_match> SubMatch> template <typename FormatContext>
auto formatter<SubMatch, typename SubMatch::value_type>::format(const SubMatch& match, FormatContext& ctx) const
-> typename FormatContext::iterator
{
return formatter<std::basic_string<typename SubMatch::value_type>, typename SubMatch::value_type>::format
(match.str(), ctx);
}
template <typename Char, biu::Enumerable T> constexpr auto formatter<T, Char>::parse
(fmt::basic_format_parse_context<Char>& ctx) -> typename fmt::basic_format_parse_context<Char>::iterator
template <typename Char, biu::Enumerable T> constexpr auto formatter<T, Char>::parse(format_parse_context& ctx)
-> std::invoke_result_t<decltype(&format_parse_context::begin), format_parse_context>
{
auto it = ctx.begin();
if (it != ctx.end() && *it == 'f') { full = true; it++; }
@@ -97,7 +83,8 @@ namespace fmt
}
template <typename Char, biu::Enumerable T> template <typename FormatContext>
auto formatter<T, Char>::format(const T& value, FormatContext& ctx) const -> typename FormatContext::iterator
auto formatter<T, Char>::format(const T& value, FormatContext& ctx)
-> std::invoke_result_t<decltype(&FormatContext::out), FormatContext>
{
if (full) return fmt::format_to(ctx.out(), "{}::{}", nameof::nameof_type<T>(), nameof::nameof_enum(value));
else return fmt::format_to(ctx.out(), "{}", nameof::nameof_enum(value));

View File

@@ -1,7 +1,7 @@
# pragma once
# include <map>
# include <boost/stacktrace.hpp>
# include <biu/atomic.hpp>
# include <biu/atomic/nolog.hpp>
namespace biu
{
@@ -17,6 +17,7 @@ namespace biu
{
None,
Error,
Access,
Info,
Debug
};
@@ -26,17 +27,18 @@ namespace biu
std::shared_ptr<std::ostream> StreamStorage;
Logger::Level Level;
};
protected: static Atomic<LoggerConfigType_> LoggerConfig_;
protected: static Atomic<std::optional<LoggerConfigType_>, false> LoggerConfig_;
public: static void init(std::experimental::observer_ptr<std::ostream> stream, Level level);
public: static void init(std::shared_ptr<std::ostream> stream, Level level);
// Send a telegram message if token and chat id are set, all the functions are thread-safe
protected: static Atomic<std::optional<std::pair<std::string, std::string>>> TelegramConfig_;
protected: static Atomic<std::optional<std::pair<std::string, std::string>>, false> TelegramConfig_;
public: static void telegram_init(const std::string& token, const std::string& chat_id);
public: static void telegram_notify(const std::string& message, bool async = false);
public: static void telegram_notify(const std::string& message);
public: static void telegram_notify_async(const std::string& message);
// Monitor the lifetime of an object
// usage: struct my_class : protected Logger::ObjectMonitor<my_class> { ... }
// usage: struct my_class : protected Logger::ObjectMonitor<my_class> {}
public: template <typename T> class ObjectMonitor
{
protected: const std::chrono::time_point<std::chrono::steady_clock> CreateTime_;
@@ -50,7 +52,7 @@ namespace biu
template <typename T> friend class ObjectMonitor;
// List of objects that is being monitored by ObjectMonitor, {address, type}
protected: static Atomic<std::multimap<const void*, std::string_view>> Objects_;
protected: static Atomic<std::multimap<const void*, std::string_view>, false> Objects_;
public: template <typename FinalException> class Exception : public std::exception
{
@@ -68,18 +70,16 @@ namespace biu
{
protected: thread_local static unsigned Indent_;
protected: const std::chrono::time_point<std::chrono::steady_clock> StartTime_;
protected: std::size_t get_time_ms() const;
protected: std::size_t get_thread_id() const;
// if sizeof...(Param) > 0, call log<Debug>("begin function with {arguments}.");
// else call log<Debug>("begin function.");
public: template <typename... Param> [[gnu::always_inline]] explicit Guard(Param&&... param);
// call log<Debug>("end function after {duration} ms.")
public: [[gnu::always_inline]] inline virtual ~Guard();
public: [[gnu::always_inline]] virtual ~Guard();
// call log<Debug>("reached after {duration} ms.")
public: [[gnu::always_inline]] inline void operator()() const;
public: [[gnu::always_inline]] void operator()() const;
// call log<Debug>("return {return} after {duration} ms.")
public: template <typename T> [[gnu::always_inline]] T rtn(T&& value) const;
@@ -88,9 +88,6 @@ namespace biu
// LoggerConfig_
// [ {time} {thread} {indent} {filename}:{line} {function_name} ] {message}
public: template <Level L> [[gnu::always_inline]] void log(const std::string& message) const;
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: template <typename FinalException> [[gnu::always_inline]] void print_exception
(
@@ -101,6 +98,6 @@ namespace biu
friend class Guard;
// list of threads which is being monitored by Guard and number of Guard created in this thread so far
protected: static Atomic<std::map<std::size_t, std::size_t>> Threads_;
protected: static Atomic<std::map<std::size_t, std::size_t>, false> Threads_;
};
}

View File

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

View File

@@ -11,7 +11,6 @@ namespace biu
protected: T& Ref_;
public: SmartRef(T& val);
public: SmartRef(T&& val);
public: template <typename... Us> requires (std::is_constructible_v<T, Us...>) SmartRef(Us&&... val);
public: T& operator*();
public: T* operator->();

View File

@@ -5,8 +5,6 @@
namespace biu
{
template <typename T> inline SmartRef<T>::SmartRef(T& val) : Ref_(val) {}
template <typename T> inline SmartRef<T>::SmartRef(T&& val)
: Ptr_(std::make_unique<T>(std::move(val))), Ref_(*Ptr_) {}
template <typename T> template <typename... Us> requires (std::is_constructible_v<T, Us...>)
inline SmartRef<T>::SmartRef(Us&&... val)
: Ptr_(std::make_unique<T>(std::forward<Us>(val)...)), Ref_(*Ptr_) {}

View File

@@ -4,9 +4,7 @@
# include <string>
# include <string_view>
# include <iostream>
# include <concurrencpp/concurrencpp.h>
# include <biu/concepts.hpp>
# include <biu/smartref.hpp>
namespace biu
{
@@ -38,13 +36,6 @@ namespace biu
template <std::size_t M> requires (M<=N) constexpr BasicVariableString(const Char (&str)[M]);
};
template <std::size_t N> using VariableString = BasicVariableString<char, N>;
// Find specific content in a string. Return unmatched content before the match and the match result every
// time. If match reached the end, the second returned value will be std::sregex_iterator().
concurrencpp::generator<std::pair<std::string_view, std::sregex_iterator>> find
(SmartRef<const std::string> data, SmartRef<const std::regex> regex);
std::string replace
(const std::string& data, const std::regex& regex, std::function<std::string(const std::smatch&)> function);
}
using string::BasicStaticString, string::StaticString, string::BasicFixedString, string::FixedString,
string::BasicVariableString, string::VariableString;
@@ -114,3 +105,13 @@ namespace biu
concepts::SpecializationOfBasicFixedString, concepts::SpecializationOfFixedString,
concepts::SpecializationOfBasicVariableString, concepts::SpecializationOfVariableString;
}
// namespace string
// {
// // Find specific content in a string. Return unmatched content before the match and the match result every
// // time. If match reached the end, the second returned value will be std::sregex_iterator().
// concurrencpp::generator<std::pair<std::string_view, std::sregex_iterator>> find
// (SmartRef<const std::string> data, SmartRef<const std::regex> regex);
// // Use a regex to find all matches and replace them with a callback function
// std::string replace
// (const std::string& data, const std::regex& regex, std::function<std::string(const std::smatch&)> function);
// }

View File

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

View File

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

View File

@@ -1,3 +1,4 @@
# include <fmt/chrono.h>
# include <biu.hpp>
namespace biu
@@ -10,14 +11,17 @@ namespace biu
std::sregex_iterator regit;
while (true)
{
if (regit == std::sregex_iterator{}) regit = std::sregex_iterator{data->begin(), data->end(), *regex};
else regit++;
if (regit == std::sregex_iterator{})
regit = std::sregex_iterator{data->begin(), data->end(), *regex};
else
regit++;
if (regit == std::sregex_iterator{})
{
unmatched_prefix_end = data->cend();
log.debug("distance: {}"_f(std::distance(unmatched_prefix_begin, unmatched_prefix_end)));
log.log<Logger::Level::Debug>("distance: {}"_f(std::distance(unmatched_prefix_begin, unmatched_prefix_end)));
}
else unmatched_prefix_end = (*regit)[0].first;
else
unmatched_prefix_end = (*regit)[0].first;
co_yield
{
std::string_view
@@ -27,7 +31,8 @@ namespace biu
},
regit
};
if (regit == std::sregex_iterator{}) break;
if (regit == std::sregex_iterator{})
break;
unmatched_prefix_begin = (*regit)[0].second;
}
}
@@ -40,7 +45,8 @@ namespace biu
for (auto matched : find(data, regex))
{
result.append(matched.first);
if (matched.second != std::sregex_iterator{}) result.append(function(*matched.second));
if (matched.second != std::sregex_iterator{})
result.append(function(*matched.second));
}
return result;
}

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

@@ -0,0 +1,88 @@
inputs: rec
{
typora = inputs.pkgs.callPackage ./typora {};
vesta = inputs.pkgs.callPackage ./vesta {};
rsshub = inputs.pkgs.callPackage ./rsshub.nix
{
inherit mkPnpmPackage;
src = inputs.topInputs.rsshub;
nodejs = nodejs-with-pnpm9.override { nodejs = inputs.pkgs.nodejs_22; };
};
misskey = inputs.pkgs.callPackage ./misskey.nix
{ inherit mkPnpmPackage; src = inputs.topInputs.misskey; nodejs = nodejs-with-pnpm9; };
mk-meili-mgn = inputs.pkgs.callPackage ./mk-meili-mgn {};
vaspkit = inputs.pkgs.callPackage ./vaspkit { inherit (inputs.localLib) attrsToList; };
v-sim = inputs.pkgs.callPackage ./v-sim { src = inputs.topInputs.v-sim; };
concurrencpp = inputs.pkgs.callPackage ./concurrencpp { src = inputs.topInputs.concurrencpp; };
eigengdb = inputs.pkgs.python3Packages.callPackage ./eigengdb {};
nodesoup = inputs.pkgs.callPackage ./nodesoup { src = inputs.topInputs.nodesoup; };
matplotplusplus = inputs.pkgs.callPackage ./matplotplusplus
{ inherit nodesoup glad; src = inputs.topInputs.matplotplusplus; };
zpp-bits = inputs.pkgs.callPackage ./zpp-bits { src = inputs.topInputs.zpp-bits; };
eigen = inputs.pkgs.callPackage ./eigen { src = inputs.topInputs.eigen; };
nameof = inputs.pkgs.callPackage ./nameof { src = inputs.topInputs.nameof; };
pslist = inputs.pkgs.callPackage ./pslist {};
glad = inputs.pkgs.callPackage ./glad {};
chromiumos-touch-keyboard = inputs.pkgs.callPackage ./chromiumos-touch-keyboard {};
yoga-support = inputs.pkgs.callPackage ./yoga-support {};
tgbot-cpp = inputs.pkgs.callPackage ./tgbot-cpp { src = inputs.topInputs.tgbot-cpp; };
mirism = inputs.pkgs.callPackage ./mirism
{
inherit cppcoro nameof tgbot-cpp date;
nghttp2 = inputs.pkgs.callPackage "${inputs.topInputs."nixpkgs-23.05"}/pkgs/development/libraries/nghttp2"
{ enableAsioLib = true; stdenv = inputs.pkgs.gcc12Stdenv; };
stdenv = inputs.pkgs.gcc12Stdenv;
};
cppcoro = inputs.pkgs.callPackage ./cppcoro { src = inputs.topInputs.cppcoro; };
date = inputs.pkgs.callPackage ./date { src = inputs.topInputs.date; };
esbonio = inputs.pkgs.python3Packages.callPackage ./esbonio {};
pix2tex = inputs.pkgs.python3Packages.callPackage ./pix2tex {};
pyreadline3 = inputs.pkgs.python3Packages.callPackage ./pyreadline3 {};
torchdata = inputs.pkgs.python3Packages.callPackage ./torchdata {};
torchtext = inputs.pkgs.python3Packages.callPackage ./torchtext { inherit torchdata; };
win11os-kde = inputs.pkgs.callPackage ./win11os-kde { src = inputs.topInputs.win11os-kde; };
fluent-kde = inputs.pkgs.callPackage ./fluent-kde { src = inputs.topInputs.fluent-kde; };
blurred-wallpaper = inputs.pkgs.callPackage ./blurred-wallpaper.nix { src = inputs.topInputs.blurred-wallpaper; };
slate = inputs.pkgs.callPackage ./slate { src = inputs.topInputs.slate; };
nvhpc = inputs.pkgs.callPackage ./nvhpc {};
lmod = inputs.pkgs.callPackage ./lmod { src = inputs.topInputs.lmod; };
vasp = rec
{
src = inputs.pkgs.callPackage ./vasp/source.nix {};
gnu = inputs.pkgs.callPackage ./vasp/gnu
{
inherit (inputs.pkgs.llvmPackages) openmp;
inherit wannier90 src;
hdf5 = inputs.pkgs.hdf5.override { mpiSupport = true; fortranSupport = true; cppSupport = false; };
};
nvidia = inputs.pkgs.callPackage ./vasp/nvidia
{ inherit lmod nvhpc wannier90 vtst src; hdf5 = hdf5-nvhpc; };
intel = inputs.pkgs.callPackage ./vasp/intel
{ inherit lmod oneapi wannier90 vtst src; hdf5 = hdf5-oneapi; };
wannier90 = inputs.pkgs.callPackage
"${inputs.topInputs.nixpkgs-unstable}/pkgs/by-name/wa/wannier90/package.nix" {};
hdf5-nvhpc = inputs.pkgs.callPackage ./vasp/hdf5-nvhpc { inherit lmod nvhpc; inherit (inputs.pkgs.hdf5) src; };
hdf5-oneapi = inputs.pkgs.callPackage ./vasp/hdf5-oneapi { inherit lmod oneapi; inherit (inputs.pkgs.hdf5) src; };
vtst = (inputs.pkgs.callPackage ./vasp/vtst.nix {});
vtstscripts = inputs.pkgs.callPackage ./vasp/vtstscripts.nix {};
};
# TODO: use other people packaged hpc version
oneapi = inputs.pkgs.callPackage ./oneapi {};
mumax = inputs.pkgs.callPackage ./mumax { src = inputs.topInputs.mumax; };
kylin-virtual-keyboard = inputs.pkgs.libsForQt5.callPackage ./kylin-virtual-keyboard
{ src = inputs.topInputs.kylin-virtual-keyboard; };
biu = inputs.pkgs.callPackage ./biu { inherit nameof zpp-bits; };
zxorm = inputs.pkgs.callPackage ./zxorm { src = inputs.topInputs.zxorm; };
hpcstat = inputs.pkgs.callPackage ./hpcstat { inherit nameof sqlite-orm zpp-bits date openxlsx biu; };
openxlsx = inputs.pkgs.callPackage ./openxlsx { src = inputs.topInputs.openxlsx; };
sqlite-orm = inputs.pkgs.callPackage ./sqlite-orm { src = inputs.topInputs.sqlite-orm; };
mkPnpmPackage = inputs.pkgs.callPackage ./mkPnpmPackage.nix {};
nodejs-with-pnpm9 = inputs.pkgs.callPackage ./nodejs-with-pnpm9.nix {};
sbatch-tui = inputs.pkgs.callPackage ./sbatch-tui { inherit biu; };
ufo = inputs.pkgs.callPackage ./ufo
{ inherit concurrencpp biu glad matplotplusplus zpp-bits; tbb = inputs.pkgs.tbb_2021_11; };
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}
"${inputs.pkgs.remarshal}/bin/yaml2json ${builtins.toFile "content.yaml" content} $out"));
}

View File

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

View File

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

View File

@@ -1,5 +1,4 @@
# cmake_minimum_required(VERSION 3.30)
cmake_minimum_required(VERSION 3.29)
cmake_minimum_required(VERSION 3.14)
project(hpcstat VERSION 0.0.0 LANGUAGES CXX)
enable_testing()
include(GNUInstallDirs)
@@ -12,22 +11,25 @@ endif()
set(HPCSTAT_VERSION "unknown" CACHE STRING "Version of the hpcstat")
find_package(Boost REQUIRED COMPONENTS url)
find_package(Boost REQUIRED COMPONENTS headers filesystem)
find_package(SqliteOrm REQUIRED)
find_package(nlohmann_json REQUIRED)
find_path(ZPP_BITS_INCLUDE_DIR zpp_bits.h REQUIRED)
find_package(range-v3 REQUIRED)
find_path(NAMEOF_INCLUDE_DIR nameof.hpp REQUIRED)
find_package(date REQUIRED)
find_package(OpenXLSX REQUIRED)
find_package(httplib REQUIRED)
find_package(termcolor REQUIRED)
find_package(biu REQUIRED)
find_package(OpenXLSX REQUIRED)
add_executable(hpcstat src/main.cpp src/env.cpp src/keys.cpp src/ssh.cpp src/sql.cpp src/lfs.cpp src/common.cpp
src/push.cpp src/disk.cpp)
# target_compile_features(hpcstat PRIVATE cxx_std_26)
target_compile_options(hpcstat PRIVATE "-std=c++26")
target_include_directories(hpcstat PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(hpcstat PRIVATE Boost::url sqlite_orm::sqlite_orm nlohmann_json::nlohmann_json date::date
date::date-tz httplib::httplib termcolor::termcolor biu::biu OpenXLSX::OpenXLSX)
target_compile_features(hpcstat PRIVATE cxx_std_23)
target_include_directories(hpcstat PRIVATE ${PROJECT_SOURCE_DIR}/include ${ZPP_BITS_INCLUDE_DIR})
target_link_libraries(hpcstat PRIVATE Boost::headers Boost::filesystem sqlite_orm::sqlite_orm
nlohmann_json::nlohmann_json range-v3::range-v3 date::date date::date-tz OpenXLSX::OpenXLSX httplib::httplib
termcolor::termcolor biu::biu)
target_compile_definitions(hpcstat PRIVATE HPCSTAT_VERSION="${HPCSTAT_VERSION}")
install(TARGETS hpcstat RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -36,9 +38,3 @@ install(DIRECTORY share/ DESTINATION ${CMAKE_INSTALL_DATADIR}/hpcstat)
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")
message("List of compile features: ${CMAKE_CXX_COMPILE_FEATURES}")
include(CTest)
add_executable(test-main test/main.cpp)
target_link_libraries(test-main PRIVATE biu::biu)
set_property(TARGET test-main PROPERTY CXX_STANDARD 23 CXX_STANDARD_REQUIRED ON)
add_test(NAME test-main COMMAND test-main)

View File

@@ -1,12 +1,13 @@
{
stdenv, cmake, pkg-config, standalone ? false, version ? null, makeWrapper, lib,
sqlite-orm, nlohmann_json, range-v3, openssh, sqlite, date, httplib, openssl, openxlsx, termcolor, duc, biu
boost, fmt, sqlite-orm, nlohmann_json, zpp-bits, range-v3, nameof, openssh, sqlite, date, openxlsx, httplib, openssl,
termcolor, duc, biu
}: stdenv.mkDerivation
{
name = "hpcstat";
src = ./.;
buildInputs =
[ sqlite-orm nlohmann_json range-v3 sqlite date httplib termcolor openssl biu openxlsx ];
[ boost fmt sqlite-orm nlohmann_json zpp-bits range-v3 nameof sqlite date openxlsx httplib termcolor openssl biu ];
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
cmakeFlags = lib.optionals (version != null) [ "-DHPCSTAT_VERSION=${version}" ];
postInstall =
@@ -17,5 +18,4 @@
--set HPCSTAT_DATADIR /var/lib/hpcstat --set HPCSTAT_SSH_BINDIR ${openssh}/bin \
--set HPCSTAT_DUC_BINDIR ${duc}/bin
'';
doCheck = true;
}

View File

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

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