Squash merge refactor into main

This commit is contained in:
danny 2025-08-09 22:22:19 +08:00
parent 529c9e5fa7
commit b82cd59f4f
35 changed files with 498 additions and 358 deletions

View file

@ -29,7 +29,7 @@ in
after = [ "networking-online.target" ];
serviceConfig = {
ExecStart = "${pkgs.uxplay}/bin/uxplay ${
optionalString (hostname != null) "-n ${hostname} -nh -hls 3"
optionalString (hostname != null) "-n ${hostname} -fs -fps 60 -nh"
} -p";
};
};

View file

@ -0,0 +1,31 @@
{
pkgs,
username,
...
}:
let
scriptBin = pkgs.writeShellScriptBin "davinci-resolve" ''
ROC_ENABLE_PRE_VEGA=1 RUSTICL_ENABLE=amdgpu,amdgpu-pro,radv,radeon DRI_PRIME=1 QT_QPA_PLATFORM=xcb ${pkgs.davinci-resolve}/bin/davinci-resolve
'';
in
{
environment.systemPackages = [
scriptBin
];
home-manager.users."${username}" = {
xdg.desktopEntries."davindi-resolve" = {
name = "Davinci Resolve";
genericName = "Video Editor";
exec = "${scriptBin}/bin/davinci-resolve";
icon = "${pkgs.davinci-resolve}/share/icons/hicolor/128x128/apps/davinci-resolve.png";
comment = "Professional video editing, color, effects and audio post-processing";
categories = [
"AudioVideo"
"AudioVideoEditing"
"Video"
"Graphics"
];
};
};
}

View file

@ -3,7 +3,7 @@
programs = {
obs-studio = {
enable = true;
enableVirtualCamera = true;
enableVirtualCamera = false; # Handled by webcam.nix
plugins = with pkgs.obs-studio-plugins; [
wlrobs
obs-backgroundremoval

View file

@ -17,5 +17,6 @@
../tmux.nix
../ca.nix
../sops-nix.nix
../gc.nix
];
}

View file

@ -1,7 +1,7 @@
{
settings,
lib,
pkgs,
username,
...
}:
@ -19,12 +19,13 @@
enable = true;
packages = [ pkgs.gcr ];
};
openssh = {
enable = true;
ports = [ 22 ];
settings = {
PasswordAuthentication = lib.mkDefault false;
AllowUsers = lib.mkDefault [ settings.personal.username ];
AllowUsers = lib.mkDefault [ username ];
UseDns = lib.mkDefault true;
PermitRootLogin = lib.mkDefault "no";
};

View file

@ -1,13 +1,12 @@
{
settings,
pkgs,
lib,
config,
username,
...
}:
{
users.users.${settings.personal.username} = {
users.users.${username} = {
isNormalUser = true;
shell = pkgs.bash; # Actually fish
extraGroups = (

View file

@ -1,5 +1,5 @@
{ username }:
{
settings,
pkgs,
config,
...
@ -7,7 +7,7 @@
{
programs.virt-manager.enable = true;
users.groups.libvirtd.members = [ settings.personal.username ];
users.groups.libvirtd.members = [ username ];
virtualisation = {
docker.enable = true;

17
system/modules/webcam.nix Normal file
View file

@ -0,0 +1,17 @@
# Use WebRTC to stream
{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
ffmpeg
v4l-utils
];
boot = {
kernelModules = [ "v4l2loopback" ];
extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
};
boot.extraModprobeConfig = ''
options v4l2loopback devices=2 video_nr=1,2 card_label="OBS Cam","phone webRTC cam" exclusive_caps=1,1
'';
}