treewide: cleanup

This commit is contained in:
Guanran Wang 2024-07-31 21:19:18 +08:00
parent 212b6b71f1
commit 8d7535c9ac
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
5 changed files with 0 additions and 73 deletions

View file

@ -1,3 +0,0 @@
[[language]]
name = "nix"
formatter = { command = "alejandra", args = ["--quiet"] }

View file

@ -56,11 +56,6 @@
trashy
]);
home.shellAliases = {
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
};
programs.fish.functions = let
jq = lib.getExe pkgs.jq;
nix = lib.getExe pkgs.nix;

View file

@ -2,6 +2,5 @@
imports = [
./services/hysteria.nix
./services/pixivfe.nix
./services/rathole.nix
];
}

View file

@ -1,50 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.services.rathole;
in {
options.services.rathole = {
enable = lib.mkEnableOption "Rathole, a lightweight and high-performance reverse proxy for NAT traversal";
package = lib.mkPackageOption pkgs "rathole" {};
configFile = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.path;
description = "Configuration file to use.";
};
credentials = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
example = lib.literalExpression ''
[
"cert:/tmp/certificate.crt"
"key:/tmp/private-key.key"
];
'';
description = ''
Extra credentials loaded by systemd, you can access them by `/run/credentials/rathole.service/foobar`.
See `systemd.exec(5)` for more information.
'';
};
};
config = lib.mkIf cfg.enable {
systemd.services.rathole = {
description = "Rathole daemon, a lightweight and high-performance reverse proxy for NAT traversal.";
wantedBy = ["multi-user.target"];
after = ["network-online.target"];
wants = ["network-online.target"];
serviceConfig = {
ExecStart = "${lib.getExe cfg.package} $\{CREDENTIALS_DIRECTORY}/rathole.toml";
LoadCredential = ["rathole.toml:${cfg.configFile}"] ++ cfg.credentials;
DynamicUser = true;
};
};
};
}

View file

@ -6,20 +6,6 @@
programs.statix.enable = true;
programs.alejandra.enable = true;
### shell
programs.shfmt.enable = true;
settings.formatter.shfmt.options = ["-i" "2" "-sr"];
programs.shellcheck.enable = true;
settings.formatter.shellcheck.options = [
"-s"
"bash"
"-e"
"SC2016" # shfmt kept doing it, didn't find a toggle to turn it off
];
### toml
programs.taplo.enable = true;
### misc
programs.prettier.enable = true;
settings.formatter.prettier.excludes = [