test automatical inculstion in motd
This commit is contained in:
@@ -38,7 +38,10 @@ in {
|
||||
};
|
||||
motd = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = "velocity";
|
||||
default =
|
||||
if cfg.enable
|
||||
then "velocity"
|
||||
else null;
|
||||
};
|
||||
backup_repo = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
service = "audiobookshelf";
|
||||
cfg = config.homelab.${service};
|
||||
sec = config.sops.secrets;
|
||||
homelab = config.homelab;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options.homelab.${service} = {
|
||||
enable = lib.mkEnableOption "enables ${service}";
|
||||
|
||||
@@ -38,12 +40,14 @@ in
|
||||
};
|
||||
motd = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = service;
|
||||
default =
|
||||
if cfg.enable
|
||||
then service
|
||||
else null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# declare ${service} group
|
||||
users.groups.${service} = {gid = lib.mkForce cfg.ids;};
|
||||
|
||||
@@ -90,12 +94,15 @@ in
|
||||
};
|
||||
|
||||
# add to glance public service
|
||||
homelab.glance.links.mediastack = [{
|
||||
homelab.glance.links.mediastack = [
|
||||
{
|
||||
title = service;
|
||||
url = "https://abs.${homelab.base_domain}";
|
||||
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
check-url = "http://${homelab.host_ip}:${toString cfg.port}";
|
||||
icon = "di:${service}"; }];
|
||||
icon = "di:${service}";
|
||||
}
|
||||
];
|
||||
|
||||
# add to backups
|
||||
homelab.backups.baks = {
|
||||
|
||||
@@ -78,7 +78,7 @@ in {
|
||||
|
||||
# --- gameservers ---
|
||||
echo -e "''${headings}gameservers:''${reset}"
|
||||
for service in velocity smp superflat bento cobblemon; do
|
||||
for service in velocity smp superflat bento; do
|
||||
status=$(systemctl is-active $service 2>/dev/null)
|
||||
if [ "$status" = "active" ]; then
|
||||
printf "%-32s%s\n" " ''${active}[$service]''${reset}" "running"
|
||||
|
||||
Reference in New Issue
Block a user