Compare commits

...

5 Commits

Author SHA1 Message Date
fb1970c316 Upgrade librechat
All checks were successful
Check Flake / check-flake (push) Successful in 6m43s
2025-02-17 12:12:46 -08:00
34f1edf3b3 Fix s0 setting the incorrect default route by using a static configuration 2025-02-17 12:11:52 -08:00
823f0a6ef2 Disable frigate detect for now. It is using excessive CPU 2025-02-17 12:10:59 -08:00
00d2ccc684 Fix sound in some games running in wine 2025-02-17 12:09:51 -08:00
b2acaff783 Fix pykms by downgrading to python 3.11 2025-02-17 12:09:20 -08:00
6 changed files with 155 additions and 11 deletions

View File

@ -22,8 +22,8 @@ in
services.pipewire.extraConfig.pipewire."92-fix-wine-audio" = { services.pipewire.extraConfig.pipewire."92-fix-wine-audio" = {
context.properties = { context.properties = {
default.clock.rate = 48000; default.clock.rate = 48000;
default.clock.quantum = 2048; default.clock.quantum = 256;
default.clock.min-quantum = 512; default.clock.min-quantum = 256;
default.clock.max-quantum = 2048; default.clock.max-quantum = 2048;
}; };
}; };

View File

@ -21,7 +21,7 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
virtualisation.oci-containers.containers = { virtualisation.oci-containers.containers = {
librechat = { librechat = {
image = "ghcr.io/danny-avila/librechat:v0.6.6"; image = "ghcr.io/danny-avila/librechat:v0.7.6";
environment = { environment = {
HOST = "0.0.0.0"; HOST = "0.0.0.0";
MONGO_URI = "mongodb://host.containers.internal:27017/LibreChat"; MONGO_URI = "mongodb://host.containers.internal:27017/LibreChat";

View File

@ -36,6 +36,11 @@ let
record = "preset-record-generic-audio-copy"; record = "preset-record-generic-audio-copy";
}; };
}; };
detect = {
width = 1280;
height = 720;
fps = 5;
};
}; };
}; };
services.go2rtc.settings.streams = lib.mkMerge [ services.go2rtc.settings.streams = lib.mkMerge [
@ -54,7 +59,7 @@ let
# - go2rtc: ${VAR} # - go2rtc: ${VAR}
# - frigate: {VAR} # - frigate: {VAR}
primaryUrl = "rtsp://admin:\${FRIGATE_RTSP_PASSWORD}@${address}/cam/realmonitor?channel=1&subtype=0"; primaryUrl = "rtsp://admin:\${FRIGATE_RTSP_PASSWORD}@${address}/cam/realmonitor?channel=1&subtype=0";
detectUrl = "rtsp://admin:{FRIGATE_RTSP_PASSWORD}@${address}/cam/realmonitor?channel=1&subtype=1"; detectUrl = "rtsp://admin:{FRIGATE_RTSP_PASSWORD}@${address}/cam/realmonitor?channel=1&subtype=3";
in in
mkCamera name primaryUrl detectUrl; mkCamera name primaryUrl detectUrl;
@ -95,8 +100,9 @@ lib.mkMerge [
enabled = true; enabled = true;
# sync_recordings = true; # detect if recordings were deleted outside of frigate (expensive) # sync_recordings = true; # detect if recordings were deleted outside of frigate (expensive)
retain = { retain = {
days = 2; # Keep video for 2 days days = 7; # Keep video for 7 days
mode = "motion"; mode = "all";
# mode = "motion";
}; };
events = { events = {
retain = { retain = {
@ -108,7 +114,7 @@ lib.mkMerge [
}; };
# Make frigate aware of the go2rtc streams # Make frigate aware of the go2rtc streams
go2rtc.streams = config.services.go2rtc.settings.streams; go2rtc.streams = config.services.go2rtc.settings.streams;
detect.enabled = true; detect.enabled = false; # :(
objects = { objects = {
track = [ "person" "dog" ]; track = [ "person" "dog" ];
}; };

View File

@ -58,12 +58,43 @@
}; };
swapDevices = [ ]; swapDevices = [ ];
networking.vlans = { networking = {
iot = { dhcpcd.enable = false;
id = 2;
interface = "eth1"; vlans = {
iot = {
id = 2;
interface = "eth1";
};
}; };
interfaces.eth1.ipv4.addresses = [{
address = "192.168.1.2";
prefixLength = 21;
}];
interfaces.iot.ipv4.addresses = [{
address = "192.168.9.8";
prefixLength = 22;
}];
defaultGateway = "192.168.1.1";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
}; };
# networking = {
# vlans = {
# iot = {
# id = 2;
# interface = "eth1";
# };
# };
# defaultGateway = {
# interface = "eth1";
# address = "192.168.1.1";
# metric = 10; # always use this route as default gateway
# };
# };
powerManagement.cpuFreqGovernor = "powersave"; powerManagement.cpuFreqGovernor = "powersave";
} }

View File

@ -6,4 +6,8 @@ let
in in
{ {
actual-server = prev.callPackage ./actualbudget { }; actual-server = prev.callPackage ./actualbudget { };
# Copied entire package from nixpkgs to downgrade to python 3.11 since 3.12 is broken.
# See: https://github.com/Py-KMS-Organization/py-kms/issues/117
pykms = prev.callPackage ./pykms.nix { };
} }

103
overlays/pykms.nix Normal file
View File

@ -0,0 +1,103 @@
{ lib
, fetchFromGitHub
, python311
, writeText
, writeShellScript
, sqlite
, nixosTests
}:
let
pypkgs = python311.pkgs;
dbSql = writeText "create_pykms_db.sql" ''
CREATE TABLE clients(
clientMachineId TEXT,
machineName TEXT,
applicationId TEXT,
skuId TEXT,
licenseStatus TEXT,
lastRequestTime INTEGER,
kmsEpid TEXT,
requestCount INTEGER
);
'';
dbScript = writeShellScript "create_pykms_db.sh" ''
set -eEuo pipefail
db=''${1:-/var/lib/pykms/clients.db}
if [ ! -e $db ] ; then
${lib.getBin sqlite}/bin/sqlite3 $db < ${dbSql}
fi
'';
in
pypkgs.buildPythonApplication rec {
pname = "pykms";
version = "unstable-2024-05-28";
src = fetchFromGitHub {
owner = "Py-KMS-Organization";
repo = "py-kms";
rev = "646f4766f4195dbea0695700a7ddaac70a3294f9";
hash = "sha256-YCqPo7WkCfXyuTjL4IYapdcUN/Vj465Jz6XhQessyz0=";
};
sourceRoot = "${src.name}/py-kms";
propagatedBuildInputs = with pypkgs; [
systemd
pytz
tzlocal
dnspython
];
postPatch = ''
siteDir=$out/${python311.sitePackages}
substituteInPlace pykms_DB2Dict.py \
--replace "'KmsDataBase.xml'" "'$siteDir/KmsDataBase.xml'"
'';
format = "other";
# there are no tests
doCheck = false;
installPhase = ''
runHook preInstall
mkdir -p $siteDir
PYTHONPATH="$PYTHONPATH:$siteDir"
mv * $siteDir
for b in Client Server ; do
makeWrapper ${python311.interpreter} $out/bin/''${b,,} \
--argv0 pykms-''${b,,} \
--add-flags $siteDir/pykms_$b.py \
--set PYTHONPATH $PYTHONPATH
done
install -Dm755 ${dbScript} $out/libexec/create_pykms_db.sh
install -Dm644 ../README.md -t $out/share/doc/pykms
${python311.interpreter} -m compileall $siteDir
runHook postInstall
'';
passthru.tests = { inherit (nixosTests) pykms; };
meta = with lib; {
description = "Windows KMS (Key Management Service) server written in Python";
homepage = "https://github.com/Py-KMS-Organization/py-kms";
license = licenses.unlicense;
maintainers = with maintainers; [
peterhoeg
zopieux
];
};
}