diff --git a/flake.nix b/flake.nix index 9fd2926..b04de08 100644 --- a/flake.nix +++ b/flake.nix @@ -7,13 +7,16 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + guestbook.url = "git+https://git.ily.rs/lew/guestbook"; }; - outputs = { self, nixpkgs, sops-nix, ... }: { + outputs = { self, nixpkgs, sops-nix, guestbook, ... }: { nixosConfigurations.lab = nixpkgs.lib.nixosSystem { system = "aarch64-linux"; + specialArgs = { inherit guestbook; }; modules = [ sops-nix.nixosModules.sops + guestbook.nixosModules.default ./hosts/lab ]; }; diff --git a/hosts/lab/default.nix b/hosts/lab/default.nix index 559b0a8..3935ab2 100644 --- a/hosts/lab/default.nix +++ b/hosts/lab/default.nix @@ -12,6 +12,7 @@ ./uptime-kuma.nix ./tinyauth.nix ./shlink.nix + ./guestbook.nix ]; networking.hostName = "lab"; diff --git a/hosts/lab/guestbook.nix b/hosts/lab/guestbook.nix new file mode 100644 index 0000000..345b689 --- /dev/null +++ b/hosts/lab/guestbook.nix @@ -0,0 +1,60 @@ +{ guestbook, ... }: +{ + services.guestbook = { + enable = true; + package = guestbook.packages.aarch64-linux.default; + port = 8123; + dataDir = "/srv/guestbook/data"; + user = "guestbook"; + group = "guestbook"; + + siteTitle = "ily [dot] rs"; + caddy = { + enable = true; + domain = "g.ily.rs"; + }; + + features = { + submissions.enable = false; + websites.enable = false; + drawing = { + enable = false; + canvasWidth = 400; + canvasHeight = 200; + }; + voiceNote = { + enable = false; + maxDuration = 20; + }; + telegram = { + enable = false; + chatId = 8669496383; + }; + security = { + htmlInjection.enable = true; + honeypot.enable = true; + captcha.enable = false; + }; + }; + + limits = { + name = 0; + message = 0; + website = 0; + }; + + styles = { + separator = "-----------"; + labels = { + submit = "Submit"; + name = "Your name*:"; + website = "Your website:"; + message = "Your message*:"; + }; + message = { + width = 400; + height = 150; + }; + }; + }; +}