Add wastebin
All checks were successful
CI / Check, build and cache Nix flake (push) Successful in 27m3s
All checks were successful
CI / Check, build and cache Nix flake (push) Successful in 27m3s
This commit is contained in:
parent
f90deabb50
commit
44e87aa387
@ -384,6 +384,10 @@ in
|
||||
};
|
||||
useACMEHost = pubDomain;
|
||||
};
|
||||
"pb.${pubDomain}" = {
|
||||
locations."/".proxyPass = "http://object-ctr.${domain}:8088";
|
||||
useACMEHost = pubDomain;
|
||||
};
|
||||
};
|
||||
|
||||
minio =
|
||||
|
@ -49,6 +49,7 @@ in
|
||||
};
|
||||
"object/atticd.env" = {};
|
||||
"object/hedgedoc.env" = {};
|
||||
"object/wastebin.env" = {};
|
||||
};
|
||||
};
|
||||
|
||||
@ -58,6 +59,7 @@ in
|
||||
config.services.sharry.config.bind.port
|
||||
8069
|
||||
config.services.hedgedoc.settings.port
|
||||
8088
|
||||
];
|
||||
};
|
||||
|
||||
@ -220,6 +222,15 @@ in
|
||||
allowEmailRegister = false;
|
||||
};
|
||||
};
|
||||
|
||||
wastebin = {
|
||||
enable = true;
|
||||
settings = {
|
||||
WASTEBIN_MAX_BODY_SIZE = "67108864"; # 16 MiB
|
||||
WASTEBIN_PASSWORD_SALT = "TeGhaemeer0Siez3";
|
||||
};
|
||||
extraSettingsFile = config.age.secrets."object/wastebin.env".path;
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkIf config.my.build.isDevVM {
|
||||
|
@ -20,5 +20,6 @@
|
||||
nvme = ./nvme;
|
||||
spdk = ./spdk.nix;
|
||||
librespeed = ./librespeed;
|
||||
wastebin = ./wastebin.nix;
|
||||
};
|
||||
}
|
||||
|
@ -492,6 +492,9 @@ in
|
||||
}
|
||||
];
|
||||
})
|
||||
(mkIf config.services.wastebin.enable {
|
||||
my.tmproot.persistence.config.directories = [ "/var/lib/private/wastebin" ];
|
||||
})
|
||||
]))
|
||||
]);
|
||||
|
||||
|
35
nixos/modules/wastebin.nix
Normal file
35
nixos/modules/wastebin.nix
Normal file
@ -0,0 +1,35 @@
|
||||
{ lib, pkgs, config, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (lib.my) mkOpt' mkBoolOpt';
|
||||
|
||||
cfg = config.services.wastebin;
|
||||
in
|
||||
{
|
||||
options.services.wastebin = with lib.types; {
|
||||
enable = mkBoolOpt' false "Whether to enable wastebin.";
|
||||
package = mkOpt' package pkgs.wastebin "Package to use.";
|
||||
settings = mkOpt' (attrsOf str) { } "Environment variable settings.";
|
||||
extraSettingsFile = mkOpt' (nullOr str) null "Extra environment file (e.g. for signing key).";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.wastebin.settings = {
|
||||
WASTEBIN_ADDRESS_PORT = mkDefault "[::]:8088";
|
||||
WASTEBIN_DATABASE_PATH = mkDefault "/var/lib/wastebin/db.sqlite3";
|
||||
};
|
||||
|
||||
systemd.services.wastebin = {
|
||||
description = "wastebin minimal pastebin";
|
||||
after = [ "network.target" ];
|
||||
environment = cfg.settings;
|
||||
serviceConfig = {
|
||||
EnvironmentFile = mkIf (cfg.extraSettingsFile != null) cfg.extraSettingsFile;
|
||||
DynamicUser = true;
|
||||
StateDirectory = "wastebin";
|
||||
ExecStart = "${cfg.package}/bin/wastebin";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
};
|
||||
}
|
@ -8,4 +8,5 @@ in
|
||||
vfio-pci-bind = callPackage ./vfio-pci-bind.nix { };
|
||||
librespeed-go = callPackage ./librespeed-go.nix { };
|
||||
modrinth-app = callPackage ./modrinth-app { };
|
||||
wastebin = callPackage ./wastebin { };
|
||||
}
|
||||
|
2161
pkgs/wastebin/Cargo.lock
generated
Normal file
2161
pkgs/wastebin/Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
22
pkgs/wastebin/default.nix
Normal file
22
pkgs/wastebin/default.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, rustPlatform
|
||||
}:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "wastebin";
|
||||
version = "2.4.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "matze";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
hash = "sha256-9SsNtIZfRK9HwWaqlsuSCs7eNK/7KnzDtCe0fFslXwA=";
|
||||
};
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
outputHashes = {
|
||||
"rusqlite_migration-1.1.0" = "sha256-FpIwgISYWEg7IQxG4tJ3u6b8+qanaqanZrq0Bz5WlLs=";
|
||||
};
|
||||
};
|
||||
}
|
12
secrets/object/wastebin.env.age
Normal file
12
secrets/object/wastebin.env.age
Normal file
@ -0,0 +1,12 @@
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IHNzaC1lZDI1NTE5IGhrYnR2ZyBmbDlE
|
||||
Ylh6RVBabVdnMnoxRnR5U0RZS09iMUk3TEl5Ry9vbGNFQ1F4V2tNCjRyWTZUOVhp
|
||||
L2NBUzJ0OXlsU2F1VGMvK2Z2d2k4N2VaSExOTDVjKzdPODQKLT4gWDI1NTE5IEkr
|
||||
ckZzSi9DaWRDYXgyUVNBejErdHhnME5aeWc2QjA4RFQrZjIvM2JhZ2sKZWRkUE9U
|
||||
a3g5M1lMY3FCbVRzbFRBVzVKRmM3TFQ4RGYyK0M4K0lETFhuYwotPiA/TTJyQi1n
|
||||
cmVhc2UgdTNFPyMgQGVffGEKQmViTERtRXpSSStDVlY0YXV6dwotLS0gYkdDVzFP
|
||||
NnhmbnFaWVpKTDMza09qQzd3MnB5NkZGQi8vZ2Mxd29sM2Z4UQr6g8tdM6ChbRgt
|
||||
g+2KGxwrUaicgMiVNbXJjbRRYq/3Ml/ZUSwiyu/+jUOlrpCxpasrADwifILD3M/c
|
||||
sWW4dzVVR80t7k9FSDwy+EF/XvCxCRbLrqEbKNttfpig+9PRpB8R+so7YyYMhbc0
|
||||
84nzB7gvJUlnKDVS
|
||||
-----END AGE ENCRYPTED FILE-----
|
Loading…
Reference in New Issue
Block a user