Compare commits
20 Commits
8194729e4e
...
85ddb74e49
| Author | SHA1 | Date | |
|---|---|---|---|
| 85ddb74e49 | |||
| 3386b01980 | |||
| 67a87b3710 | |||
| 84f98f526c | |||
| bca370f573 | |||
| ea1c5bcd7a | |||
| 0d7e1619ff | |||
| 760ae28613 | |||
| 41ecb61535 | |||
| b4f57c8cf1 | |||
| 2a44bdb45a | |||
| 18f2e82140 | |||
| 1cc3f63895 | |||
| 6c7a2ecb10 | |||
| 6889344290 | |||
| f6107ccc10 | |||
| 22ea708d42 | |||
| c9a267aacc | |||
| 477bda8a08 | |||
| 0fa07c519b |
@@ -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 = {
|
||||
|
||||
@@ -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 {
|
||||
@@ -43,6 +46,6 @@ in
|
||||
isSystemUser = true;
|
||||
group = cfg.group;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -4,10 +4,11 @@
|
||||
{
|
||||
|
||||
imports = [
|
||||
# ./jellyfin
|
||||
# ./vaultwarden
|
||||
# ./gitea
|
||||
# ./qbittorrent
|
||||
./jellyfin
|
||||
./vaultwarden
|
||||
./gitea
|
||||
./qbittorrent
|
||||
./nginx-proxy
|
||||
# ./arr/prowlarr
|
||||
# ./arr/flaresolverr
|
||||
# ./arr/bazarr
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user