From ac4b47f82368a9529a53b0b04fed4b685a9e12e0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 29 Apr 2021 18:40:36 +0200 Subject: [PATCH] nixos/pinnwand: improve settings behaviour Individual settings would previously overwrite the whole config, but now individual values can be overwritten. Fix missing slash to make the database path an absolute path per https://docs.sqlalchemy.org/en/14/core/engines.html#sqlite. Drop preferred_lexers, it's not set to anything meaningful anyway. --- nixos/modules/services/misc/pinnwand.nix | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nixos/modules/services/misc/pinnwand.nix b/nixos/modules/services/misc/pinnwand.nix index aa1ee5cfaa7..ca378847a20 100644 --- a/nixos/modules/services/misc/pinnwand.nix +++ b/nixos/modules/services/misc/pinnwand.nix @@ -24,22 +24,22 @@ in Your pinnwand.toml as a Nix attribute set. Look up possible options in the pinnwand.toml-example. ''; - default = { - # https://github.com/supakeen/pinnwand/blob/master/pinnwand.toml-example - database_uri = "sqlite:///var/lib/pinnwand/pinnwand.db"; - preferred_lexeres = []; - paste_size = 262144; - paste_help = '' -

Welcome to pinnwand, this site is a pastebin. It allows you to share code with others. If you write code in the text area below and press the paste button you will be given a link you can share with others so they can view your code as well.

People with the link can view your pasted code, only you can remove your paste and it expires automatically. Note that anyone could guess the URI to your paste so don't rely on it being private.

- ''; - footer = '' - View source code, the removal or expiry stories, or read the about page. - ''; - }; + default = {}; }; }; config = mkIf cfg.enable { + services.pinnwand.settings = { + database_uri = mkDefault "sqlite:////var/lib/pinnwand/pinnwand.db"; + paste_size = mkDefault 262144; + paste_help = mkDefault '' +

Welcome to pinnwand, this site is a pastebin. It allows you to share code with others. If you write code in the text area below and press the paste button you will be given a link you can share with others so they can view your code as well.

People with the link can view your pasted code, only you can remove your paste and it expires automatically. Note that anyone could guess the URI to your paste so don't rely on it being private.

+ ''; + footer = mkDefault '' + View source code, the removal or expiry stories, or read the about page. + ''; + }; + systemd.services.pinnwand = { description = "Pinnwannd HTTP Server"; after = [ "network.target" ];