add everything to motd

This commit is contained in:
2026-06-14 10:58:53 -05:00
parent 2c7e21f64d
commit 4b537c7fe8
4 changed files with 17 additions and 3 deletions
+6 -1
View File
@@ -4,15 +4,20 @@
lib, lib,
... ...
}: let }: let
service = "cloudflare-ddns";
cfg = config.homelab.ddns; cfg = config.homelab.ddns;
sec = config.sops.secrets; sec = config.sops.secrets;
in { in {
options.homelab.ddns = { options.homelab.ddns = {
enable = lib.mkEnableOption "enables ddns with cloudflare"; enable = lib.mkEnableOption "enables ddns with cloudflare";
motd = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = service;
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.cloudflare-ddns = { services.${service} = {
enable = true; enable = true;
credentialsFile = sec."cloudflare/api_token".path; credentialsFile = sec."cloudflare/api_token".path;
domains = [ domains = [
@@ -19,6 +19,10 @@ in {
default = "10.10.0.1"; default = "10.10.0.1";
description = "set upstream dns server for ${service} (default: $cfg.upstream}"; description = "set upstream dns server for ${service} (default: $cfg.upstream}";
}; };
motd = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = service;
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@@ -4,15 +4,20 @@
lib, lib,
... ...
}: let }: let
service = "tailscale";
cfg = config.homelab.tailscale; cfg = config.homelab.tailscale;
sec = config.sops.secrets; sec = config.sops.secrets;
in { in {
options.homelab.tailscale = { options.homelab.tailscale = {
enable = lib.mkEnableOption "enables tailscale"; enable = lib.mkEnableOption "enables tailscale";
motd = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = service;
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
services.tailscale = { services.${service} = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
useRoutingFeatures = "both"; useRoutingFeatures = "both";
+1 -1
View File
@@ -13,7 +13,7 @@ zstd -dc <path_to_backup> | mysql -u root -p <database_name>
to restore a postgres database: to restore a postgres database:
sudo -u postgres psql -c "DROP DATABASE IF EXISTS <database_name>;" # delete old db if lingering (prolly wont work) sudo -u postgres psql -c "DROP DATABASE IF EXISTS <database_name>;" # delete old db if lingering (prolly wont work)
sudo -u postgres psql -c "CREATE DATABASE <database_name>;" # create empty db w/ correct name sudo -u postgres psql -c "CREATE DATABASE <database_name>;" # create empty db w/ correct name
zstd -dc <path_to_backup> | sudo -u postgres psql -d immich # restore from the dump zstd -dc <path_to_backup> | sudo -u postgres psql -d <database_name> # restore from the dump
*/ */
let let
cfg = config.homelab.backups; cfg = config.homelab.backups;