mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
module/hedgedoc: make as module
This commit is contained in:
parent
de21c8401d
commit
ecfe844e5f
2 changed files with 69 additions and 22 deletions
69
modules/services/hedgedoc/default.nix
Normal file
69
modules/services/hedgedoc/default.nix
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
# HedgeDoc is an open-source, web-based, self-hosted, collaborative markdown editor.
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.hedgedoc;
|
||||||
|
domain = config.networking.domain;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.hedgedoc = with lib; {
|
||||||
|
enable = mkEnableOption "Navidrome Music Server";
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = (pkgs.formats.json { }).type;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
"LastFM.ApiKey" = "MYKEY";
|
||||||
|
"LastFM.Secret" = "MYSECRET";
|
||||||
|
"Spotify.ID" = "MYKEY";
|
||||||
|
"Spotify.Secret" = "MYSECRET";
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Additional settings.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
configuration = mkOption {
|
||||||
|
type = types.attrs;
|
||||||
|
default = { };
|
||||||
|
description = "additional configurations";
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 3000;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.hedgedoc = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
configuration = {
|
||||||
|
domain = "notes.${domain}";
|
||||||
|
protocolUseSSL = true;
|
||||||
|
db = {
|
||||||
|
dialect = "sqlite";
|
||||||
|
storage = "/var/lib/hedgedoc/db.hedgedoc.sqlite";
|
||||||
|
};
|
||||||
|
} // cfg.configuration;
|
||||||
|
};
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = [
|
||||||
|
{
|
||||||
|
subdomain = "notes";
|
||||||
|
inherit (cfg) port;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
webapps.apps.hedgedoc = {
|
||||||
|
dashboard = {
|
||||||
|
name = "Notes";
|
||||||
|
category = "app";
|
||||||
|
icon = "edit";
|
||||||
|
link = "https://notes.${domain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
services.hedgedoc = {
|
|
||||||
enable = true;
|
|
||||||
configuration = {
|
|
||||||
domain = "notes.buehler.rocks";
|
|
||||||
protocolUseSSL = true;
|
|
||||||
db = {
|
|
||||||
dialect = "sqlite";
|
|
||||||
storage = "/var/lib/hedgedoc/db.hedgedoc.sqlite";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
webapps.apps.hedgedoc = {
|
|
||||||
dashboard = {
|
|
||||||
name = "Hedgedoc";
|
|
||||||
category = "app";
|
|
||||||
icon = "edit";
|
|
||||||
link = "https://notes.buehler.rocks";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue