Compare commits

..

1 Commits
python ... vps6

Author SHA1 Message Date
chn
b201a19c75 devices.vps6.xray: add user 2024-06-30 18:45:26 +08:00
394 changed files with 7864 additions and 7001 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,9 +37,6 @@ 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

@@ -4,11 +4,6 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDJ/jzUQ6QuAjnAryvpWk7TReS6pnHxhEXY9RonojKk
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCtnVhZQsJfbs2w9hFZkx4qDhIs++7no+6r5TifP3Dq7epJYd2QYx4dI66XxTNhKxZjN6a4Xn5nFlYLtQJXOvzBLC8IBf1W5GCH0k/jqzzskS0/Ix/70HzcBwJk8ihWDkyON5Ki1BRCx34RNxth1BIxWyc5QT+lou+D92x8iAu/uOvmcAL3Ua0OlZwxw03hLp/PpS4ZnUqFjc2JVtarY7eQu/i3RwOZUaK6nT2EL8RObzk4xnieqsU5PWwA3voVjetqZaDQ+P7dimQXz/FaucroKxCNyTiy1oG4fdQpm2UDrH6ZfPvdQLYrtet6FQabXOxhV7MuR3jYtxZjs1kDVZIseIZ6IwjetaUoMxvIouRfYjOSIEo9Ek9o0+Yhku4r0uWmPDrymWugU1raMmlRxSUwdlzW+C7mQwtGbs/MG4MN4GWkM6id5DKlY2vYKUfrTzmhY1swCtzKq20fjvyX8qhJdcytgVlOrBZnPje6Qd55sI0RjdgJrBsxT2SYquez7U8= yjq@xmupc1
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDn1pfGen7kjPTHsbb8AgrUJWOeFPHK5S4M97Lcj3tvdcjZi2SXN6PwHQfh8/xGhZbTLPz/40S9O9/Dn30xkUTfnONirKt790jp7VEbOtPnjQPOd/KRNWlS3VV0BELuq5p633Mi13rP6JZtdKmU2uSkvvaUBfCppy3JaWv/B7HLJ48f8IzkdiT1px3dN1eQ4SFoHOiVG0ci5TGG6wfMdoAAnM9R1aXI4gDxnYjLYujpaNZ4hBOta/6ZK/PV0JufoXdIAZjubgk1Hv04XHXLR2Z0UhRM6x7UrZIOdM/LlnKmcVk408ZKEj/9m1xRyDsNoZ24CF++cmnwfBHrp9I5nvDI7xOTdZlOhzkiiPM3f4i6s2Qjdv4vpZ6AeE3Qt1LVQyAr67b4UMjHuYqSi2KgyCO6My2Ov2eRoS74EKcb8ejJv3O+XInmYUgDgTgDFT3CgQgK2DG45HiV6nOkaE/6iKx2JSOiYZTFc7TRcePfXF9JQD7dXFde6qm3EbIVyJIpCJ8= zem@xmupc1
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCW2fx1Sim7X2i/e/RBPEl1q/XbV7wa9pmZfnRINHIv24MCUgtNZ5GHEEW7dvzrQBeRj3I7CAyK8fbuhv/l8HuDtjxJJ1fmcBp9UG5vfpb/UTxayJxHBRrwokp2JL7HKVviI6d8FcNa/T0CMoUNYXnel6dE3B78k9Q0dDxlOGS1MzgsP3Pn66lm0ww9FRAVHe+KkhFmwyQ1VHUxHgK4QjCIt7+9+PJE7fK0aVWBsR309pui7Pbm6mgd4d6mwiBeVvxsNGnI4DsO1hz4N2GapuQy19PDiG7A4H41Z5RYQnv/3XTy4TBXOFQm77v6pyGkCmG6BGnRdvMB6C0hWPJvudbsA/BNp4ApL7/CrwTdLp1z6ToAOLvKrUQAM+hcbJimnFVMXqz7iSYg99XTnzue7ncecp19XiaDJbM47bGXcT4nTO5XaiMYi2xGAHIrij5GIuFF5ymKYSp5ejb1VucMdKlaaAmS10+wdUcuT7tzX/IuVr5aqg2dsxT5aJCRhZ1k2V0= xly@xmuhpc
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMRpyIU8ZuYTa0LvsVHmJZ1FA7Lbp4PObjkwo+UcpCP8 wp@xmupc1
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGRZp8xp9hVO7e/6eflQsnFZj853IRVywc97cTevnWbg hjp@xmupc1
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGwUhEAFHjkbUfOf0ng8I80YbKisbSeY4lq/byinV7lh wm
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF5bg5cayOLfnfUBJz8LeyaYfP41s9pIqUgXn6w9xtvR lly
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBoDGk9HYphkngx2Ix/vef2ZntdVNK1kbS9pY8+TzI41 yxf
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 = {};
initrd.sshd.enable = true;
grub.installDevice = "efi";
nixpkgs.march = "silvermont";
nix.substituters = [ "https://nix-store.chn.moe?priority=100" ];
networking = {};
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
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,10 @@ inputs:
publicKey = "xCYRbZEaGloMk7Awr00UR3JcDJy4AzVp4QvGNoyEgFY=";
wireguardIp = "192.168.83.4";
};
misskey.instances.misskey = {};
hpcstat = {};
gitea = { enable = true; hostname = "git.nas.chn.moe"; ssh = { hostname = "office.chn.moe"; port = 5440; }; };
};
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
};
}

View File

@@ -2,14 +2,26 @@ 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]
telegram:
token: ENC[AES256_GCM,data:NK9Eq3jUaMVNyPyqiXEkrc4m81c2CBg3p9TjpD8TQgKRYs2uxT9lsSrLMi02Rw==,iv:N2mjY9n7QuLD2PG4gNl79c933GTCCfw35XxluiLSuOA=,tag:ZLreEQoV+O0yhHw0CM00aQ==,type:str]
chat: ENC[AES256_GCM,data:XJi6HftAygFH,iv:ea2m41/YXp0VyxR9U84xMCHdknZBhP2QUiX6zsipaFc=,tag:+/Y2bvUwrQsLVGUZp0Imwg==,type:str]
hpcstat:
key: ENC[AES256_GCM,data:3bMieouWGMEw8eu6z55TX66NAGiF/O5dRtnDTjDtNC3fmR4PTn+FreMZuA9+AjTPUm2GsS9esC6tULIzh+qTflnSrxqtTdKAbfqY6o8pPPpDJ9WWm4f/g3x8PnvlsyQDYCZ0MYKYg3cc6n60moCzv1WWlVsT8QUMTXQL3yb36vVzo4ELea4Gf2UkpfYKX89gFDtJK78srh7rj8rwoDiBs1qVUUnIBABUDLxoyC3Rym5yevrCJeFD+8AlIAIaMc62Kslw0lCCKKSaXGsFpppFYFwUTedi595eISEr4tIuPXVd4EECQchsYg+tInphIXebp/5rzXQM37yQEymImNRiMcxDWGR0B8Nq9XO+I5T8VOIb6xXCtvEeY2Z8nPfmUn9UHfvYzqFv3it5TCcd9J4SeBa2LVW8+YCIO/KitznL49O5SGAJUONIkcwMUhUuXQUFe/vnc+g8+yqB5ltCZtHWCOY2pCdmQpBRaZq55fcde5FNhxt3J8zCbu++oIn+ERSHadMIGMuGgGqzG6XDQJZN,iv:cbPCnNi2gX1gZIdcQd7HR3c/JEsWj3nv+x+OQ0bDs40=,tag:olrGr6t2Si39wl/1rR81ig==,type:str]
postgresql:
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 +46,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-05-10T08:52:02Z"
mac: ENC[AES256_GCM,data:gKEZ0bxn+xCu7wPRCRpacErzqdajw4zNalUwZvldUP+Ygdq6KOMgjxvm3hy7GIBlhK2MLgps3X3sjdrUW1A7Tx5wiPtrqddVo5qiubZcuWqNO4SSoM2x/VxtHbKcZQMaNdIHXx3TUFjQ0tcsMuDBNNUZ192JJUDE/DaDyxTklq4=,iv:sZ98srsM68h59R9HHeh7gXdUBN2JtoWx+PhU1nsHgk0=,tag:N7211a4Jrp6AdPKhQCz65g==,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

@@ -4,27 +4,35 @@ inputs:
{
nixos =
{
model.type = "desktop";
system =
{
fileSystems =
{
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."08D3-10DE" = "Windows";
grub =
{
# TODO: install windows
# windowsEntries = { "7317-1DB6" = "Windows"; "7321-FA9C" = "Windows for malware"; };
installDevice = "efi";
};
nix =
{
marches =
@@ -37,24 +45,20 @@ 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"
];
remote.master = { enable = true; hosts = [ "xmupc1" "xmupc2" ]; };
githubToken.enable = true;
};
nixpkgs =
{ march = "znver4"; cuda = { enable = true; capabilities = [ "8.9" ]; forwardCompat = false; }; };
kernel =
{
# TODO: switch to cachyos-lts
variant = "xanmod-latest";
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;
};
hardware =
{
@@ -62,12 +66,15 @@ inputs:
gpu =
{
type = "amd+nvidia";
nvidia = { dynamicBoost = true; driver = "beta"; prime.busId = { amd = "6:0:0"; nvidia = "1:0:0"; }; };
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,48 +135,48 @@ 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 = {};
docker = {};
ananicy = {};
keyd = {};
xrdp = { enable = true; hostname = [ "pc.chn.moe" ]; };
};
bugs = [ "xmunet" "backlight" "amdpstate" ];
packages.android-studio = {};
};
boot.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
}
'';
};
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" =
{
hideMounts = true;
users.chn.directories = builtins.map
(dir: { directory = "repo/${dir}"; user = "chn"; group = "chn"; mode = "0755"; })
[ "lammps-SiC" "BPD-paper" "kurumi-asmr" "linwei-stuff" "BPD-paper-old" ];
};
specialisation =
{
nvidia.configuration =
{
nixos =
{
hardware.gpu.type = inputs.lib.mkForce "nvidia";
services.gamemode.drmDevice = inputs.lib.mkForce 0;
};
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 = {};
grub.installDevice = "efi";
networking = { hostname = "pi3b"; networkd = {}; };
nixpkgs.arch = "aarch64";
kernel.variant = "nixos";
};

View File

@@ -1,73 +0,0 @@
inputs:
{
config =
{
nixos =
{
model.type = "server";
system =
{
fileSystems =
{
mount = let inherit (inputs.config.nixos.model.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 = {};
};
};
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 =
{
model.cluster.nodeType = "master";
system =
{
nixpkgs.march = "cascadelake";
networking.static =
{
eno145 = { ip = "192.168.1.10"; mask = 24; gateway = "192.168.1.1"; };
eno146 = { ip = "192.168.178.1"; mask = 24; };
};
};
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 =
{
model.cluster.nodeType = "worker";
system =
{
nixpkgs.march = "broadwell";
networking.static.eno2 =
{ ip = "192.168.178.2"; mask = 24; gateway = "192.168.178.1"; dns = "192.168.178.1"; };
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 =
{
model.cluster.nodeType = "worker";
system =
{
nixpkgs.march = "broadwell";
networking.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; };
};
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 =
{
model.cluster.nodeType = "worker";
system =
{
nixpkgs.march = "broadwell";
networking.static.eno2 =
{ ip = "192.168.178.4"; mask = 24; gateway = "192.168.178.1"; dns = "192.168.178.1"; };
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

@@ -5,44 +5,45 @@ inputs:
{
nixos =
{
model.type = "desktop";
system =
{
fileSystems =
{
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";
nix = { substituters = [ "https://nix-store.chn.moe?priority=100" ]; githubToken.enable = true; };
kernel = { variant = "xanmod-latest"; patches = [ "surface" "hibernate-progress" ]; };
grub.installDevice = "efi";
nix = { substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ]; githubToken.enable = true; };
kernel = { variant = "xanmod-lts"; patches = [ "cjktty" "lantian" "surface" "hibernate-progress" ]; };
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,16 +52,15 @@ inputs:
wireguardIp = "192.168.83.5";
};
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
waydroid = {};
docker = {};
};
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,24 +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 = {};
networking = {};
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd.sshd.enable = true;
networking = { hostname = "vps4"; networkd = {}; };
kernel.variant = "cachyos-server";
};
services =
{
@@ -37,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; };
@@ -27,16 +27,16 @@ inputs:
};
grub.installDevice = "/dev/disk/by-path/pci-0000:00:05.0-scsi-0:0:0:0";
nixpkgs.march = "sandybridge";
nix.substituters = [ "https://nix-store.chn.moe?priority=100" ];
initrd.sshd = {};
networking = {};
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd.sshd.enable = true;
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 = 20; };
frpServer = { enable = true; serverName = "frp.chn.moe"; };
nginx =
{
@@ -52,23 +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" "api" "git" "grafana" "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 = {};
sticker = {};
};
};
coturn = {};
@@ -78,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";
@@ -87,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

@@ -44,10 +44,6 @@ xray-server:
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 +87,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-06-30T10:43:57Z"
mac: ENC[AES256_GCM,data:Mg/DZghIkaWM5KEjk5zg3S0L5qPa8/rkc2ooSjA1ewzbDhTKls2tzv7fQqLx2WQtcJiKkoVx22UkiL0AzBwJdCr3473vx93ajTVK9HNu3jqXmuzSiv2iVS21EX9tyBNiL6uWlVAtlVfMMs69PEUF+EJIYY5TkVVPaQjzEebwo5w=,iv:tFON7RVSnNNHo5U4dRuMGDhH5iPGShW9uoda+apiIjI=,tag:3nG/u7vaChFBHoDsLLb23w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.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,30 +26,34 @@ inputs:
rollingRootfs = {};
};
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 = {};
networking = {};
nixpkgs.march = "broadwell";
nix.substituters = [ "https://cache.nixos.org/" "https://nix-store.chn.moe" ];
initrd.sshd.enable = true;
networking = { hostname = "vps7"; networkd = {}; };
kernel.variant = "cachyos-server";
};
services =
{
snapper.enable = true;
sshd = {};
rsshub.enable = true;
misskey.instances.misskey.hostname = "xn--s8w913fdga.chn.moe";
wallabag.enable = true;
misskey.instances =
{ misskey.hostname = "xn--s8w913fdga.chn.moe"; misskey-old = { port = 9727; redis.port = 3546; }; };
synapse.instances =
{
synapse.matrixHostname = "synapse.chn.moe";
matrix = { port = 8009; redisPort = 6380; };
matrix = { port = 8009; redisPort = 6380; slidingSyncPort = 9001; };
};
vaultwarden.enable = true;
beesd.instances.root = { device = "/"; hashTableSizeMB = 512; };
beesd.instances.root = { device = "/"; hashTableSizeMB = 1024; loadAverage = 4; };
photoprism.enable = true;
nextcloud = {};
freshrss.enable = true;
send.enable = true;
huginn.enable = true;
fz-new-order = {};
nginx.applications = { kkmeeting.enable = true; webdav.instances."webdav.chn.moe" = {}; };
httpapi.enable = true;
gitea = { enable = true; ssh = {}; };
grafana.enable = true;
@@ -60,18 +64,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; };
docker = {};
peertube = {};
nginx.applications.webdav.instances."webdav.chn.moe" = {};
};
};
specialisation.generic.configuration =
{
nixos.system.nixpkgs.march = inputs.lib.mkForce null;
system.nixos.tags = [ "generic" ];
};
};
}

View File

@@ -4,33 +4,39 @@ nginx:
detectAuth:
chn: ENC[AES256_GCM,data:Gk0TTbnFcsvIgoDcen6B8w==,iv:kvyvygw9zDwaiTQ2vPFTHQex0EWDFg8M8U22AConQFM=,tag:ewAZ/nXxmTOhDAjW/A2OnA==,type:str]
led: ENC[AES256_GCM,data:Owax7cyp,iv:NCEKyicVCYZNgxJzlO90heUmwPjfXbZEcyXX09XQKI4=,tag:WMTCVMVCD9sJgAhRUsqvYg==,type:str]
chat: ENC[AES256_GCM,data:1HJiO1zU5SX4G56oWxv5zqGyUqnBWByrtSnQ01wvmZ7PmRkrV+DV6StMg5DtJR9HhkWYnbXlbnBHzP+poPUMag==,iv:sfwI62nwGSnsdj1RyADWgXvp5AY+9RQdtSooxbKFWTs=,tag:pN/LF0mo7RXWoIPPzzs8qw==,type:str]
maxmind-license: ENC[AES256_GCM,data:9aW4QR3K6S+eTqzIjVlNEwkG0wZ4u5jgRfe7CMwRlJlK4AmcS6c45Q==,iv:cPTN1K4Aag5sohGbCQUZHYTvcwAL7AhF+rrY3OvXGPs=,tag:d9GGUMHnfzRz9Cf2U+dBfw==,type:str]
redis:
rsshub: ENC[AES256_GCM,data:uPnZIjbnRRoWIHlWkZNZkMpIb3Ujnnpb+AisVSVGFv4sfDAuDlAjt39pRdnWkCXJPqtXjJzQ+FeT34cqxTf8Bg==,iv:/jcyAHkxByFnbkmCAYQwda2QRmhW7L/ICoLuCgsVLCI=,tag:M5Q+dh/Bn7FiNpqQGYus4Q==,type:str]
wallabag: ENC[AES256_GCM,data:WkiqS9TOHxYalDp7Ssgg2x7vj4D58psQ5au4a0e3LZBecERwzUKmrhbVKRuDvNTwWbYxSds9SAca0wN+pWmrmA==,iv:QqHlzSXG1I4+p8wd58lcQs8TqAF3foxiYVdgL8L3IpA=,tag:CPtFgIeFL5W25gtd6NFkrg==,type:str]
misskey-misskey: ENC[AES256_GCM,data:OHjt9o+m++NT5aaFbwBT/wSMdUdgf4zscd/JxjCo5HDhC3WeWMJV7z//kATI5Dg4BWAhvPlL02Vrly4RraIzLw==,iv:sQB4/D2SsOuDR3bTrmlNg7o+6ehFznDsqVc3BX9pK20=,tag:tcwTBt/JhyW8ZTAIWIkWBA==,type:str]
misskey-misskey-old: ENC[AES256_GCM,data:amUqMycdXUFvjg66pXKnlZqiESBYMci0k8iYzj824SaEqHl3Nq/I0TjYX++xEUg+RGYyTIcSaj96HUANTKpc1A==,iv:ND1mQLHxltRlOdpJ80ywheGo6hkl7OgRyk9TguJMuTw=,tag:dhCCwnCOnyT2iXdEMK0szg==,type:str]
nextcloud: ENC[AES256_GCM,data:jwN/CqwkU/5Rd6w75/bV2Yej9b0CoxZaiJEcZXFx+9XUPY3Xg1tQdEr1SALG8xzOEdoL6WBVs14NvrrL25GeTQ==,iv:p5+0AB52QqScJwMhNIrM/7HAcRPdD9Z8xV6uwIDOwIg=,tag:f1XbNDDRXvGl/dkV9Wp2Ug==,type:str]
send: ENC[AES256_GCM,data:IGxj3cgp+fQBdupfK+IgPEQSPuXdM9LRSLGSATNIkzUWC6sQw1aaKTDuRc8cU2BG6quthRwuWnK/F7k3KrUi8Q==,iv:LI9MkaF4e47FPUyL7AXZpO+CdgF91ScdiqjrE8PZjJ4=,tag:eNugln5M0AhU1xmVWFN7Aw==,type:str]
mastodon: ENC[AES256_GCM,data:E5aMRzqd1dqcw66uZwWoT+LDH30mg1vZjk3lhKIXKPd36MANE6z04aBPcAHyHT71jEYsect9JXagC4MUJBuSSQ==,iv:4IjTTNSTraL33fInlTkB2ZylcEaaKi5pgvugZIk24e0=,tag:32JSTNpF2cxYh/NEAS6jZQ==,type:str]
synapse-synapse: ENC[AES256_GCM,data:8CVbcN2FG4mRT4PnlOGsS7tDfS+6ojIJFvq2EwItxn1gg2Ghd/Bmx+5tS/Do2FrYp/Xiv1EqucomM50r5bXnmg==,iv:TT7zBKQ4M10XYVCn5aeSu9IqjrIEHHazPUCOTmgRAU0=,tag:0+Q9hZMBVDj1TnHj3xoTBA==,type:str]
synapse-matrix: ENC[AES256_GCM,data:eJ9GXDVLPg1C+Zjpj3NnWUyZxDbOZ61f+gs/bkZgdWjeu61MEMtU/Hh+p/ceAn3y0aPi0ZTcd+zSgIPIkcj+qg==,iv:uTdS4uguNJErc+DDW4H6dsRFkqlkHtaCfR8LR/d9nvY=,tag:UhY9xbe1r7FUpyid2nSt5Q==,type:str]
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]
mastodon: ENC[AES256_GCM,data:IQxoNjZILazu5cxkEzFAqqmGSsOffMQHoRB7AC2NqI/+CJSVsfdwiSVfxN+Jc9dmrqCjscUSxaWCMHnrZj/JyQ==,iv:d6tyj/w0uH2E3qHjEcopVhnmE/Pq0qN9PHthSArryyw=,tag:kfJsxqkErFcG11B0CmiIKw==,type:str]
gitea: ENC[AES256_GCM,data:EAuFPlUFvtARh4wbevoIUwZ886nS+3O9Jy7q/SkaTDx7PkQKGhZcPPxY45AG0QQrjSaI3cGLzDBMutFMXP0BMA==,iv:0cLOsopAfyMLHJDowyZirVR5nqLrjSLHYtnPC8GXReE=,tag:BwG5UibGLS16rwJbH/0ZyQ==,type:str]
grafana: ENC[AES256_GCM,data:ZLtDIZ3oKasE4r1WNllNe/rkXxqRS+QAJI7EGPKhiFF1BtAxD46UpGQnUag3yg0gP/8+3COQs6camVSxcKFL1A==,iv:wMj3keVjNpVwNMwlt4E3ds1EYjLNIZ/S3RydhOlmYWU=,tag:ZRn7NWaUPbf2rHYLoLYw+w==,type:str]
akkoma: ENC[AES256_GCM,data:6piRt7BbMBLVGdot+VyoJN3/S8DoPNTYHFh/1coHSLNmiA6kU/6sca4Bts1Up/Vu164oTsFAr1JsKx6tzNzAPg==,iv:qplA1GXHwzVrmjm7eagCk3PFa7DRdwaf+p7N1HLb6mw=,tag:W6WedSK3R1IgZVo/0Hr9vA==,type:str]
synapse_matrix: ENC[AES256_GCM,data:5j+TYJ3vYUqu6CdRDYAT558DsTWbX4Rh+HuukPog5HGXlhneL3RnxVeGBR9CV1rlCP1NY99Nm8roBG+BcyPYHQ==,iv:CboB6lzqxAE/8ZlzaTU3bxw94N6OAhrq8pZ0AfxQiUc=,tag:z6cM3ufgbMn5n5PzgqdRjw==,type:str]
peertube: ENC[AES256_GCM,data:dLzOez3dTy0NqHED1Oc43Ox2AFuH196kxwOSuR6RejUw3iJuzEQCdmA/i+70zHoveAYBdPCGpM8cz0y2M+usjw==,iv:KxDqmbNBkJ6Nw0M3060L9ESDf2qAur7umlejcDyRmwA=,tag:RScP7Cny8b1Z1/REpk+daA==,type:str]
vikunja: ENC[AES256_GCM,data:syb4NYBxL3DdmZmcC+em0klmm6bkkIL/DH/gnzShYRiaezRFskT+yay9govn++SpbuvkoCJq/GYAFxNL+hcVtw==,iv:TQUgdzYQ0gqsAmux9v3BAQFNzHnCTZ+X/OC0b9Bfya8=,tag:b1AsiAW5XzA3DzGdf8J03g==,type:str]
rsshub:
pixiv-refreshtoken: ENC[AES256_GCM,data:EeSOTSAAh+1Dc8+a/AaPJ0aBK5DTa3pdS6DrIMQmRw/n0SRu2QoynIF76w==,iv:dnZxi8jM1I4w3C2duYielpP/8wOAdHDjcqDIrowM0dM=,tag:8irGvLEbRJHV9TB8Jibs9g==,type:str]
youtube-key: ENC[AES256_GCM,data:OEm/ynOUPUq7ZEVzL2jgs9d+utkLTIdNq0MHE0JDujb9ndAwyJJI,iv:RRae6Cg6GdDnXAQOdtBYmcA7ZNuu70VpIg2MEezBn5k=,tag:gX4ZG345cT3Jh3ovUxtLGw==,type:str]
youtube-client-id: ENC[AES256_GCM,data:dPo4+HsfXHdxrgF9F0qJmOGcSHDCn2KIkHx3ZYZU94iv8ImiPI9dTRfoz0zq8UIN7rwIKidQu9GxCRrg9aXk34pc35SXzEh8JQ==,iv:ROVHb0QjVsNae9eJevG6qc5dc4gkrGt+Y7S2QYrzmQ4=,tag:Advoh75OKPC7CnIeL4GFbA==,type:str]
youtube-client-secret: ENC[AES256_GCM,data:c/ALpo/4qJdccMgYiSLg9ZgG7ddaMYxHwJYZ/ogJN2ED21k=,iv:CkrIq+Vpuq28CsRNwdKRLnBq6L8NF37y4xhhnmHQHqQ=,tag:SKtHpm/QZWnGViDtSKlUUQ==,type:str]
youtube-refresh-token: ENC[AES256_GCM,data:pnXQ1euCdix2H7IxudmUUcpxc2OUhciKT8OcGV89c/EpoXHgx1+eLxwY5rRszroWwjge9M001RGHngvD/ny3phfWAwYmIzMJxun2f7JCPe7ybMesWmPSkiqVBss1Zfic1uB8mNM/yw==,iv:8p8/vATY8F3YuGA1TtjekiuaKOMnQyTMjrwDBJaK4VU=,tag:/jVg9FDOuLMNrupgrywpBQ==,type:str]
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]
synapse:
synapse:
@@ -39,15 +45,16 @@ synapse:
macaroon: ENC[AES256_GCM,data:2/8GuF/a+ocVtLN0PU17JDvXw/RoXX/CXFHPlI9THl5bY8lBm6tEawijnOKVoFLovfU=,iv:GPAr3ZjqLf9ixevsZoQgs4cPkv0VL4WJoFfQZOdThlw=,tag:HRt/igDEfUJ3K39mG7b9Fg==,type:str]
form: ENC[AES256_GCM,data:Z9cYL9ibRWmOhAYtB269n0cWZSvL4zGgc03ZRag0m8cz2j0god/Fn/w6kx3cyGK1C70=,iv:Yst6WSV63IvbMF5nnicIoBj77eSwVMnAHtHrKo2UcDk=,tag:4qf6F2rdctcCf4J9vECvYg==,type:str]
signing-key: ENC[AES256_GCM,data:BbPJiNcVTqMAL2XG3K3CIbsb8EM4r8ct/WxPK10FHRwAnqChKy3CAviYU9gewO/tNZXHvUYUAUbPww==,iv:IZB/40EE3DIxAqagdH/a4kcSmiec5l24XLCQKCQNaRo=,tag:/1t0WAPBYmYrPTx4V4wgkw==,type:str]
sliding-sync: ENC[AES256_GCM,data:POXExkTRRhXin4lD4MA61xsuzYXCT6U7QtQWtNnEb6kUWRrAvS9mqk+JTBn3onCzf2Azhi3WQOY/t+OiQFXI1w==,iv:GJfJSGb6t/q9KdVCr0dVVcD+e0yZUQzrJrtuhOlYJIE=,tag:ovd1ZXRkk7VoNo8KoYDViA==,type:str]
matrix:
coturn: ENC[AES256_GCM,data:MwZKkYMefshuk46Cne4wn9ooFH8RCDbrxp+MbLJWli9iPHuzJJzUuQNU9EDL0aNbzyYEMt/7DErw42z6KrpGww==,iv:u/SVVTgfJO2FakiYU+uLHXjA4tHU/W6ASsR3S31+pWs=,tag:VTeKNOKwm2bsiZAOVXeBOQ==,type:str]
registration: ENC[AES256_GCM,data:+pA61vTg12lYUyXjLrHSY7y/ExfTQffLlGUI4HBOSFFPTck7bu68FrCaHOIBTtEMfjU=,iv:Ex/phkBZxglG8HiRz+m7h2HNanpq2Pxwbm08vdM3xFc=,tag:mM3YEa70FnCeYIUthK4TeA==,type:str]
macaroon: ENC[AES256_GCM,data:/+RaayKiPPpVV7OWWdaSkSSRHMjb8d58lZcpvltN9cYkN1btvMViEgdLSlfqzRRlPUE=,iv:pg9GXgNsrVWKlUAiCKZ2pYXugRH6MsBIMpHKoYWYLik=,tag:/mj5Ak7XAX/FH7sNPEVALw==,type:str]
form: ENC[AES256_GCM,data:7HF7HMUH1BTJgXXP6cpUiVj0jCwGW57bx9wKTJu7PnRsNuAam/+nKX7Zfg7WD+gSBlA=,iv:SYeUsuFVgAA6U6STCtKT5c5E8Kglh3x7hy6+Op4n0W8=,tag:eICmHTwwn0KcgNhdDGnusA==,type:str]
signing-key: ENC[AES256_GCM,data:hzxxDbGp1L09O7+ueUSa5lJOY/QvF2zvHdpueEHjaPQEToQt9mr2loeTQHC7ObTegfLb9UHrI1jn4A==,iv:KngfahwYZZmDQ5LeOUPWptTMGAC8TZm1G0FWcrwCwsw=,tag:U9pW6/boBIpiswn67Ezrfw==,type:str]
sliding-sync: ENC[AES256_GCM,data:BeA6g98IWDP6hnLFI77QqG6esDwB6j3OPzAv3eJxWoTajAsByHSgSYP1vHN5Iok6IgvSSmkf0/HiOJy1Ca8IIA==,iv:ca+t/rYwc/fAVUcz0JTmrRQCOcbDNscbnE8BpHkx/OE=,tag:eEfhUChUt4kRnO82XqRY4g==,type:str]
vaultwarden:
#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]
@@ -61,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]
@@ -81,11 +91,20 @@ fz-new-order:
username: ENC[AES256_GCM,data:xWP1cesh,iv:11KFZ/J9PScz/oW2+H5BWgw0+ETkCXlcYOMuPpgjEs0=,tag:HswEVzm6ElRjIDsZyEfZcA==,type:str]
password: ENC[AES256_GCM,data:Da/E7ZeZ,iv:gIoheXeTErV3+CtZSEDsX7pGzRahHWlKYQ6QZ6W2eu8=,tag:0oQzQ5DJiS2hqMQfU6JRWw==,type:str]
comment: ENC[AES256_GCM,data:etfZKwbh,iv:XqqF3D0PpCPd2Q/CCu/PAH4SrvXAOu+lIXvSht/KfKk=,tag:7jyG33foxneRK2wvI/5uBg==,type:str]
gitlab:
secret: ENC[AES256_GCM,data:hBax7ClSuttBacykKw42pvrvowZW8OeTry/0rkmy5BHyLM7HllNYCOw+tupIOdhVEfgJPWQeBeGuyFHt7lPRWQ==,iv:zOM+eMW04Z9QkTchkAXWYHg2eWTQmGEs/dHtUnvNVd8=,tag:RzLyecuASl9CcmQSuabN6w==,type:str]
otp: ENC[AES256_GCM,data:Hgq5Tyq+BUTsexVsjFWf07fY0znPL50+qIm+fhuVljlauXBZouQjJKMhqTs9zhLECOktYUtp0wrNa++nO1Ys9A==,iv:Am51j8QjDtldtsZL8uCu0I3pr/SQ6R8KUQinznZjClg=,tag:hbtrlG0MGNL3VcbQUG/irQ==,type:str]
dbFile: ENC[AES256_GCM,data:AKxE/Z4jooDlkIl3WpQZIlN+MLxlZ7SEWVF12/8f9aq7LtVl5B0RDA6bZbeM0PU8h4eGcSX9feSpLIVpvBAQxQ==,iv:li6hBLw9filwVVXa01oICtvY9UJsMgB+3XYOgZyCTnY=,tag:wC18TzVMM+dcpIi8wwCcIw==,type:str]
root: ENC[AES256_GCM,data:nPO4MT7BWuCHnWkbHPRYygMpieGsni4+BQs6HVwxBqH5KuD0O7I3PQlcgntxb4kWbqvyWstYW+k9LdscSEzgXg==,iv:fgfW8BljGlOIQzGK+UiEFcT6Hp5ieA8C86kwT8xRlO4=,tag:eSWPda0NYBe47uVYCOUiLg==,type:str]
grafana:
secret: ENC[AES256_GCM,data:QYhopqGcHGr+24qYlfaTdMtnyzmIZYG4PcvS9KYqC24W3M+HmloCkPHh7Y3ZTVg8MnrDGOcbA9YPLdY7eh/u4g==,iv:dh7egVIem2bgDbmWJ1sqH9fLdIYbAIQjnjNvyuEjVq0=,tag:DbIRVHbCcpKGcNc6sDTasA==,type:str]
chn: ENC[AES256_GCM,data:0bbjggWS1MdcUIQiQyPlBTULm+faKDpJbmZmV6vSw8k=,iv:am65WQzUE+AvQrQV+NSF5u6RCWn7EetyPsdy4Cuvyyw=,tag:lxNUM1cIYVSXVgwEnS1Hdw==,type:str]
wireguard:
privateKey: ENC[AES256_GCM,data:TS+toaJRgAvC78XVwTciXe2IG8++vaqXVCi/u/8Aej6qq1B9Cb6f20cp5K0=,iv:T/NkLvcYiWzIDG3jWtuhe/sH2GT4z5f0xdUGbSL901I=,tag:qN7YokFBj3Kbbx4ijHTRnw==,type:str]
vikunja:
jwtsecret: ENC[AES256_GCM,data:p6e22qPJzTGB21oWhSr8AA4bfrele9ZOHVtZ8BHgX21IhoKdm58coGtSX1CGXR7J6+1/74RdLY9K88nGrM1F1w==,iv:DGUO8rhf7Lg9dTqSmzlR/Jd2K4oUjO8w9E5bihwsykI=,tag:SpX6UI0QIju/tC1fIL9CCg==,type:str]
chatgpt:
key: ENC[AES256_GCM,data:bkLxKUqkjwpUeqeAZCaAgKiOse8QtZ0zOn9TQNA84+B3rxNiTFPisI8=,iv:Zd5dO5Sdt4HCvNZgS2K0FjJAzti6oE22vahYQl99TrI=,tag:E3o+X84tRsIEGU9Jfb85JQ==,type:str]
telegram:
token: ENC[AES256_GCM,data:Mr6KrAzYoDXA+dPT3oXqK2wm9ahTjZ5GVE/iRPsmcM+S2MABT+8ramyHz9oIFw==,iv:nIZ8rpSxz2GwMbDQFfG3xauMQjiriZ1oxFMrEQeH7sQ=,tag:y5U1T1vV/mmdE/CeaeTR8g==,type:str]
chat: ENC[AES256_GCM,data:8w/0EI64a1dC,iv:dHu9JHcUY7QPd9YBKXnrRXQB2K6jpnLrSFs+1IJmkio=,tag:3ucN3uNnBxxRF+cbLsa1nQ==,type:str]
@@ -100,9 +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]
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: []
@@ -127,8 +143,8 @@ sops:
SnFHS1Z0SXUzTFdEd29KTy9DU3Y3R0UKfhh+rUmWDrf+UGjclP57dHipPLFoXSqy
HdelmfV6q4/c7ppx2E+oZw3VNgoZCsrxxzYZfwxHJiZb+5vkE0D8iA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-11-13T03:06:27Z"
mac: ENC[AES256_GCM,data:aIgKGuyrNWt2etXCtqHXxXwLSTkGhX3wk9NcHXv4u/rkZ3wUz8iJv24whMIN+ZFhQmNV1TLuPncd/O6bYra1YmG0FXSyBkgfQdVbCAR7ys1yXpdz00zcC7zMqm3CeNui89DZH27P5z6cDtNG4Z/dLz6lpln/ummYcdcb+/7KbZQ=,iv:Gl8turVRflUOB3PWqLfwU4JPoy0k9zLKir4CKB9628s=,tag:aJ8PDOfn/XBeklIlSkC2vg==,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.1
version: 3.8.1

View File

@@ -5,7 +5,7 @@
* 显卡:
* 409024 G 显存。
* 309024 G 显存。
* P5000: 16 G 显存。
* 2080Ti: 12 G 显存。
* 硬盘2 T。
# 队列系统SLURM
@@ -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

@@ -4,18 +4,16 @@ inputs:
{
nixos =
{
model.type = "server";
system =
{
fileSystems =
{
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";
@@ -28,6 +26,7 @@ inputs:
swap = [ "/nix/swap/swap" ];
rollingRootfs = {};
};
grub.installDevice = "efi";
nixpkgs =
{
march = "znver3";
@@ -48,15 +47,19 @@ inputs:
forwardCompat = false;
};
};
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 = { "2080_ti" = 1; "3090" = 1; "4090" = 1; };
};
xrdp = { enable = true; hostname = [ "xmupc1.chn.moe" ]; };
samba =
@@ -92,11 +88,9 @@ inputs:
shares = { home.path = "/home"; root.path = "/"; };
};
groupshare = {};
hpcstat = {};
docker = {};
};
bugs = [ "xmunet" "amdpstate" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" "wp" "hjp" "wm" "lly" "yxf" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
services.hardware.bolt.enable = true;
};

View File

@@ -15,21 +15,8 @@ users:
yjq: ENC[AES256_GCM,data:ua0DINHutjt2Pk+SfHRQRV99mT3Cnw6rRKO8VRIAlP0dY6QhK9wkNdyRYWYRBKVrWgyFQMGNFYAxIpymjF/X7mBOVI2sOHLgkw==,iv:PUZ6S0KICuqoSA2sDLxdL4gtAOQnQXOUY+5f3qDZgpc=,tag:f39P34vAUOrV23BsKkRarA==,type:str]
#ENC[AES256_GCM,data:6qNjSdjck4Vz,iv:c/GNqCNgRgwgL+2f6Vumtjb/ub9WCBSy8R02NRCDqk8=,tag:b/tucJsHTjSfcK0vgHtE8A==,type:comment]
gb: ENC[AES256_GCM,data:3eAKBiJoC1owCHTFd3Xq8vI8VK980evePc92xCXJJ21M9D1MdbwN8ySZ3Ovjk7VfQmEo8oRv1Ll1sftyrXYoeTHmJsNDxCpR6A==,iv:Ju/ERNuGrgO5kYlbvmkbLJkgiW3Elou34AsJTFITCUg=,tag:POVlxYh9kZ1BMSbt97IVOQ==,type:str]
#ENC[AES256_GCM,data:/2y613pek/CO,iv:gqSh74Ac0BxPdO+fOsQ0K8t2YduwyTVOjMq/A5Wmoz0=,tag:jLUYXu7f27FruwH5rUUZSA==,type:comment]
wp: ENC[AES256_GCM,data:3jeHpeu1YlFhK2+o19q2/JyJPhZFivPbUQzJJbJZ15GzAVh7i1VsTSN31LufXAgsC8KjZHAPhEZlGYvnGpCvPzoISQa5NVAJdQ==,iv:bL3ohgbjA2agFKDwgw0H3LgiHTWB4Y5KlQAtHfEMr+w=,tag:SfLtj7iDcmV3dgOlITFvxA==,type:str]
#ENC[AES256_GCM,data:YIlY7n5pcJTp,iv:Y/+ogxaMgSl0vcMPRr3qdSHjjnnhY+N2Q6jFojzIDyQ=,tag:zat02jxJ8jI2uk8noslmHQ==,type:comment]
hjp: ENC[AES256_GCM,data:Ii4P9ZsUOEh3cqt3AKWlgUH1CMNnmHln9QNWdTRR3vZXkkR5j5qKAIrAltml/i3xFlt4hftYNufnupog4UlAVWQJhYBlhCSE4g==,iv:eKWmUcKItjd1dsvVP1se5CAhIFqV/eVH03gPJhBau1E=,tag:ZTE0BTSoDpJGqECklGjs2g==,type:str]
#ENC[AES256_GCM,data:hCgqHfpmeJ1Z,iv:pEKUNxhUyNAVtniTIQ2IpMPmXr2O+twq2/3Y2lIoqdw=,tag:RTqcI0XCoOymQD3r4+yS9Q==,type:comment]
zzn: ENC[AES256_GCM,data:/CSffToFJiBotXZ5rPkz0UNgI/iC0ftusPF2Ce6Of3XckjpCcikWj6n3ahJ24XsWQjp3EvacOiBorh+Kg16LjCEl0P2RMIitTQ==,iv:u9IFdp/jw7ehTshPzQVssLeh33iBYCPjSyJSLsc5EVo=,tag:/KXgmU7dcTKG8C4Y7NcMhw==,type:str]
#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:
key: ENC[AES256_GCM,data:POK329h/joF7WdSBwSE1EkYH/pZ9X+wiTKcVWLZjmh7gM9d7HONbN/PqsYNFTHJVR0GgysqpLEcPN2OFGs/SSeH86o04cAdjAVznKZgt1Q34QGYy6b+io15P3lbmK0kTKmeGt5qEhGkBh6BVBoSyqbKAknvUqJ17ZkL17kyRaKffm3Zais7keEJCFdyRF6oSz2kl2CvEmKNWPWDdO9EpgqgYlm9mwu95/k9Hx5eyUjiFpxc3fdFTESGbe0ZYAqKQ0eLFfLLorQp0pAzxCbbxIzZEgyxjzkICXKa1n7Zz6h1ON2Rsqq0Q4hEYJdWGLtvOH/VLVxvNWjW4Er6i3lWGhZRiDDrxLErQGONI+X7QqbneFCnMCZGln3pAfNtOr+KX58ij/egyzmb7bKZrARqnm+X+/I/L0+VS1PfDdLP53GaX7mfKYpcH6z7O2F/zjpuXQTV8njs64YlvgyYXsCaghEUBzehsruwRsBEkTIb4R2AlqItpbesMnNNUJ4Cr/B7Bw6O+gHeJ+oK4ZPBYbgso,iv:B2eWjydl8m8nbcPw2fZfxCnj57utWM9ABj2eJ1pRKWQ=,tag:5W9ZwVSJvm1KvZnf/E5Tug==,type:str]
telegram:
token: ENC[AES256_GCM,data:Mu7guAFUu+UoHvo/h1blcI6Kg3mvng6zNc/HKXuCdf73ujziK0mXwPcf7t7d/w==,iv:BkA4d0OJ4lTD7csZJQHcDnYe7SYcFbwRVYOQAWOQ2lQ=,tag:GuJ4z5pe2znTY3xNT2WF+w==,type:str]
chat: ENC[AES256_GCM,data:OC8ElUPmfsVL,iv:WgZMJP2ugZbqZyihdNtL1xMH8u9VpLNzO8DGpDL4w4k=,tag:u4cKABikuMUbCIm5zCnk6A==,type:str]
sops:
kms: []
gcp_kms: []
@@ -54,8 +41,8 @@ sops:
ZDNHUjE2QVlCV3p0NHdKYW5IMHVBZzQKkZtfyvfroOntg3yRjMw4jQHiQj8eaB2h
IeIHfW4y01mmVT2ofbtB0xYpjcl4gtUlQ8X3tn5iJ9P8gcVo0G598A==
-----END AGE ENCRYPTED FILE-----
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]
lastmodified: "2024-05-10T08:53:57Z"
mac: ENC[AES256_GCM,data:ImxIE0d7cEpudUKGs9zHCMFKlHYwFfztLWe5ZMWOrQxr7/uRxfCsiIvuU1nRri0jx2x8J6EFAG1BdrF4KRSeW5sIB9Tlk7X1TJ69zSdLhhnIuPl+rSyovoIkMQAJ0Wvyvlgimh1VQyaBkPsjnGk/dga1N0+gIlmiwFKY5uTpaaA=,iv:fo6S9fIDxnp7VWYYWH613U6bxIlDBZaNObkRR3AdgEc=,tag:ZRIMHkWRsf75K3Tg3Xv5xw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.1
version: 3.8.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

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

View File

@@ -4,23 +4,23 @@ inputs:
{
nixos =
{
model.type = "server";
system =
{
fileSystems =
{
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,25 +41,19 @@ inputs:
forwardCompat = false;
};
};
nix =
{
marches =
[
"broadwell" "skylake"
# AVX512F CLWB AVX512VL AVX512BW AVX512DQ AVX512CD AVX512VNNI
# "cascadelake"
];
remote.slave.enable = true;
};
grub.windowsEntries."8F50-83B8" = "";
gui = { enable = true; preferred = false; autoStart = true; };
networking.hostname = "xmupc2";
nix.remote.slave.enable = true;
};
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 +66,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; "p5000" = 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" "lly" "yxf" ];
user.users = [ "chn" "xll" "zem" "yjq" "gb" ];
};
};
}

View File

@@ -15,12 +15,6 @@ users:
yjq: ENC[AES256_GCM,data:sGPQ0xALULREnhzl9g/V91M5osMglsSps6R4gYn5OZc/4xVC1phF3qajVN3YMOr7kKgkHbF2Rjm6/2vuK0k1iYZnFswUAmFlmw==,iv:5vG1hn7SlX6HCpas2BgxBSwWqLby8OCxcH3EKNvceIc=,tag:TVwFBAuosKnEOZecq1phXw==,type:str]
#ENC[AES256_GCM,data:ALHxkRABA+ll,iv:r1IDiHLFcTdLID3q16zrLTavAwQfddC7bXMKcFZFveI=,tag:4Pd0/Q1BmH4gJjaM4hbqqQ==,type:comment]
gb: ENC[AES256_GCM,data:z4CrtdmdLJJ0qZzr7qvihnluJQgjtciX56KdEmtemiRu0llEJk9qz6a23aJ7m40Sfc38elF1/LsvjOuBOC87+BVkKDCj76phag==,iv:WrFVxkr3snmqDXZx5kAYCLp7ixEIzxoT7El3rV7Ovqg=,tag:iExf2Y/HObHQrKMTRvqn7A==,type:str]
#ENC[AES256_GCM,data:XfNExliq7noL,iv:K+rFlZHF1oY5rsTzaO0mgxiE1VlKdtPTifAaesg321k=,tag:Dja8NmPWZdJkf/J/96/wAw==,type:comment]
wp: ENC[AES256_GCM,data:yjMDez28pJUo6riIHypQQgjGFbuLwy87eG4ek/+Li2w8b4Cm5JckRvs26o+S0blfICc8WqIqEJGakT2wVBE5O1jGfniKn3PhTA==,iv:dOA318XRd2EXxmTIlk6GhlAR/FBpbKkbPJJCXTwFCxM=,tag:9MkXNUuAoplAzE+4eJpr0w==,type:str]
#ENC[AES256_GCM,data:YGcTkNCeu3m7,iv:jYmVrfRFwQoX1XxeSzS23wRMAD/AnzYBXQjI76Ke2FE=,tag:WJfSmjdggzPojDcJ6GzP+A==,type:comment]
hjp: ENC[AES256_GCM,data:0R5SfBFKuLGurwINnTj31FOrwwfY9bqVS1rG/a0HqIYd+Ui8/2ffFBx0Et+tYIqcxXEJpGbvse43V0naNKmFKlLanfcy9YV/Hg==,iv:mpAUmcVHWWLoreEsG9ha09jxte8mQCLt/A7nm04iX9Y=,tag:bia9pjL0MAcs9vj1gKCVCQ==,type:str]
#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:
@@ -47,8 +41,8 @@ sops:
M0xoL1dQR0kvMWpzN0RMNWVCTFQxNFUKj9LPjBo5NGOrGYNvu8qZ13PLYjLEWllU
LARzEn4XgkeHckouwvxZYMCx7WxmAruRWaOvnxTIczzSNP7wIrqnkA==
-----END AGE ENCRYPTED FILE-----
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]
lastmodified: "2024-05-10T08:54:10Z"
mac: ENC[AES256_GCM,data:4n7bAGzORwd6vHl/Cs5YT8VZaSdfvxUm6e+fw7PYC2ov8XoRlJKU/Bci8Sbwcy2H6OjbkdRYA61cB2wAjtEY1x9N/c6qvUAOjTvOtcXoQQex8d+aMnJsFfJQ70GHCZE+KRTmy1SAMn+N00Oy0FDisdQe/jIZuWyav5j62CKqLqc=,iv:YEhiXU2IgXy4A0ZLsNY7kFqXJM5RBHE4IZwlRoF8XMA=,tag:aVc0r2g1QkY42NP59p4m2w==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.1
version: 3.8.1

1689
flake.lock generated

File diff suppressed because it is too large Load Diff

205
flake.nix
View File

@@ -3,24 +3,35 @@
inputs =
{
nixpkgs.url = "github:CHN-beta/nixpkgs/nixos-24.11";
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";
home-manager = { url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs"; };
"nixpkgs-22.11".url = "github:NixOS/nixpkgs/nixos-22.11";
"nixpkgs-22.05".url = "github:NixOS/nixpkgs/nixos-22.05";
home-manager = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
sops-nix =
{
url = "github:Mic92/sops-nix";
inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; };
};
aagl = { url = "github:ezKEa/aagl-gtk-on-nix/release-24.05"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-index-database = { url = "github:Mic92/nix-index-database"; inputs.nixpkgs.follows = "nixpkgs-unstable"; };
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"; };
nix-fast-build = { url = "github:/Mic92/nix-fast-build"; inputs.nixpkgs.follows = "nixpkgs"; };
nix-flatpak.url = "github:gmodena/nix-flatpak";
chaotic =
{
@@ -29,10 +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"; };
aagl = { url = "github:ezKEa/aagl-gtk-on-nix/release-24.11"; 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; };
@@ -43,8 +51,11 @@
eigen = { url = "gitlab:libeigen/eigen"; flake = false; };
matplotplusplus = { url = "github:alandefreitas/matplotplusplus"; flake = false; };
nameof = { url = "github:Neargye/nameof"; flake = false; };
nodesoup = { url = "github:olvb/nodesoup"; flake = false; };
tgbot-cpp = { url = "github:reo7sp/tgbot-cpp"; flake = false; };
v-sim = { url = "gitlab:l_sim/v_sim/master"; 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; };
@@ -52,37 +63,157 @@
lepton = { url = "github:black7375/Firefox-UI-Fix"; flake = false; };
lmod = { url = "github:TACC/Lmod"; flake = false; };
mumax = { url = "github:CHN-beta/mumax"; flake = false; };
openxlsx = { url = "github:troldal/OpenXLSX?rev=f85f7f1bd632094b5d78d4d1f575955fc3801886"; flake = false; };
kylin-virtual-keyboard = { url = "git+https://gitee.com/openkylin/kylin-virtual-keyboard.git"; flake = false; };
cjktty = { url = "github:CHN-beta/cjktty-patches"; flake = false; };
zxorm = { url = "github:CHN-beta/zxorm"; flake = false; };
openxlsx = { url = "github:troldal/OpenXLSX"; flake = false; };
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-public.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; };
vaspberry = { url = "github:Infant83/VASPBERRY"; flake = false; };
ufo = { url = "git+https://git.chn.moe/chn/ufo.git"; flake = false; };
highfive = { url = "git+https://github.com/CHN-beta/HighFive?submodules=1"; flake = false; };
stickerpicker = { url = "github:maunium/stickerpicker"; flake = false; };
pentapy = { url = "github:GeoStat-Framework/pentapy"; 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:
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
{
localPackages = (import ./packages { inherit localLib; pkgs = final; topInputs = inputs; });
pythonPackagesExtensions = prev.pythonPackagesExtensions ++
(final: prev: import ./packages/python { inherit localLib; pkgs = final; topInputs = inputs; });
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"; };
chn-bsub = pkgs.pkgsStatic.localPackages.chn-bsub;
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";
};
chn-bsub = pkgs.mkShell
{
inputsFrom = with pkgs.localPackages; [ chn-bsub ];
buildInputs = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
};
};
};
config = { archive = false; branch = "production"; };
devShells.x86_64-linux = import ./flake/dev.nix { inherit inputs; };
src = import ./flake/src.nix { inherit inputs; };
};
}

View File

@@ -1,51 +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";
hardeningDisable = [ "all" ];
};
hpcstat = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ (pkgs.localPackages.hpcstat.override { version = null; }) ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
sbatch-tui = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.sbatch-tui ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
ufo = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.ufo ];
packages = [ pkgs.clang-tools_18 ];
CMAKE_EXPORT_COMPILE_COMMANDS = "1";
hardeningDisable = [ "all" ];
};
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";
};
mirism = pkgs.mkShell.override { stdenv = pkgs.clang18Stdenv; }
{
inputsFrom = [ pkgs.localPackages.mirism ];
packages = [ pkgs.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.model.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.model.cluster = { clusterName = "srv1"; nodeName = node; };
};
}
../modules
../devices/srv1
../devices/srv1/${node}
];
};
})
[ "node0" "node1" "node2" "node3" ])
)

View File

@@ -1,34 +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; };
vaspberry = pkgs.pkgsStatic.localPackages.vaspberry.override
{
gfortran = pkgs.pkgsStatic.gfortran;
lapack = pkgs.pkgsStatic.openblas;
};
}
// (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-V2cnWCyzxwxlOXXTB8Kz4X4VHvu0H/SqHBzPFwlp73o=";
}

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,52 +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;
template <typename Function, typename T, typename... Ts> void for_each(Function&& function, T&& arg, Ts&&... args);
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::for_each;
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

@@ -3,9 +3,6 @@
# include <tuple>
# include <type_traits>
# include <complex>
# include <set>
# include <unordered_set>
# include <boost/container/flat_set.hpp>
namespace biu
{
@@ -49,15 +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>>;
template <typename T> concept Set = SpecializationOf<T, std::set> || SpecializationOf<T, std::unordered_set>
|| SpecializationOf<T, std::multiset> || SpecializationOf<T, std::unordered_multiset>
|| SpecializationOf<T, boost::container::flat_set>;
}
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::Set;
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,4 +1,4 @@
# define BIU_INTERNAL
# include <fmt/chrono.h>
# include <biu.hpp>
namespace biu
@@ -6,14 +6,22 @@ namespace biu
concurrencpp::generator<std::pair<std::string_view, std::sregex_iterator>> string::find
(SmartRef<const std::string> data, SmartRef<const std::regex> regex)
{
Logger::Guard log;
std::string::const_iterator unmatched_prefix_begin = data->cbegin(), unmatched_prefix_end;
std::sregex_iterator regit;
while (true)
{
if (regit == std::sregex_iterator{}) regit = std::sregex_iterator{data->begin(), data->end(), *regex};
else regit++;
if (regit == std::sregex_iterator{}) unmatched_prefix_end = data->cend();
else unmatched_prefix_end = (*regit)[0].first;
if (regit == std::sregex_iterator{})
regit = std::sregex_iterator{data->begin(), data->end(), *regex};
else
regit++;
if (regit == std::sregex_iterator{})
{
unmatched_prefix_end = data->cend();
log.log<Logger::Level::Debug>("distance: {}"_f(std::distance(unmatched_prefix_begin, unmatched_prefix_end)));
}
else
unmatched_prefix_end = (*regit)[0].first;
co_yield
{
std::string_view
@@ -23,7 +31,8 @@ namespace biu
},
regit
};
if (regit == std::sregex_iterator{}) break;
if (regit == std::sregex_iterator{})
break;
unmatched_prefix_begin = (*regit)[0].second;
}
}
@@ -31,11 +40,13 @@ namespace biu
std::string string::replace
(const std::string& data, const std::regex& regex, std::function<std::string(const std::smatch&)> function)
{
Logger::Guard log;
std::string result;
for (auto matched : find(data, regex))
{
result.append(matched.first);
if (matched.second != std::sregex_iterator{}) result.append(function(*matched.second));
if (matched.second != std::sregex_iterator{})
result.append(function(*matched.second));
}
return result;
}

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

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

View File

@@ -0,0 +1,15 @@
{ lib, fetchFromGitHub, buildPythonPackage, numpy, gdb }: buildPythonPackage
{
name = "eigengdb";
src = fetchFromGitHub
{
owner = "dmillard";
repo = "eigengdb";
rev = "c741edef3f07f33429056eff48d79a62733ed494";
sha256 = "MTqOaWsKhWaPs3G5F/6bYZmQI5qS2hEGKGa3mwbgFaY=";
};
doCheck = false;
buildInputs = [ gdb ];
nativeBuildInputs = [ gdb ];
propagatedBuildInputs = [ numpy ];
}

View File

@@ -0,0 +1,11 @@
{ lib, fetchPypi, buildPythonPackage }: buildPythonPackage rec
{
pname = "esbonio";
version = "0.16.4";
src = fetchPypi
{
inherit pname version;
sha256 = "1MBNBLCEBD6HtlxEASc4iZaXYyNdih2MIHoxK84jMdI=";
};
doCheck = false;
}

View File

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

View File

@@ -0,0 +1,14 @@
{ lib, stdenv, fetchFromGitHub, cmake, python3 }: stdenv.mkDerivation rec
{
pname = "glad";
version = "0.1.36";
src = fetchFromGitHub
{
owner = "Dav1dde";
repo = "glad";
rev = "v${version}";
sha256 = "FtkPz0xchwmqE+QgS+nSJVYaAfJSTUmZsObV/IPypVQ=";
};
cmakeFlags = [ "-DGLAD_REPRODUCIBLE=ON" "-DGLAD_INSTALL=ON" ];
nativeBuildInputs = [ cmake python3 ];
}

View File

@@ -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,24 @@ 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(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 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 +37,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, 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 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;
}

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