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
|
# flake for blakes nixos config
|
||||||
# define new devices in outputs
|
# 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";
|
description = "blakes nix config";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|||||||
@@ -6,23 +6,23 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.homelab = {
|
options.modules.homelab = {
|
||||||
enable = lib.mkEnableOption "enable homelab services and configuration"
|
enable = lib.mkEnableOption "enable homelab services and configuration";
|
||||||
media_user = lib.mkOption = {
|
media_user = lib.mkOption {
|
||||||
default = "media";
|
default = "media";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "user for media file permissions";
|
description = "user for media file permissions";
|
||||||
};
|
};
|
||||||
media_group = lib.mkOption = {
|
media_group = lib.mkOption {
|
||||||
default = "media";
|
default = "media";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "group for media file permissions";
|
description = "group for media file permissions";
|
||||||
};
|
};
|
||||||
tz = lib.mkOption = {
|
tz = lib.mkOption {
|
||||||
default = "America/Chicago";
|
default = "America/Chicago";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "set timezone";
|
description = "set timezone";
|
||||||
};
|
};
|
||||||
base_domain = lib.mkOption = {
|
base_domain = lib.mkOption {
|
||||||
default = "snowbelle.lan";
|
default = "snowbelle.lan";
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "base domain used for reverse proxy";
|
description = "base domain used for reverse proxy";
|
||||||
@@ -31,6 +31,9 @@ in
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./services
|
./services
|
||||||
|
./shares/nfs.nix
|
||||||
|
./shares/smb.nix
|
||||||
|
./shares/zfs.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
@@ -43,6 +46,6 @@ in
|
|||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ let
|
|||||||
service = "sonarr";
|
service = "sonarr";
|
||||||
cfg = config.modules.services.${service};
|
cfg = config.modules.services.${service};
|
||||||
sec = config.sops.secrets;
|
sec = config.sops.secrets;
|
||||||
homelab = config.homelab;
|
homelab = config.modules.homelab;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.services.${service} = {
|
options.modules.services.${service} = {
|
||||||
@@ -14,11 +14,11 @@ in
|
|||||||
port = lib.mkOption {
|
port = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = 7107;
|
default = 7107;
|
||||||
description = "set port for ${service} (default: ${toString default_port}";
|
description = "set port for ${service} (default: ${toString cfg.port}";
|
||||||
};
|
};
|
||||||
url = lib.mkOption {
|
url = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "${service}.${homelab.basedomain}";
|
default = "${service}.${homelab.base_domain}";
|
||||||
description = "set domain for ${service} reverse proxy entry";
|
description = "set domain for ${service} reverse proxy entry";
|
||||||
};
|
};
|
||||||
data_dir = lib.mkOption {
|
data_dir = lib.mkOption {
|
||||||
@@ -28,7 +28,7 @@ in
|
|||||||
};
|
};
|
||||||
ids = lib.mkOption {
|
ids = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = ${port};
|
default = cfg.port;
|
||||||
description = "set uid and pid of ${service} user (matches port by default)";
|
description = "set uid and pid of ${service} user (matches port by default)";
|
||||||
};
|
};
|
||||||
backup = lib.mkOption {
|
backup = lib.mkOption {
|
||||||
@@ -41,12 +41,12 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# declare ${service} group
|
# declare ${service} group
|
||||||
users.groups.${service} = { gid = cfg.ids; };
|
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
|
||||||
|
|
||||||
# declare ${service} user
|
# declare ${service} user
|
||||||
users.users.${service} = {
|
users.users.${service} = {
|
||||||
description = "${service} server user";
|
description = "${service} server user";
|
||||||
uid = cfg.ids;
|
uid = lib.mkForce cfg.ids;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
home = cfg.data_dir;
|
home = cfg.data_dir;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
@@ -75,7 +75,7 @@ in
|
|||||||
# networking.firewall.allowedTCPPorts = [ cfg.port ];
|
# networking.firewall.allowedTCPPorts = [ cfg.port ];
|
||||||
|
|
||||||
# internal reverse proxy entry
|
# internal reverse proxy entry
|
||||||
services.nginx.virtualHosts."${url}" = {
|
services.nginx.virtualHosts."${cfg.url}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
sslCertificate = sec."ssl_blakedheld_crt".path;
|
sslCertificate = sec."ssl_blakedheld_crt".path;
|
||||||
sslCertificateKey = sec."ssl_blakedheld_key".path;
|
sslCertificateKey = sec."ssl_blakedheld_key".path;
|
||||||
@@ -4,10 +4,11 @@
|
|||||||
{
|
{
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
# ./jellyfin
|
./jellyfin
|
||||||
# ./vaultwarden
|
./vaultwarden
|
||||||
# ./gitea
|
./gitea
|
||||||
# ./qbittorrent
|
./qbittorrent
|
||||||
|
./nginx-proxy
|
||||||
# ./arr/prowlarr
|
# ./arr/prowlarr
|
||||||
# ./arr/flaresolverr
|
# ./arr/flaresolverr
|
||||||
# ./arr/bazarr
|
# ./arr/bazarr
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ let
|
|||||||
service = "";
|
service = "";
|
||||||
cfg = config.modules.services.${service};
|
cfg = config.modules.services.${service};
|
||||||
sec = config.sops.secrets;
|
sec = config.sops.secrets;
|
||||||
homelab = config.homelab;
|
homelab = config.modules.homelab;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.services.${service} = {
|
options.modules.services.${service} = {
|
||||||
@@ -14,11 +14,11 @@ in
|
|||||||
port = lib.mkOption {
|
port = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = <port>;
|
default = <port>;
|
||||||
description = "set port for ${service} (default: ${toString default_port}";
|
description = "set port for ${service} (default: ${toString cfg.port}";
|
||||||
};
|
};
|
||||||
url = lib.mkOption {
|
url = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "${service}.${homelab.basedomain}";
|
default = "${service}.${homelab.base_domain}";
|
||||||
description = "set domain for ${service}";
|
description = "set domain for ${service}";
|
||||||
};
|
};
|
||||||
data_dir = lib.mkOption {
|
data_dir = lib.mkOption {
|
||||||
@@ -28,7 +28,7 @@ in
|
|||||||
};
|
};
|
||||||
ids = lib.mkOption {
|
ids = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
default = ${port};
|
default = cfg.port;
|
||||||
description = "set uid and pid of ${service} user (matches port by default)";
|
description = "set uid and pid of ${service} user (matches port by default)";
|
||||||
};
|
};
|
||||||
backup = lib.mkOption {
|
backup = lib.mkOption {
|
||||||
@@ -41,12 +41,12 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
# declare ${service} group
|
# declare ${service} group
|
||||||
users.groups.${service} = { gid = cfg.ids; };
|
users.groups.${service} = { gid = lib.mkForce cfg.ids; };
|
||||||
|
|
||||||
# declare ${service} user
|
# declare ${service} user
|
||||||
users.users.${service} = {
|
users.users.${service} = {
|
||||||
description = "${service} server user";
|
description = "${service} server user";
|
||||||
uid = cfg.ids;
|
uid = lib.mkForce cfg.ids;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
home = cfg.data_dir;
|
home = cfg.data_dir;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user