Did you know that it is rather easy to setup a VM to test your NixOs configuration?
# flake.nix
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
.compose-form__publish-button-wrapper .button--block { | |
font-size: 0px; | |
} | |
.compose-form__publish-button-wrapper .button--block::after { | |
content: "Toot!"; | |
font-size: 15px; | |
vertical-align: middle; | |
color: #fff; | |
} |
#! /usr/bin/env nix-shell | |
#! nix-shell -i sh -p coreutils findutils gnused ripgrep strace | |
# Usage ./get-command-nix-deps.sh ./script.sh 10s | |
timeout "$2" strace -qqfe execve sh -c "$1" 2>&1 >/dev/null | \ | |
rg '(/nix/store|/run/current-system/sw/bin)' | \ | |
sed -E 's=.*execve\("(\/.*)", \[.*=\1=g' | \ | |
xargs readlink -f | sort -u | \ | |
sed -E 's=/nix/store/[0-9a-z]*-(.*)-(.*)/.*/.*=\1 (\2)=g' | sort -u | |
iperf3
serverwg-quick down wg0
/etc/wireguard/wg0.conf
file{ lib, config, pkgs, ... }: | |
with lib; | |
{ | |
options.v4l2 = mkEnableOption "Enable the confguration to use the reflex as a webcam"; | |
config = mkIf config.v4l2 { | |
# 20.03: v4l2loopback 0.12.5 is required for kernel >= 5.5 | |
# https://github.com/umlaeute/v4l2loopback/issues/257 |
#!/usr/bin/env python | |
from sys import argv, stdout | |
from os import system, remove, path | |
from urlparse import urlparse | |
import re | |
import dfu | |
import ssl | |
import math | |
import json | |
import getopt |
sudo LIBVA_DRIVER_NAME=iHD ffmpeg -crtc_id 69 -framerate 60 -f kmsgrab -i - -vaapi_device /dev/dri/renderD128 -filter:v hwmap,scale_vaapi=w=1920:h=1200:format=nv12 -c:v h264_vaapi -profile:v constrained_baseline -level:v 3.1 -b:v 20000k test.mp4
LIBVA_DRIVER_NAME=iHD ffmpeg -device /dev/dri/card0 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi -vstats output.mp4
#!/usr/bin/python | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
PORT_NUMBER = 31337 | |
class myHandler(BaseHTTPRequestHandler): | |
#Handler for the GET requests | |
def do_GET(self): | |
self.send_response(200) |
# First add this module to your /etc/nixos/configuration.nix | |
# ... | |
# imports = [ /path/to/iphone.nix ]; | |
# iphone.enable = true; | |
# iphone.user = "yourusername"; | |
# ... | |
# Then rebuild system. Attach iPhone via cable, open terminal and run command `iphone` | |
# It will fail, but there will occure a dialog on your iPhone to "trust this computer" | |
# Press OK there and run `iphone` again. If it succeeds it will open a freshly mounted folder |