From 07cf8f74a4ee9529c9e7b13beb6d21aab96876c4 Mon Sep 17 00:00:00 2001 From: Pablo Ovelleiro Corral Date: Sun, 7 Apr 2024 19:32:22 +0200 Subject: [PATCH] kfbox: add wastebin --- flake.lock | 19 +++++++++-------- flake.nix | 3 ++- machines/kfbox/configuration.nix | 1 + modules/wastebin/default.nix | 35 ++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 modules/wastebin/default.nix diff --git a/flake.lock b/flake.lock index d9e0506b..cf00c13b 100644 --- a/flake.lock +++ b/flake.lock @@ -105,11 +105,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -214,15 +214,16 @@ ] }, "locked": { - "lastModified": 1712238433, - "narHash": "sha256-CPQEHdCYtB5jtPsCYW0ED5A4SzqGRvePIftdPw+jzCs=", + "lastModified": 1712506597, + "narHash": "sha256-0nDbNpKJL3GmGgLowQmTcdvy/bykyZovYx40WIf/mgs=", "owner": "pinpox", "repo": "lollypops", - "rev": "23e8069b81125b26c54d6d28e15b28013e985142", + "rev": "203d20a218661a414f6b2cdc9bf3ca0ea94d0845", "type": "github" }, "original": { "owner": "pinpox", + "ref": "nix-flake-archive-fixes", "repo": "lollypops", "type": "github" } @@ -367,11 +368,11 @@ }, "nur": { "locked": { - "lastModified": 1712497482, - "narHash": "sha256-6h0PpUYPKBJevyxZIag7sa+sWOFNp0ry/eRoAT9JDxA=", + "lastModified": 1712501617, + "narHash": "sha256-ipzJlgEAURIUIIDvpSDWtF4DiS0ANvkmQodB9BZ5BDA=", "owner": "nix-community", "repo": "NUR", - "rev": "e2def9c59d2b959b7c86caccd060e5aa0cbb78b1", + "rev": "ed45405982bdd65ce2eb7341a42ea18fb5958d76", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 30425805..eb495868 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,8 @@ }; lollypops = { - url = "github:pinpox/lollypops"; + # url = "github:GeoffreyFrogeye/lollypops/use-nix-flake-archive"; + url = "github:pinpox/lollypops/nix-flake-archive-fixes"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/machines/kfbox/configuration.nix b/machines/kfbox/configuration.nix index eab47767..84e7eef1 100644 --- a/machines/kfbox/configuration.nix +++ b/machines/kfbox/configuration.nix @@ -101,6 +101,7 @@ gitea.enable = true; owncast.enable = true; vikunja.enable = true; + wastebin.enable = true; }; metrics.node.enable = true; diff --git a/modules/wastebin/default.nix b/modules/wastebin/default.nix new file mode 100644 index 00000000..b828e830 --- /dev/null +++ b/modules/wastebin/default.nix @@ -0,0 +1,35 @@ +{ config, lib, ... }: +with lib; +let cfg = config.pinpox.services.wastebin; +in +{ + + options.pinpox.services.wastebin = { + enable = mkEnableOption "wastebin server"; + }; + + config = mkIf cfg.enable { + + # WASTEBIN_PASSWORD_SALT + # WASTEBIN_SIGNING_KEY + lollypops.secrets.files."wastebin/envfile" = { }; + + # Create system user and group + services.wastebin = { + enable = true; + + secretFile = config.lollypops.secrets.files."wastebin/envfile".path; + + settings = { + WASTEBIN_ADDRESS_PORT = "127.0.0.1:8088"; + WASTEBIN_BASE_URL = "https://paste.0cx.de"; + WASTEBIN_HTTP_TIMEOUT = 7; + WASTEBIN_MAX_BODY_SIZE = 1024; + WASTEBIN_TITLE = "wastebin"; + RUST_LOG = "warning"; + }; + }; + # TODO Reverse proxy + # TODO Backup? + }; +}