46 current 2025-10-07 20:04:53 25.05.20251001.5b5be50 6.12.49 *
This commit is contained in:
@@ -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: 45 current 2025-10-07 20:03:56 25.05.20251001.5b5be50 6.12.49 *
|
# generation: 46 current 2025-10-07 20:04:53 25.05.20251001.5b5be50 6.12.49 *
|
||||||
{
|
{
|
||||||
description = "blakes nix config";
|
description = "blakes nix config";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
|||||||
@@ -32,6 +32,8 @@
|
|||||||
jellyfin.enable = true;
|
jellyfin.enable = true;
|
||||||
sonarr.enable = true;
|
sonarr.enable = true;
|
||||||
sonarr.port = 7105;
|
sonarr.port = 7105;
|
||||||
|
prowlarr.enable = true;
|
||||||
|
prowlarr.port = 7104;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
{ pkgs, config, lib, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.<service_name>;
|
|
||||||
ids = <gid_and_uid_number>;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.modules.services.<service_name> = {
|
|
||||||
enable = lib.mkEnableOption "enables <service_name>";
|
|
||||||
# extra options
|
|
||||||
# mode = lib.mkOption {
|
|
||||||
# type = lib.types.enum [ "server" "client" ];
|
|
||||||
# default = "client";
|
|
||||||
# description = "whether syncthing should run as a client (user) or server (system-wide).";
|
|
||||||
# };
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
|
|
||||||
# declare <service_name> group
|
|
||||||
users.groups.<service_name> = { gid = ids; };
|
|
||||||
|
|
||||||
# declare <service_name> user
|
|
||||||
users.users.<service_name> = {
|
|
||||||
description = "<service_name> media server user";
|
|
||||||
uid = ids;
|
|
||||||
isSystemUser = true;
|
|
||||||
home = "/var/lib/<service_name>";
|
|
||||||
createHome = true;
|
|
||||||
group = "<service_name>";
|
|
||||||
extraGroups = [ "media" "video" "render" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# enable the <service_name> service
|
|
||||||
services.<service_name> = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true; # Opens 8096/8920 automatically
|
|
||||||
user = "<service_name>"; # Default: <service_name>
|
|
||||||
group = "<service_name>"; # Default: <service_name>
|
|
||||||
dataDir = "/var/lib/<service_name>"; # Config + metadata storage
|
|
||||||
};
|
|
||||||
|
|
||||||
# override umask to make permissions work out
|
|
||||||
systemd.services.<service_name>.serviceConfig = { UMask = lib.mkForce "0007"; };
|
|
||||||
|
|
||||||
# open firewall
|
|
||||||
#networking.firewall.allowedTCPPorts = [ 8096 ];
|
|
||||||
|
|
||||||
# reverse proxy entryo
|
|
||||||
services.nginx.virtualHosts."media.blakedheld.xyz" = {
|
|
||||||
enableACME = false;
|
|
||||||
forceSSL = true;
|
|
||||||
sslCertificate = config.sops.secrets."ssl_blakedheld_crt".path;
|
|
||||||
sslCertificateKey = config.sops.secrets."ssl_blakedheld_key".path;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://127.0.0.1:8096";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -5,10 +5,12 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./jellyfin/default.nix
|
./jellyfin/default.nix
|
||||||
|
./arr/prowlarr/default.nix
|
||||||
./arr/sonarr/default.nix
|
./arr/sonarr/default.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
modules.services.jellyfin.enable = lib.mkDefault false;
|
modules.services.jellyfin.enable = lib.mkDefault false;
|
||||||
|
modules.services.prowlarr.enable = lib.mkDefault false;
|
||||||
modules.services.sonarr.enable = lib.mkDefault false;
|
modules.services.sonarr.enable = lib.mkDefault false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user