treewide: cleanup
This commit is contained in:
parent
212b6b71f1
commit
8d7535c9ac
5 changed files with 0 additions and 73 deletions
|
@ -1,3 +0,0 @@
|
||||||
[[language]]
|
|
||||||
name = "nix"
|
|
||||||
formatter = { command = "alejandra", args = ["--quiet"] }
|
|
|
@ -56,11 +56,6 @@
|
||||||
trashy
|
trashy
|
||||||
]);
|
]);
|
||||||
|
|
||||||
home.shellAliases = {
|
|
||||||
".." = "cd ..";
|
|
||||||
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.fish.functions = let
|
programs.fish.functions = let
|
||||||
jq = lib.getExe pkgs.jq;
|
jq = lib.getExe pkgs.jq;
|
||||||
nix = lib.getExe pkgs.nix;
|
nix = lib.getExe pkgs.nix;
|
||||||
|
|
|
@ -2,6 +2,5 @@
|
||||||
imports = [
|
imports = [
|
||||||
./services/hysteria.nix
|
./services/hysteria.nix
|
||||||
./services/pixivfe.nix
|
./services/pixivfe.nix
|
||||||
./services/rathole.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
14
treefmt.nix
14
treefmt.nix
|
@ -6,20 +6,6 @@
|
||||||
programs.statix.enable = true;
|
programs.statix.enable = true;
|
||||||
programs.alejandra.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
|
### misc
|
||||||
programs.prettier.enable = true;
|
programs.prettier.enable = true;
|
||||||
settings.formatter.prettier.excludes = [
|
settings.formatter.prettier.excludes = [
|
||||||
|
|
Loading…
Reference in a new issue