Compare commits

...

6 Commits

Author SHA1 Message Date
f8ee011d27 Attempt to fix custom package format 2025-10-13 14:25:23 -07:00
4a4ea6316d [app-launcher] Add app-launcher to boxy 2025-10-13 14:25:13 -07:00
b75c43257b [zix790prors] Increase boot partition size 2025-10-04 09:06:18 -07:00
63d741e55e [media] Use delfin instead of jellyfin
This is potentially temporary. But jellyfin-media-player has been
flagged as having a security problem by using an old version of
qtwebengine. So we'll maybe find time to try out delfin or maybe just
wait until the security issue gets fixed or maybe just use the web
browser. We have options
2025-10-01 21:35:18 -07:00
9ed3ad8fb8 Fix linux builds after nix-darwin updates 2025-10-01 21:35:18 -07:00
330cd6f92b Add /boot partition expansion plan and temporary configurationLimit fix
- Add comprehensive BOOT_EXPANSION_PLAN.md with step-by-step instructions for safely expanding /boot from 100MB to 1GB
- Temporarily reduce configurationLimit to 1 to resolve immediate /boot space crisis
- Plan supports 20 generations (configurationLimit = 20) after expansion
- Uses safe approach: shrink /games partition, create new EFI partition
- Includes full recovery context and troubleshooting information

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 21:35:18 -07:00
9 changed files with 160 additions and 11 deletions

View File

@@ -10,11 +10,17 @@ let
sha256 = "sha256-vHwgENjip2+AFzs4oZfnKEAJKwf5Zid7fakImvxxQUw="; sha256 = "sha256-vHwgENjip2+AFzs4oZfnKEAJKwf5Zid7fakImvxxQUw=";
}; };
# Default emacs configuration with vterm support # Shared emacs packages
defaultEmacsPackage = pkgs.emacs-macport.pkgs.withPackages (epkgs: [ emacsPackages = epkgs: [
epkgs.vterm epkgs.vterm
epkgs.treesit-grammars.with-all-grammars epkgs.treesit-grammars.with-all-grammars
]); ];
# Default emacs configuration with vterm support
defaultEmacsPackage =
if pkgs.stdenv.isDarwin
then pkgs.emacs-macport.pkgs.withPackages emacsPackages
else pkgs.emacs.pkgs.withPackages emacsPackages;
in in
{ {
config = { config = {

View File

@@ -12,9 +12,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ home.packages = [
claude-code pkgs.claude-code
codex pkgs.codex
goose-cli pkgs.goose-cli
# Custom packages # Custom packages
customPkgs.tea-rbw customPkgs.tea-rbw

View File

@@ -13,7 +13,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
# Media players and streaming # Media players and streaming
jellyfin-media-player # Using delfin instead of jellyfin-media-player to avoid qtwebengine security issues
# For full Jellyfin features, use web interface at http://jellyfin-server:8096
delfin
moonlight-qt moonlight-qt
vlc vlc
]; ];

View File

@@ -34,7 +34,7 @@ with lib;
# Use the systemd-boot EFI boot loader. # Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.systemd-boot.configurationLimit = 2; # Reduced to save /boot space (TODO Increase /boot partition size) boot.loader.systemd-boot.configurationLimit = 20;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
boot.loader.timeout = 10; boot.loader.timeout = 10;

View File

@@ -14,7 +14,7 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/boot" = fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/76B0-738E"; { device = "/dev/disk/by-uuid/11C1-EB58";
fsType = "vfat"; fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ]; options = [ "fmask=0077" "dmask=0077" ];
}; };

View File

@@ -0,0 +1,104 @@
#!/usr/bin/env python3
import json
import logging
import os
import subprocess
import sys
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
# Allowlisted applications that can be launched
ALLOWED_APPS = {
'firefox': 'firefox',
'kodi': 'kodi'
}
class AppLauncherHandler(BaseHTTPRequestHandler):
def log_message(self, format, *args):
logger.info(format % args)
def do_GET(self):
if self.path == '/':
self.send_response(200)
self.send_header('Content-type', 'application/json')
self.end_headers()
response = {
'status': 'running',
'available_apps': list(ALLOWED_APPS.keys()),
'usage': 'POST /launch/<app_name> to launch an application'
}
self.wfile.write(json.dumps(response, indent=2).encode())
else:
self.send_error(404)
def do_POST(self):
parsed_path = urlparse(self.path)
path_parts = parsed_path.path.strip('/').split('/')
if len(path_parts) == 2 and path_parts[0] == 'launch':
app_name = path_parts[1]
self.launch_app(app_name)
else:
self.send_error(404, "Invalid endpoint. Use /launch/<app_name>")
def launch_app(self, app_name):
if app_name not in ALLOWED_APPS:
self.send_error(400, f"Application '{app_name}' not allowed. Available apps: {list(ALLOWED_APPS.keys())}")
return
command = ALLOWED_APPS[app_name]
try:
# Launch the application in the background
# Ensure we have the proper environment for GUI apps
env = os.environ.copy()
logger.info(f"Launching application: {command}")
process = subprocess.Popen(
[command],
env=env,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
start_new_session=True
)
self.send_response(200)
self.send_header('Content-type', 'application/json')
self.end_headers()
response = {
'status': 'success',
'message': f'Successfully launched {app_name}',
'pid': process.pid
}
self.wfile.write(json.dumps(response).encode())
except FileNotFoundError:
logger.error(f"Application not found: {command}")
self.send_error(500, f"Application '{app_name}' not found on system")
except Exception as e:
logger.error(f"Error launching {command}: {e}")
self.send_error(500, f"Failed to launch {app_name}: {str(e)}")
def main():
port = int(sys.argv[1]) if len(sys.argv) > 1 else 8081
server = HTTPServer(('0.0.0.0', port), AppLauncherHandler)
logger.info(f"App launcher server starting on port {port}")
logger.info(f"Available applications: {list(ALLOWED_APPS.keys())}")
try:
server.serve_forever()
except KeyboardInterrupt:
logger.info("Server shutting down...")
server.server_close()
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,5 @@
{ pkgs }:
pkgs.writeShellScriptBin "app-launcher-server" ''
exec ${pkgs.python3}/bin/python3 ${./app-launcher-server.py} "$@"
''

View File

@@ -2,4 +2,5 @@
{ {
vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {}; vulkanHDRLayer = pkgs.callPackage ./vulkan-hdr-layer {};
tea-rbw = pkgs.callPackage ./tea-rbw {}; tea-rbw = pkgs.callPackage ./tea-rbw {};
app-launcher-server = pkgs.callPackage ./app-launcher-server {};
} }

View File

@@ -4,6 +4,7 @@ with lib;
let let
cfg = config.roles.kodi; cfg = config.roles.kodi;
customPkgs = pkgs.callPackage ../../packages {};
in in
{ {
options.roles.kodi = { options.roles.kodi = {
@@ -14,6 +15,18 @@ in
wayland = mkOption { wayland = mkOption {
default = true; default = true;
}; };
appLauncherServer = {
enable = mkOption {
type = types.bool;
default = true;
description = "Enable HTTP app launcher server for remote control";
};
port = mkOption {
type = types.int;
default = 8081;
description = "Port for the app launcher HTTP server";
};
};
}; };
@@ -33,17 +46,35 @@ in
}; };
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 8080 ]; allowedTCPPorts = [ 8080 ] ++ optional cfg.appLauncherServer.enable cfg.appLauncherServer.port;
allowedUDPPorts = [ 8080 ]; allowedUDPPorts = [ 8080 ];
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
kodiPkg kodiPkg
wget wget
]; firefox
] ++ optional cfg.appLauncherServer.enable customPkgs.app-launcher-server;
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
systemd.user.services = mkIf cfg.appLauncherServer.enable {
app-launcher-server = {
description = "HTTP App Launcher Server";
wantedBy = [ "graphical-session.target" ];
after = [ "graphical-session.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${customPkgs.app-launcher-server}/bin/app-launcher-server ${toString cfg.appLauncherServer.port}";
Restart = "always";
RestartSec = "5s";
Environment = [
"PATH=${pkgs.firefox}/bin:${kodiPkg}/bin:/run/current-system/sw/bin"
];
};
};
};
services = if cfg.autologin then { services = if cfg.autologin then {
displayManager = { displayManager = {
autoLogin.enable = true; autoLogin.enable = true;