adding yacreader

This commit is contained in:
2025-10-12 16:09:41 -05:00
parent b89c6a14cc
commit abcad5c9f2
5 changed files with 32 additions and 24 deletions

View File

@@ -1,13 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
echo "searching generations"
# your hostname (flake target)
hostname="$(hostname)"
old_gen=$(nixos-rebuild list-generations | grep current | awk '{print $1}')
gen=$((old_gen + 1))
echo "gen $old_gen --> gen $gen"
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
nix_dir="$HOME/.nix"
logfile="$nix_dir/.nixos-switch-log"
pushd "$nix_dir" >/dev/null
# function to get current nixos generation
@@ -17,6 +21,8 @@ get_current_generation() {
echo "diffs:"
git diff
echo ""
echo "files:"
git status --short
read -rp "commit message: " commit_msg
echo "rebuilding nixos with flake.nix..."

View File

@@ -1,6 +1,6 @@
# flake for blakes nixos config
# define new devices in outputs
# generation: 367, timestamp: 2025-10-12 15:34:36
# generation: 368, timestamp: 2025-10-12 16:09:13
{
description = "blakes nix config";
inputs = {

View File

@@ -35,6 +35,7 @@ in
caddy.enable = true;
jellyfin.enable = true;
audiobookshelf.enable = true;
yacreader.enable = true;
vaultwarden.enable = true;
gitea.enable = true;
glance.enable = true;

View File

@@ -10,12 +10,13 @@
./gitea
./home/homeassistant
./immich
./arr/prowlarr
./arr/bazarr
./arr/prowlarr
./arr/radarr
./arr/sonarr
./audiobookshelf
./qbittorrent
./arr/sonarr
./yacreader
./audiobookshelf
./jellyfin
./caddy
./arr/flaresolverr

View File

@@ -50,35 +50,34 @@ in
isSystemUser = true;
home = cfg.data_dir;
createHome = true;
group = "${service}";
group = service;
extraGroups = [ "media" ];
};
# enable the ${service} service
services.${service} = {
enable = true;
openFirewall = true;
user = "${service}";
group = "${service}";
dataDir = cfg.data_dir;
settings = {
server.port = cfg.port;
};
};
systemd.services.${service} = {
description = "${service} library server";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
# override umask to make permissions work out
systemd.services.${service}.serviceConfig = {
serviceConfig = {
UMask = lib.mkForce "0007";
# User = "${service}";
# Group = "${service}";
User = service;
Group = service;
Restart = "always";
RestartSec = "5s";
Type = "simple";
ExecStart = "${pkgs.yacreader}/bin/YACReaderLibraryServer start --port ${toString cfg.port}";
WorkingDirectory = "/var/lib/yacreader";
TimeoutStopSec = "20s";
};
};
# # open firewall
# networking.firewall.allowedTCPPorts = [ cfg.port ];
# open firewall
networking.firewall.allowedTCPPorts = [ cfg.port ];
# add to glance local service
modules.services.glance.links.<category> = [{
modules.services.glance.links.mediastack = [{
title = service;
url = "https://${cfg.url}";
error-url = "http://${homelab.host_ip}:${toString cfg.port}";
@@ -98,3 +97,4 @@ in
};
};
}