From 6021a9e22f99bb9b19134e2cb443bdeba852edc6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 27 Mar 2021 18:46:45 +0100 Subject: =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- accounts/gkleen@sif/xmonad/xmonad.hs | 2 +- accounts/gkleen@sif/zshrc | 17 ++++++++++++++--- hosts/sif/default.nix | 11 +++++++++-- hosts/sif/hw.nix | 1 - overlays/v4l2loopback.nix | 37 ++++++++++++++++++++++++++++++++++++ 5 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 overlays/v4l2loopback.nix diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs index 425beaf4..8282ed3f 100644 --- a/accounts/gkleen@sif/xmonad/xmonad.hs +++ b/accounts/gkleen@sif/xmonad/xmonad.hs @@ -199,7 +199,7 @@ hostFromName h , assign' ["work", "uni"] $ className =? "jetbrains-idea-ce" , assign "read" $ className =? "llpp" , assign "read" $ className =? "Evince" - , assign "read" $ fmap ("zathura" `isInfixOf`) title + , assign "read" $ className =? "Zathura" , assign "read" $ className =? "MuPDF" , assign "read" $ className =? "Xournal" , assign "read" $ appName =? "com-trollworks-gcs-app-GCS" diff --git a/accounts/gkleen@sif/zshrc b/accounts/gkleen@sif/zshrc index c65e35f9..fd1f1002 100644 --- a/accounts/gkleen@sif/zshrc +++ b/accounts/gkleen@sif/zshrc @@ -1,9 +1,20 @@ filebin() { basePath=/srv/www/files - ssh ymir find "${basePath}" -type f -print0 \ - | while IFS= read -r -d $'\0' p; do - printf "https://f.141.li/%s\n" "${p#${basePath}/}" + ssh ymir find /srv/www/files -type f -printf "$'%T@ %TY-%Tm-%TdT%TH:%TM %P\\\\0'" | sort -zn | cut -z -d ' ' -f 2- \ + | while IFS= read -r -d $'\0' l; do + IFS=' ' read -r t p <<<"${l}" + printf "%s https://f.141.li/%s\n" "${t}" "${p}" + done +} + +push2bin() { + if [[ ${#@} -eq 1 && ! -r ${1} ]]; then + uux -p 'ymir!push2bin' $(echo -n "${1:t}" | tr -c $'[:alnum:]+-=.' '_') + else + for f (${@}); do + uux -p 'ymir!push2bin' $(echo -n "${f:t}" | tr -c $'[:alnum:]+-=.' '_') <${f} done + fi } genmail() { diff --git a/hosts/sif/default.nix b/hosts/sif/default.nix index 2c3c9e3d..737dad36 100644 --- a/hosts/sif/default.nix +++ b/hosts/sif/default.nix @@ -38,6 +38,7 @@ kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ "i915.fastboot=1" "intel_pstate=no_hwp" "acpi_backlight=vendor" "thinkpad-acpi.brightness_enable=1" "quiet" ]; extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; + kernelModules = ["v4l2loopback"]; tmpOnTmpfs = true; }; @@ -54,6 +55,8 @@ allowedTCPPorts = [ 22 # ssh 8000 # quickserve ]; + allowedUDPPorts = [ 8554 # gopro webcam + ]; }; networkmanager = { @@ -81,10 +84,14 @@ ''; }; - powerManagement.enable = true; + powerManagement = { + enable = true; + + cpuFreqGovernor = "schedutil"; + }; environment.systemPackages = with pkgs; [ - nvtop brightnessctl + nvtop brightnessctl config.boot.kernelPackages.v4l2loopback s-tui ]; services = { diff --git a/hosts/sif/hw.nix b/hosts/sif/hw.nix index 4a3e6c86..92afb7c9 100644 --- a/hosts/sif/hw.nix +++ b/hosts/sif/hw.nix @@ -26,7 +26,6 @@ ]; nix.maxJobs = 12; - powerManagement.cpuFreqGovernor = "powersave"; # High-DPI console console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; diff --git a/overlays/v4l2loopback.nix b/overlays/v4l2loopback.nix new file mode 100644 index 00000000..335f86a3 --- /dev/null +++ b/overlays/v4l2loopback.nix @@ -0,0 +1,37 @@ +final: prev: { + linuxPackages_latest = prev.linuxPackages_latest.extend (self: super: { + v4l2loopback = super.stdenv.mkDerivation rec { + name = "v4l2loopback-${version}-${self.kernel.version}"; + version = "f62fb9076b6313e5eb82fdcaceadb6b3052f346e"; + + src = prev.fetchFromGitHub { + owner = "umlaeute"; + repo = "v4l2loopback"; + rev = "${version}"; + sha256 = "VRFtimQQtT8vd1dx5KtUDkmXo3DSOybhNLcAIxQba44="; + fetchSubmodules = true; + }; + + hardeningDisable = [ "format" "pic" ]; + + preBuild = '' + substituteInPlace Makefile --replace "modules_install" "INSTALL_MOD_PATH=$out modules_install" + sed -i '/depmod/d' Makefile + export PATH=${final.kmod}/sbin:$PATH + ''; + + nativeBuildInputs = self.kernel.moduleBuildDependencies; + buildInputs = [ final.kmod ]; + + makeFlags = [ + "KERNELRELEASE=${self.kernel.modDirVersion}" + "KERNEL_DIR=${self.kernel.dev}/lib/modules/${self.kernel.modDirVersion}/build" + ]; + + postInstall = '' + mkdir -p $out/bin + install -m0755 utils/v4l2loopback-ctl $out/bin + ''; + }; + }); +} -- cgit v1.2.3