migrate pepe services to chungus

This commit is contained in:
Ingolf Wagner 2023-05-05 22:33:05 +02:00
parent fdbc5679e8
commit 51bccd5b74
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
10 changed files with 170 additions and 34 deletions

View file

@ -37,6 +37,7 @@ let
"tts.chungus" = hosts.chungus; "tts.chungus" = hosts.chungus;
"tdarr.chungus" = hosts.chungus; "tdarr.chungus" = hosts.chungus;
"sync.chungus" = hosts.chungus; "sync.chungus" = hosts.chungus;
"flix.chungus" = hosts.chungus;
}; };
network = "private"; network = "private";
in in

View file

@ -5,23 +5,26 @@
./hardware-configuration.nix ./hardware-configuration.nix
../../system/server ../../system/server
./disko-config.nix ./disko-config.nix
./packages.nix ./packages.nix
./tinc.nix
#./mail-fetcher.nix #./network-wireguard.nix
#./hass.nix ./network-tinc.nix
#./zigbee2mqtt.nix
./hass.nix
./hass-zigbee2mqtt.nix
./hass-mqtt.nix
#./hass-wifi.nix
#./syncthing.nix #./syncthing.nix
#./wifi-access-point.nix #./mail-fetcher.nix
#./borg.nix #./borg.nix
#./taskwarrior-pushover.nix #./taskwarrior-pushover.nix
./tdarr.nix ./media-share.nix
#./jellyfin.nix ./media-tdarr.nix
./media-jellyfin.nix
#./wireguard.nix
# logging # logging
./loki.nix ./loki.nix

View file

@ -0,0 +1,15 @@
{ lib, ... }: {
services.mosquitto = {
enable = true;
listeners = [{
acl = [ "pattern readwrite #" ];
omitPasswordAuth = true;
settings.allow_anonymous = true;
}];
};
# open for tasmota
networking.firewall.allowedTCPPorts = [ 1883 ];
}

View file

@ -0,0 +1,56 @@
{ pkgs, lib, config, private_assets, ... }:
{
imports = [ ./hass-mqtt.nix ];
services.zigbee2mqtt = {
enable = true;
dataDir = "/srv/zigbee2mqtt";
settings = {
# Home Assistant integration (MQTT discovery)
homeassistant = true;
# allow new devices to join
permit_join = false;
# MQTT settings
mqtt = {
# MQTT base topic for zigbee2mqtt MQTT messages
base_topic = "zigbee2mqtt";
# MQTT server URL
server = "mqtt://127.0.0.1:1883";
# MQTT server authentication, uncomment if required:
user = "zigbee";
password = lib.fileContents "${private_assets}/zigbee/home-assistant-password";
};
# Serial settings
serial = {
#port = "/dev/ttyACM0";
port = "/dev/ttyUSB0";
# disable LED of CC2531 USB sniffer
#disable_led = true;
};
# you own network key,
# 16 numbers between 0 and 255
# see https://www.zigbee2mqtt.io/how_tos/how_to_secure_network.html
advanced = {
network_key = import "${private_assets}/zigbee/networkKey.nix";
log_output = [ "console" ];
log_level = "warn";
pan_id = 1337;
# add last seen information
last_seen = "ISO_8601_local";
};
# configure web ui
frontend.port = 9666;
frontend.host = "0.0.0.0";
experimental.new_api = true;
};
};
}

View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
{
virtualisation.oci-containers = {
containers.homeassistant = {
volumes = [ "/srv/home-assistant:/config" ];
environment.TZ = "Europe/Berlin";
image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
extraOptions = [ "--network=host" ];
};
};
networking.firewall.allowedTCPPorts = [ 8123 ];
networking.firewall.allowedUDPPorts = [ 8123 ];
}

View file

@ -0,0 +1,34 @@
{ config, lib, pkgs, ... }:
{
services.jellyfin = {
enable = true;
openFirewall = true;
group = "media";
user = "media";
};
#hardware.opengl = {
# enable = true;
# driSupport = true;
# driSupport32Bit = true;
#};
services.nginx = {
enable = true;
virtualHosts."flix.${config.networking.hostName}.private" = {
serverAliases = [ "flix.${config.networking.hostName}" ];
extraConfig = ''
# Security / XSS Mitigation Headers
# NOTE: X-Frame-Options may cause issues with the webOS app
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
'';
locations."/" = {
recommendedProxySettings = true;
proxyWebsockets = true;
proxyPass = "http://localhost:8096";
};
};
};
}

View file

@ -0,0 +1,28 @@
{ config, ... }:
{
# To set password:
# nix-shell -p samba --run "smbpasswd -a media"
custom.samba-share.enable = true;
custom.samba-share.private = {
media = {
folder = "/media";
users = "media";
};
temp = {
folder = "/srv/tdarr/transcode_cache";
users = "media";
};
};
users.groups."media".gid = config.ids.gids.transmission;
users.users."media" = {
uid = config.ids.uids.transmission;
group = "media";
};
services.permown."/media" = {
owner = "media";
group = "media";
};
}

View file

@ -1,28 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
# To set password:
# nix-shell -p samba --run "smbpasswd -a media"
custom.samba-share.enable = true;
custom.samba-share.private.media = {
folder = "/media";
users = "media";
};
users.groups."media".gid = config.ids.gids.transmission;
users.users."media" = {
uid = config.ids.uids.transmission;
group = "media";
};
services.permown."/media" = {
owner = "media";
group = "media";
};
# https://docs.tdarr.io/docs/installation/docker/run-compose # https://docs.tdarr.io/docs/installation/docker/run-compose
virtualisation.oci-containers = { virtualisation.oci-containers = {
# backend = "podman";
containers.tdarr = { containers.tdarr = {
volumes = [ volumes = [
"/srv/tdarr/server:/app/server" "/srv/tdarr/server:/app/server"
@ -39,8 +19,8 @@
inContainer = "true"; inContainer = "true";
nodeName = "ServerNode"; nodeName = "ServerNode";
TZ = "Europe/London"; TZ = "Europe/London";
PUID = toString config.ids.uids.transmission; PUID = toString config.users.users.media.uid;
PGID = toString config.ids.gids.transmission; PGID = toString config.users.groups.media.gid;
}; };
ports = [ ports = [
"8265:8265" # WebUI "8265:8265" # WebUI

View file

@ -7,8 +7,10 @@
./mail-fetcher.nix ./mail-fetcher.nix
./packages.nix ./packages.nix
./hass.nix
./zigbee2mqtt.nix #./hass.nix
#./zigbee2mqtt.nix
#./kodi.nix #./kodi.nix
./syncthing.nix ./syncthing.nix
./tinc.nix ./tinc.nix
@ -32,7 +34,8 @@
./telegraf.nix ./telegraf.nix
./home-display.nix ./home-display.nix
./tdarr.nix
#./tdarr.nix
]; ];