Compare commits

..

50 Commits

Author SHA1 Message Date
779c87510a adding uptime-kuma 2025-10-09 21:59:49 -05:00
b75a1c6d32 189 current 2025-10-09 21:50:35 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:59:29 -05:00
e394f284d6 188 current 2025-10-09 21:49:39 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:50:41 -05:00
5c01f6a490 187 current 2025-10-09 21:44:05 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:49:42 -05:00
b8fd18d881 187 current 2025-10-09 21:44:05 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:44:37 -05:00
653da27815 186 current 2025-10-09 21:26:53 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:44:07 -05:00
394d399d8b 186 current 2025-10-09 21:26:53 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:27:15 -05:00
ddb638436a 185 current 2025-10-09 21:25:33 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:26:56 -05:00
ceffcfde58 185 current 2025-10-09 21:25:33 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:25:57 -05:00
413057f9ed 184 current 2025-10-09 21:19:25 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:25:37 -05:00
e77bb9ae08 184 current 2025-10-09 21:19:25 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:24:35 -05:00
442af621f9 184 current 2025-10-09 21:19:25 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:23:17 -05:00
96da0a67c5 183 current 2025-10-09 20:51:03 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:19:28 -05:00
5421f468e9 183 current 2025-10-09 20:51:03 25.05.20251006.20c4598 6.12.50 * 2025-10-09 21:17:56 -05:00
be5286810f 182 current 2025-10-09 20:41:39 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:51:06 -05:00
8adc8308dc 182 current 2025-10-09 20:41:39 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:50:25 -05:00
2fc255549b 182 current 2025-10-09 20:41:39 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:49:58 -05:00
03c60c8a96 182 current 2025-10-09 20:41:39 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:48:57 -05:00
8e4db00903 182 current 2025-10-09 20:41:39 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:47:36 -05:00
5b1dd5e6ae 181 current 2025-10-09 20:18:51 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:41:41 -05:00
96340dffb6 181 current 2025-10-09 20:18:51 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:38:26 -05:00
673da9fdf9 180 current 2025-10-09 20:07:23 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:18:54 -05:00
1a63b6b497 180 current 2025-10-09 20:07:23 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:17:25 -05:00
7522fc1802 179 current 2025-10-09 19:52:17 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:07:25 -05:00
6537cf5426 179 current 2025-10-09 19:52:17 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:06:42 -05:00
a827a87597 179 current 2025-10-09 19:52:17 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:06:04 -05:00
bdbdfa7df4 179 current 2025-10-09 19:52:17 25.05.20251006.20c4598 6.12.50 * 2025-10-09 20:03:33 -05:00
e6afad411c 179 current 2025-10-09 19:52:17 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:52:46 -05:00
ea0e162a93 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:52:20 -05:00
6c230bdbd3 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:49:25 -05:00
b63ce5b4fb 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:48:39 -05:00
1676374c61 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:48:02 -05:00
4d7e37f700 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:46:56 -05:00
19424d0f28 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:46:10 -05:00
477c7c9767 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:45:18 -05:00
8b787309fe 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:44:05 -05:00
ac4f2dad23 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:41:02 -05:00
923d05073c 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:39:29 -05:00
93efb4074b 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:37:30 -05:00
6b2ab6bf20 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:35:37 -05:00
07e2a3c562 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:34:45 -05:00
9fb0d1a972 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:33:26 -05:00
3d092dd529 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:32:43 -05:00
12f3e3767a 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:31:27 -05:00
21e77f36b2 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:30:29 -05:00
0791c92e04 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:29:59 -05:00
7393c5047c 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:18:19 -05:00
228918dd93 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:16:43 -05:00
4725d90910 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 * 2025-10-09 19:14:35 -05:00
6fe95330e7 adding home stack 2025-10-09 19:12:58 -05:00
9 changed files with 445 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config
# define new devices in outputs
# generation: 178 current 2025-10-09 16:19:44 25.05.20251006.20c4598 6.12.50 *
# generation: 189 current 2025-10-09 21:50:35 25.05.20251006.20c4598 6.12.50 *
{
description = "blakes nix config";
inputs = {

View File

@@ -40,6 +40,9 @@ in
gitea.enable = true;
qbittorrent.enable = true;
immich.enable = true;
home-assistant.enable = true;
zigbee2mqtt.enable = true;
mosquitto.enable = true;
prowlarr.enable = true;
flaresolverr.enable = true;
bazarr.enable = true;

View File

@@ -9,7 +9,11 @@
./gitea
./qbittorrent
./immich
./uptime-kuma
./nginx-proxy
./smarthome/homeassistant
./smarthome/zigbee2mqtt
./smarthome/mosquitto
./arr/prowlarr
./arr/flaresolverr
./arr/bazarr

View File

@@ -18,7 +18,7 @@ in
};
url = lib.mkOption {
type = lib.types.str;
default = "${service}.${homelab.base_domain}";
default = "$=photos.${homelab.base_domain}";
description = "set domain for ${service}";
};
data_dir = lib.mkOption {
@@ -86,7 +86,7 @@ in
};
};
# external reverse proxy entry
services.nginx.virtualHosts."pics.blakedheld.xyz" = {
services.nginx.virtualHosts."photos.blakedheld.xyz" = {
forceSSL = true;
sslCertificate = sec."ssl_blakedheld_crt".path;
sslCertificateKey = sec."ssl_blakedheld_key".path;

View File

@@ -0,0 +1,116 @@
{ pkgs, config, lib, inputs, ... }:
let
service = "home-assistant";
cfg = config.modules.services.${service};
sec = config.sops.secrets;
homelab = config.modules.homelab;
in
{
options.modules.services.${service} = {
enable = lib.mkEnableOption "enables ${service}";
# set port options
port = lib.mkOption {
type = lib.types.int;
default = 7704;
description = "set port for ${service} (default: ${toString cfg.port}";
};
url = lib.mkOption {
type = lib.types.str;
default = "hass.${homelab.base_domain}";
description = "set domain for ${service}";
};
data_dir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/${service}";
description = "set data directory for ${service}";
};
ids = lib.mkOption {
type = lib.types.int;
default = cfg.port;
description = "set uid and pid of ${service} user (matches port by default)";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
description = "enable backups for ${service}";
};
};
config = lib.mkIf cfg.enable {
# declare ${service} group
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
# declare ${service} user
users.users.${service} = {
description = "${service} server user";
uid = lib.mkForce cfg.ids;
isSystemUser = true;
home = cfg.data_dir;
createHome = true;
group = "${service}";
extraGroups = [];
};
# enable the ${service} service
services.${service} = {
enable = true;
package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.home-assistant;
configDir = cfg.data_dir;
config = null;
# openFirewall = true;
# if config is set in here, configuration.yaml will be overwritten every startup with this
# configWritable = true;
# config = {
# http.server_port = cfg.port;
# homeassistant = {
# name = "snowbelle";
# time_zone = cfg.tz;
# unit_system = "us_customary";
# temperature_unit = "F";
# };
# };
};
# override umask to make permissions work out
systemd.services.${service}.serviceConfig = {
UMask = lib.mkForce "0007";
User = lib.mkForce "${service}";
Group = lib.mkForce "${service}";
};
# # open firewall
networking.firewall.allowedTCPPorts = [ cfg.port 8123 ];
# internal reverse proxy entry
services.nginx.virtualHosts."${cfg.url}" = {
forceSSL = true;
sslCertificate = sec."ssl_blakedheld_crt".path;
sslCertificateKey = sec."ssl_blakedheld_key".path;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
# external reverse proxy entry
services.nginx.virtualHosts."hass.blakedheld.xyz" = {
forceSSL = true;
sslCertificate = sec."ssl_blakedheld_crt".path;
sslCertificateKey = sec."ssl_blakedheld_key".path;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
# sops.secrets = {
# "${service}_" = {
# owner = "${service}";
# group = "${service}";
# };
# };
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ];
};
}

View File

@@ -0,0 +1,97 @@
{ pkgs, config, lib, ... }:
let
service = "mosquitto";
cfg = config.modules.services.${service};
sec = config.sops.secrets;
homelab = config.modules.homelab;
in
{
options.modules.services.${service} = {
enable = lib.mkEnableOption "enables ${service}";
# set port options
port = lib.mkOption {
type = lib.types.int;
default = 1883;
description = "set port for ${service} (default: ${toString cfg.port}";
};
url = lib.mkOption {
type = lib.types.str;
default = "${service}.${homelab.base_domain}";
description = "set domain for ${service}";
};
data_dir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/${service}";
description = "set data directory for ${service}";
};
ids = lib.mkOption {
type = lib.types.int;
default = cfg.port;
description = "set uid and pid of ${service} user (matches port by default)";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
description = "enable backups for ${service}";
};
};
config = lib.mkIf cfg.enable {
# declare ${service} group
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
# declare ${service} user
users.users.${service} = {
description = lib.mkForce "${service} server user";
uid = lib.mkForce cfg.ids;
isSystemUser = true;
home = cfg.data_dir;
createHome = true;
group = "${service}";
extraGroups = [];
};
# enable the ${service} service
services.mosquitto.enable = true;
services.mosquitto.listeners = [
{
port = 1883;
address = "0.0.0.0";
settings.allow_anonymous = true;
#passwordFile = sec."mosquitto_password_file".path; # optional
}
];
# override umask to make permissions work out
systemd.services.${service}.serviceConfig = {
UMask = lib.mkForce "0007";
User = "${service}";
Group = "${service}";
};
# # open firewall
networking.firewall.allowedTCPPorts = [ cfg.port ];
# # internal reverse proxy entry
# services.nginx.virtualHosts."${cfg.url}" = {
# forceSSL = true;
# sslCertificate = sec."ssl_blakedheld_crt".path;
# sslCertificateKey = sec."ssl_blakedheld_key".path;
# locations."/" = {
# proxyPass = "http://127.0.0.1:${toString cfg.port}";
# };
# };
sops.secrets = {
"${service}_password_file" = {
owner = "${service}";
group = "${service}";
};
};
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ];
};
}

View File

@@ -0,0 +1,113 @@
{ pkgs, config, lib, ... }:
let
service = "zigbee2mqtt";
cfg = config.modules.services.${service};
sec = config.sops.secrets;
homelab = config.modules.homelab;
in
{
options.modules.services.${service} = {
enable = lib.mkEnableOption "enables ${service}";
# set port options
port = lib.mkOption {
type = lib.types.int;
default = 7705;
description = "set port for ${service} (default: ${toString cfg.port}";
};
url = lib.mkOption {
type = lib.types.str;
default = "${service}.${homelab.base_domain}";
description = "set domain for ${service}";
};
data_dir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/${service}";
description = "set data directory for ${service}";
};
ids = lib.mkOption {
type = lib.types.int;
default = cfg.port;
description = "set uid and pid of ${service} user (matches port by default)";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
description = "enable backups for ${service}";
};
};
config = lib.mkIf cfg.enable {
# declare ${service} group
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
# declare ${service} user
users.users.${service} = {
description = "${service} server user";
uid = lib.mkForce cfg.ids;
isSystemUser = true;
home = cfg.data_dir;
createHome = true;
group = "${service}";
extraGroups = [];
};
# enable the ${service} service
services.${service} = {
enable = true;
dataDir = cfg.data_dir;
settings = {
mqtt = {
base_topic = "zigbee2mqtt";
server = "mqtt://localhost:1883";
};
serial = {
port = "/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_4a4e75d63653ef1198d728e0174bec31-if00-port0";
adapter = "ember";
};
advanced = {
channel = 11;
};
frontend = {
enabled = true;
port = cfg.port;
};
homeassistant = {
enabled = true;
};
};
};
# override umask to make permissions work out
systemd.services.${service}.serviceConfig = {
UMask = lib.mkForce "0007";
User = "${service}";
Group = "${service}";
};
# # open firewall
networking.firewall.allowedTCPPorts = [ cfg.port ];
# internal reverse proxy entry
services.nginx.virtualHosts."${cfg.url}" = {
forceSSL = true;
sslCertificate = sec."ssl_blakedheld_crt".path;
sslCertificateKey = sec."ssl_blakedheld_key".path;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
#
# sops.secrets = {
# "${service}_" = {
# owner = "${service}";
# group = "${service}";
# };
# };
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ];
};
}

View File

@@ -0,0 +1,105 @@
{ pkgs, config, lib, ... }:
let
service = "uptime-kuma";
cfg = config.modules.services.${service};
sec = config.sops.secrets;
homelab = config.modules.homelab;
in
{
options.modules.services.${service} = {
enable = lib.mkEnableOption "enables ${service}";
# set port options
port = lib.mkOption {
type = lib.types.int;
default = 7901;
description = "set port for ${service} (default: ${toString cfg.port}";
};
url = lib.mkOption {
type = lib.types.str;
default = "up.${homelab.base_domain}";
description = "set domain for ${service}";
};
data_dir = lib.mkOption {
type = lib.types.str;
default = "/var/lib/${service}";
description = "set data directory for ${service}";
};
ids = lib.mkOption {
type = lib.types.int;
default = cfg.port;
description = "set uid and pid of ${service} user (matches port by default)";
};
backup = lib.mkOption {
type = lib.types.bool;
default = true;
description = "enable backups for ${service}";
};
};
config = lib.mkIf cfg.enable {
# declare ${service} group
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
# declare ${service} user
users.users.${service} = {
description = "${service} server user";
uid = lib.mkForce cfg.ids;
isSystemUser = true;
home = cfg.data_dir;
createHome = true;
group = "${service}";
extraGroups = [];
};
# enable the ${service} service
services.${service} = {
enable = true;
settings =
{
PORT = cfg.port;
};
};
# override umask to make permissions work out
systemd.services.${service}.serviceConfig = {
UMask = lib.mkForce "0007";
# User = "${service}";
# Group = "${service}";
};
# # open firewall
# networking.firewall.allowedTCPPorts = [ cfg.port ];
# internal reverse proxy entry
services.nginx.virtualHosts."${cfg.url}" = {
forceSSL = true;
sslCertificate = sec."ssl_blakedheld_crt".path;
sslCertificateKey = sec."ssl_blakedheld_key".path;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
};
};
# # external reverse proxy entry
# services.nginx.virtualHosts."uptime.blakedheld.xyz" = {
# forceSSL = true;
# sslCertificate = sec."ssl_blakedheld_crt".path;
# sslCertificateKey = sec."ssl_blakedheld_key".path;
# locations."/" = {
# proxyPass = "http://127.0.0.1:${toString cfg.port}";
# };
# };
sops.secrets = {
"${service}_" = {
owner = "${service}";
group = "${service}";
};
};
# add to backups
modules.system.backups.paths = lib.mkIf cfg.backup [ cfg.data_dir ];
};
}

View File

@@ -20,6 +20,8 @@ vpncon_mex_config: ENC[AES256_GCM,data:4i356X97sBoRliskmh5ewcEwZHkpo37IhPcemKVdW
vaultwarden_admin_token: ENC[AES256_GCM,data:G1v3N064ci0Fw5EtTzaryailWpsv6f4w6eoHp2vjXIBtIlScdQk1Q0W+eDNRk8Wr2C3ysTXQNbyYismNsls+jeS3W+YqkKL4fnh3a5UTzQrMqvaH11n3ak0X9R9vmt+ZJXBrUrAOKJ6RPHJJSWenhjDB77kwEdQ=,iv:f8X+x/AdmZ3b3dtcSFrxGgA2tCgDRpgddjlVu3mdCmM=,tag:c0MXljVvhwOdvrb/8hWlsQ==,type:str]
#ENC[AES256_GCM,data:2ESzSsQZqKdjD7OXN8ZPThj6g9acJREe,iv:aDFPB0vs8NNo8ExLcJw7qtQvWbCb1XK6TJrHSK86qss=,tag:z+dypHAGUjEXP7Y9MHYWwg==,type:comment]
gitea_database_password: ENC[AES256_GCM,data:nhFn0/G7gW5rk996OZzlcTt7T9KMbP8MNM+ReFC8w1H9ZqBSJUbs3K+n68uQVrkOVSXE0cKpOR1VbQ+i+46z3g==,iv:bT4GRZZ83v47/EmeV2KaUFo+4qTT4T2AktFUpPiZdF4=,tag:OC9TInkAr1egM+xnBDizxw==,type:str]
#ENC[AES256_GCM,data:nbB5Cd7i/KTMCjCzcX8o1sxREZQ/gLAG,iv:iyuO2erxdJM08WHJBjKuNIXYxVhH7rfyOLTcGCcGqNQ=,tag:UeDszimXv8kQUmDetLeFqg==,type:comment]
mosquitto_password_file: ENC[AES256_GCM,data:7ifs2hGnFQSgJOAKpN0usfiaqLjj7Rjb7zn1/qBDbqEi5hV0JfUncZGorBivR/+kjXHQO6nxaHcKqYvPedNdJ7Qy4/uil/xwgwSmzcbisdVYkhd2pf/N34EQFxmqohud0aTH9V47QbgTdrUPfvsiL+ljLvLu4w==,iv:z7YPIfJHHaLOJrDVnMQhgcMzYAPordFR11kHRAzZqYU=,tag:LRddczdvy01YTm2DFDgSJQ==,type:str]
sops:
age:
- recipient: age14gfh682a7m7jfp3qrulql03x5rs7yedwmxwksxrrmgjsunstyuksqx93pz
@@ -31,7 +33,7 @@ sops:
U0tmdFBuZnJES3piOTZNV0VKQmQ0eVUKCWRQ/flLzmpC64WyLoipklZBmrkpYiUg
PRu+itNolpPTHm96pe+P93g2iP0wgekG0cX21wkiU2xaLF3dY2FEIA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-10-09T00:57:39Z"
mac: ENC[AES256_GCM,data:NCsVDJnzb/x6/InOrE7Aco1bEfbcOA0t5mEQOO/tSM4uj5QjDeCTUyfzfK0A7LHdQSMvRpZLZuz7xDg/WA/QLe0F/CdA1h5HJucpop4NWN/bnJrVNIcik/YlvB6xSWojimZF9sbWZQQb2lPsn3GWt9wIHIHWlBhjIMfHHpLANq8=,iv:yQgpRv+xCvKcBYCyVac66egptSbF/8vi4TtQ5vL5xWQ=,tag:JdsI0yAecTnNO9UiE2IEwQ==,type:str]
lastmodified: "2025-10-09T23:59:55Z"
mac: ENC[AES256_GCM,data:Zdn1teUi8epB0WJZrpwdOxsnZ4XtJN7dPefGROPUpt0mMFDI5pP9NJpczNLj6ZddCka75Bca8Z3ixcpKasZAJhlQNNKTCe6NRhuh6ergSepzerYGTN1fUwKm+goLY40d33moZFurHkHjmdsNXgb6T9JsIz9bzjLrzqiK9P/gPoM=,iv:AQKQuW1zR9hiaBx3KxfwftM9GnwsOSfsmTN/nEJh5qA=,tag:qxODcuuzTh6ifwMNKR/6lg==,type:str]
unencrypted_suffix: _unencrypted
version: 3.11.0