mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 19:51:34 +01:00
memos: Init module
This commit is contained in:
parent
bb9ec480eb
commit
20dcc6648a
1 changed files with 45 additions and 0 deletions
45
modules/system/services/memos.nix
Normal file
45
modules/system/services/memos.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
modulesPath,
|
||||||
|
inputs,
|
||||||
|
pkgs-unstable,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.custom.services.memos;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ "${inputs.nixpkgs-unstable}/nixos/modules/services/misc/memos.nix" ];
|
||||||
|
|
||||||
|
options.custom.services.memos = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
|
domain = lib.mkOption {
|
||||||
|
type = lib.types.nonEmptyStr;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
|
port = lib.mkOption {
|
||||||
|
type = lib.types.port;
|
||||||
|
default = 5230;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
warnings = lib.optional (lib.pathExists "${modulesPath}/services/misc/memos.nix") "TODO: Use memos module from stable nixpkgs";
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
domains.list = [ cfg.domain ];
|
||||||
|
ports.tcp.list = [ cfg.port ];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.memos = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs-unstable.memos;
|
||||||
|
settings = options.services.memos.settings.default // {
|
||||||
|
MEMOS_PORT = builtins.toString cfg.port;
|
||||||
|
MEMOS_INSTANCE_URL = "https://${cfg.domain}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue