Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile
@573
573 / readme.md
Created June 12, 2024 12:16
usb wsl debugging

see dorssel/usbipd-win#973

# sc.exe start usbipd  # admin pwsh
$ usbipd bind --busid 1-2 # pwsh

# \# meaning with sudo, $ meaning regular wsl
$ sudo -i systemctl start wsl-vpnkit
$ sudo systemctl stop usbip-auto-attach@1-2.service

# usbip list --remote="$(grep nameserver /etc/resolv.conf | cut -d' ' -f2)"
@573
573 / readme.md
Last active June 12, 2024 09:25
Run desktop apps wayland X11 in NixOS-WSL WSL wslg

what i also did but can't tell the impact right now

in ubuntu wsl:

wsl --install
cat /proc/mounts
sudo mount -o remount,rw /tmp/.X11-unix
sudo umount /tmp/.X11-unix
sudo rm /tmp/.X11-unix/ -rf
ln -s /mnt/wslg/.X11-unix/X0 /tmp/.X11-unix/
@573
573 / readme.md
Last active June 11, 2024 09:14
update microsoft windows win10 packages
@573
573 / readme.md
Last active June 11, 2024 08:04
usb scanner in wsl with nixos-wsl howto

in WSL, regular user should work

usbip list --remote="$(grep nameserver /etc/resolv.conf | cut -d' ' -f2)"
Exportable USB devices
======================
 - 172.23.128.1
        1-2: Canon, Inc. : CanoScan N1240U/LiDE 30 (04a9:220e)
           : USB\VID_04A9&PID_220E\5&665DA22&0&2
           : Vendor Specific Class / unknown subclass / unknown protocol (ff/00/ff)
           :  0 - Vendor Specific Class / unknown subclass / unknown protocol (ff/00/ff)
@573
573 / readme.md
Created June 7, 2024 14:28
nix tip: recover nix-on-droid keeping home files
@573
573 / write_up.md
Created June 3, 2024 16:14 — forked from udf/write_up.md
A Trick To Use mkMerge at The Top Level of a NixOS module

The Setup

I wanted to write a module that generates multiple systemd services and timers to scrub some zfs pools at certain intervals. The default scrub config does not support individual scrub intervals for each pool.

I want the config to look like this:

{
  services.zfs-auto-scrub = {
 tank = "Sat *-*-* 00:00:00";
@573
573 / nixbuild.nix
Created June 2, 2024 20:40 — forked from stepbrobd/nixbuild.nix
distributed build with nixbuild.net for nix-darwin
let
nixbuildDomain = "eu.nixbuild.net";
nixbuildKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPIQCZc54poJ8vqawd8TraNryQeJnvH1eLpIDgbiqymM";
nixbuildPlatforms = [ "x86_64-linux" "aarch64-linux" ];
nixbuildFeatures = [ "big-parallel" "benchmark" "kvm" "nixos-test" ];
nixbuildSSH = ''
Host eu.nixbuild.net
PubkeyAcceptedKeyTypes ssh-ed25519
ServerAliveInterval 60
IPQoS throughput
@573
573 / readme.md
Last active June 8, 2024 18:48
Using nixbuild.net as remote builder for aarch64-linux

On an Archlinux with nix:

  • Put all the files in place as mentioned in https://docs.nixbuild.net/getting-started/ (for user root / nix-daemon)
  • Important passwordless key root-readable for builder access and optional regular pubkey for shell access
  • Important chmod 0600 ~/.ssh/my-nixbuild-key and all three files in /root and readable by root:
  • .ssh/keyfile
  • .ssh/config
  • .ssh/known_hosts
  • the call has to contain --system on non-NixOS when for another architecture is built, i. e.:
@573
573 / readme.md
Created May 31, 2024 14:51
postgres postgresql psql nix shell nixpkgs

nix shell nixpkgs#postgresql -c psql -h ipaddress -U username -d dbname