mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-11 14:49:23 +08:00
Compare commits
7 Commits
e067993a14
...
63c647ceba
| Author | SHA1 | Date | |
|---|---|---|---|
| 63c647ceba | |||
| fb7e9156d0 | |||
| f2e2f34cbf | |||
| 7d09abee57 | |||
| e2921059f8 | |||
| acd2845377 | |||
| b1546505a5 |
@@ -24,3 +24,9 @@ An overlay is provided through `outputs.overlays.default`, you could use it in y
|
||||
}
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
* Write this readme file. Something have been outdate.
|
||||
* Servers in XMU should use vps9 to run proxy.
|
||||
* Allow to specify oneapiArch and nvhpcArch per package.
|
||||
* Update document. Something is outdate.
|
||||
|
||||
@@ -23,6 +23,7 @@ inputs:
|
||||
"/nix/remote/wlin" = "/data/gpfs01/wlin/.nix";
|
||||
};
|
||||
};
|
||||
nfs."nas.ts.chn.moe:/" = { mountPoint = "/nix/remote/nas"; mountBeforeSwitch = false; };
|
||||
};
|
||||
luks.auto =
|
||||
{
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@@ -1144,11 +1144,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1766317807,
|
||||
"narHash": "sha256-HQeHsIrRFllgpmUlhMH+F8cxp/zeODTziEHai2Ryebw=",
|
||||
"lastModified": 1767053975,
|
||||
"narHash": "sha256-Zt1zWeJw0d2irAgC3lOfGgcAlDEUEzWG4kHV6BVhbqY=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "201f7c1ac0c7c455ad0a6660c037f49821160c3b",
|
||||
"rev": "9a8b7c7d8195a2dd2bf130bdcf3326f0d21e827b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -136,7 +136,7 @@ in platformConfig //
|
||||
assimp = prev.assimp.override { stdenv = final.genericPackages.stdenv; };
|
||||
xen = prev.xen.overrideAttrs (prev: { patches = prev.patches or [] ++ [ ./xen.patch ]; });
|
||||
lib2geom = prev.lib2geom.overrideAttrs (prev: { doCheck = false; });
|
||||
libreoffice-qt6-still = prev.libreoffice-qt6-still.override (prev:
|
||||
libreoffice-fresh = prev.libreoffice-fresh.override (prev:
|
||||
{ unwrapped = prev.unwrapped.overrideAttrs (prev: { postPatch = prev.postPatch or "" +
|
||||
''
|
||||
sed -i '/CPPUNIT_TEST.testDubiousArrayFormulasFODS/d' sc/qa/unit/functions_array.cxx
|
||||
|
||||
@@ -54,7 +54,7 @@ inputs:
|
||||
google-chrome tor-browser
|
||||
# office
|
||||
crow-translate zotero pandoc texliveFull poppler-utils pdftk pdfchain kdePackages.kruler kdePackages.okular
|
||||
ydict texstudio panoply pspp libreoffice-qt6-still ocrmypdf typst # paperwork
|
||||
ydict texstudio panoply pspp libreoffice-fresh ocrmypdf typst # paperwork
|
||||
# required by ltex-plus.vscode-ltex-plus
|
||||
ltex-ls ltex-ls-plus
|
||||
# matplot++ needs old gnuplot
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
inputs:
|
||||
{ lib, config, pkgs, ... }:
|
||||
{
|
||||
options.nixos.system.fileSystems.mount.nfs = let inherit (inputs.lib) mkOption types; in mkOption
|
||||
options.nixos.system.fileSystems.mount.nfs = let inherit (lib) mkOption types; in mkOption
|
||||
{
|
||||
type = types.attrsOf (types.oneOf
|
||||
[
|
||||
@@ -8,50 +8,45 @@ inputs:
|
||||
(types.submodule (submoduleInputs: { options =
|
||||
{
|
||||
mountPoint = mkOption { type = types.nonEmptyStr; };
|
||||
neededForBoot = mkOption { type = types.bool; default = true; };
|
||||
mountBeforeSwitch = mkOption { type = types.bool; default = true; };
|
||||
readOnly = mkOption { type = types.bool; default = !submoduleInputs.config.mountBeforeSwitch; };
|
||||
};}))
|
||||
]);
|
||||
default = {};
|
||||
};
|
||||
config =
|
||||
let inherit (inputs.config.nixos.system.fileSystems.mount) nfs;
|
||||
in inputs.lib.mkIf (nfs != {}) (inputs.lib.mkMerge
|
||||
config = let inherit (config.nixos.system.fileSystems.mount) nfs; in lib.mkIf (nfs != {}) (lib.mkMerge
|
||||
[
|
||||
{
|
||||
fileSystems = builtins.listToAttrs (builtins.map
|
||||
(device:
|
||||
fileSystems = lib.mapAttrs'
|
||||
(n: v: lib.nameValuePair (v.mountPoint or v)
|
||||
{
|
||||
name = device.value.mountPoint or device.value;
|
||||
value =
|
||||
{
|
||||
device = device.name;
|
||||
fsType = "nfs4";
|
||||
neededForBoot = device.value.neededForBoot or true;
|
||||
options = builtins.concatLists
|
||||
device = n;
|
||||
fsType = "nfs4";
|
||||
neededForBoot = v.mountBeforeSwitch or true;
|
||||
options = builtins.concatLists
|
||||
[
|
||||
[
|
||||
[
|
||||
"actimeo=1" # sync every seconds
|
||||
"noatime"
|
||||
"x-gvfs-hide" # hide in file managers (e.g. dolphin)
|
||||
]
|
||||
# when try to mount at startup, wait 15 minutes before giving up
|
||||
(inputs.lib.optionals (device.value.neededForBoot or true)
|
||||
[ "retry=15" "x-systemd.device-timeout=15min" ])
|
||||
(inputs.lib.optionals (!(device.value.neededForBoot or true))
|
||||
[ "bg" "x-systemd.requires=network-online.target" "x-systemd.after=network-online.target" ])
|
||||
];
|
||||
};
|
||||
"actimeo=1" # sync every seconds
|
||||
"noatime"
|
||||
"x-gvfs-hide" # hide in file managers (e.g. dolphin)
|
||||
]
|
||||
# when try to mount at startup, wait 15 minutes before giving up
|
||||
(lib.optionals (v.mountBeforeSwitch or true) [ "retry=15" "x-systemd.device-timeout=15min" ])
|
||||
(lib.optionals (!(v.mountBeforeSwitch or true))
|
||||
[ "bg" "x-systemd.requires=network-online.target" "x-systemd.after=network-online.target" ])
|
||||
(lib.optionals (v.readOnly or false) [ "ro" ])
|
||||
];
|
||||
})
|
||||
(inputs.localLib.attrsToList nfs));
|
||||
nfs;
|
||||
services.rpcbind.enable = true;
|
||||
}
|
||||
(inputs.lib.mkIf (builtins.any (mount: mount.neededForBoot or true) (builtins.attrValues nfs))
|
||||
(lib.mkIf (builtins.any (mount: mount.mountBeforeSwitch or true) (builtins.attrValues nfs))
|
||||
{
|
||||
boot.initrd.systemd.extraBin =
|
||||
{
|
||||
"ifconfig" = "${inputs.pkgs.nettools}/bin/ifconfig";
|
||||
"mount.nfs" = "${inputs.pkgs.nfs-utils}/bin/mount.nfs";
|
||||
"mount.nfs4" = "${inputs.pkgs.nfs-utils}/bin/mount.nfs4";
|
||||
"ifconfig" = "${pkgs.nettools}/bin/ifconfig";
|
||||
"mount.nfs" = "${pkgs.nfs-utils}/bin/mount.nfs";
|
||||
"mount.nfs4" = "${pkgs.nfs-utils}/bin/mount.nfs4";
|
||||
};
|
||||
nixos.system.initrd.network = {};
|
||||
})
|
||||
|
||||
@@ -61,7 +61,7 @@ int main()
|
||||
std::string text;
|
||||
std::optional<std::uint32_t> reply_id;
|
||||
// 如果是转发,则直接写链接
|
||||
if (!content.body.note->text)
|
||||
if (!content.body.note->text && content.body.note->renote)
|
||||
text = "转发了[帖子]({}/notes/{})"_f(content.server, content.body.note->id);
|
||||
// 否则(引用或普通帖子)
|
||||
else
|
||||
|
||||
@@ -5,6 +5,7 @@ std::optional<std::int32_t> missgram::tg_send
|
||||
(std::string text, std::optional<std::int32_t> replyId, std::vector<File> files)
|
||||
{
|
||||
using namespace biu::literals;
|
||||
biu::Logger::Guard log;
|
||||
|
||||
// 整理要发送的信息
|
||||
TgBot::Bot bot(config.TelegramBotToken);
|
||||
|
||||
Reference in New Issue
Block a user