Compare commits

...

20 Commits

Author SHA1 Message Date
85ddb74e49 150 current 2025-10-09 11:52:30 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:53:12 -05:00
3386b01980 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:52:37 -05:00
67a87b3710 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:51:39 -05:00
84f98f526c 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:49:22 -05:00
bca370f573 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:48:47 -05:00
ea1c5bcd7a 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:48:17 -05:00
0d7e1619ff 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:47:04 -05:00
760ae28613 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:46:33 -05:00
41ecb61535 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:45:33 -05:00
b4f57c8cf1 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:45:06 -05:00
2a44bdb45a 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:44:43 -05:00
18f2e82140 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:44:07 -05:00
1cc3f63895 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:43:47 -05:00
6c7a2ecb10 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:43:03 -05:00
6889344290 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:42:30 -05:00
f6107ccc10 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:42:02 -05:00
22ea708d42 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:41:49 -05:00
c9a267aacc 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:39:53 -05:00
477bda8a08 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:38:10 -05:00
0fa07c519b 149 current 2025-10-09 03:59:16 25.05.20251006.20c4598 6.12.50 * 2025-10-09 11:36:22 -05:00
9 changed files with 28 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config
# define new devices in outputs
# generation: 148 current 2025-10-09 02:18:35 25.05.20251006.20c4598 6.12.50 *
# generation: 150 current 2025-10-09 11:52:30 25.05.20251006.20c4598 6.12.50 *
{
description = "blakes nix config";
inputs = {

View File

@@ -6,23 +6,23 @@ let
in
{
options.modules.homelab = {
enable = lib.mkEnableOption "enable homelab services and configuration"
media_user = lib.mkOption = {
enable = lib.mkEnableOption "enable homelab services and configuration";
media_user = lib.mkOption {
default = "media";
type = lib.types.str;
description = "user for media file permissions";
};
media_group = lib.mkOption = {
media_group = lib.mkOption {
default = "media";
type = lib.types.str;
description = "group for media file permissions";
};
tz = lib.mkOption = {
tz = lib.mkOption {
default = "America/Chicago";
type = lib.types.str;
description = "set timezone";
};
base_domain = lib.mkOption = {
base_domain = lib.mkOption {
default = "snowbelle.lan";
type = lib.types.str;
description = "base domain used for reverse proxy";
@@ -31,6 +31,9 @@ in
imports = [
./services
./shares/nfs.nix
./shares/smb.nix
./shares/zfs.nix
];
config = lib.mkIf cfg.enable {
@@ -44,5 +47,5 @@ in
group = cfg.group;
};
};
}
};
}

View File

@@ -4,7 +4,7 @@ let
service = "sonarr";
cfg = config.modules.services.${service};
sec = config.sops.secrets;
homelab = config.homelab;
homelab = config.modules.homelab;
in
{
options.modules.services.${service} = {
@@ -14,11 +14,11 @@ in
port = lib.mkOption {
type = lib.types.int;
default = 7107;
description = "set port for ${service} (default: ${toString default_port}";
description = "set port for ${service} (default: ${toString cfg.port}";
};
url = lib.mkOption {
type = lib.types.str;
default = "${service}.${homelab.basedomain}";
default = "${service}.${homelab.base_domain}";
description = "set domain for ${service} reverse proxy entry";
};
data_dir = lib.mkOption {
@@ -28,7 +28,7 @@ in
};
ids = lib.mkOption {
type = lib.types.int;
default = ${port};
default = cfg.port;
description = "set uid and pid of ${service} user (matches port by default)";
};
backup = lib.mkOption {
@@ -41,12 +41,12 @@ in
config = lib.mkIf cfg.enable {
# declare ${service} group
users.groups.${service} = { gid = cfg.ids; };
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
# declare ${service} user
users.users.${service} = {
description = "${service} server user";
uid = cfg.ids;
uid = lib.mkForce cfg.ids;
isSystemUser = true;
home = cfg.data_dir;
createHome = true;
@@ -75,7 +75,7 @@ in
# networking.firewall.allowedTCPPorts = [ cfg.port ];
# internal reverse proxy entry
services.nginx.virtualHosts."${url}" = {
services.nginx.virtualHosts."${cfg.url}" = {
forceSSL = true;
sslCertificate = sec."ssl_blakedheld_crt".path;
sslCertificateKey = sec."ssl_blakedheld_key".path;

View File

@@ -4,10 +4,11 @@
{
imports = [
# ./jellyfin
# ./vaultwarden
# ./gitea
# ./qbittorrent
./jellyfin
./vaultwarden
./gitea
./qbittorrent
./nginx-proxy
# ./arr/prowlarr
# ./arr/flaresolverr
# ./arr/bazarr

View File

@@ -4,7 +4,7 @@ let
service = "";
cfg = config.modules.services.${service};
sec = config.sops.secrets;
homelab = config.homelab;
homelab = config.modules.homelab;
in
{
options.modules.services.${service} = {
@@ -14,11 +14,11 @@ in
port = lib.mkOption {
type = lib.types.int;
default = <port>;
description = "set port for ${service} (default: ${toString default_port}";
description = "set port for ${service} (default: ${toString cfg.port}";
};
url = lib.mkOption {
type = lib.types.str;
default = "${service}.${homelab.basedomain}";
default = "${service}.${homelab.base_domain}";
description = "set domain for ${service}";
};
data_dir = lib.mkOption {
@@ -28,7 +28,7 @@ in
};
ids = lib.mkOption {
type = lib.types.int;
default = ${port};
default = cfg.port;
description = "set uid and pid of ${service} user (matches port by default)";
};
backup = lib.mkOption {
@@ -41,12 +41,12 @@ in
config = lib.mkIf cfg.enable {
# declare ${service} group
users.groups.${service} = { gid = cfg.ids; };
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
# declare ${service} user
users.users.${service} = {
description = "${service} server user";
uid = cfg.ids;
uid = lib.mkForce cfg.ids;
isSystemUser = true;
home = cfg.data_dir;
createHome = true;