Skip to content

Instantly share code, notes, and snippets.

@Atemu
Atemu / PKGBUILD.patch
Created September 11, 2018 13:14
Support aarch64 for qemu-user-static
--- PKGBUILD 2018-09-11 13:04:32.129183905 +0000
+++ PKGBUILD.new 2018-09-11 12:44:41.211983309 +0000
@@ -5,7 +5,7 @@
pkgver=2.12
pkgrel=4
pkgdesc="A generic and open source processor emulator which achieves a good emulation speed by using dynamic translation, statically linked."
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'armv7h')
license=('GPL2' 'LGPL2.1')
url="http://wiki.qemu.org/Index.html"
@Atemu
Atemu / rotate_desktop.sh
Created March 4, 2019 20:59 — forked from mildmojo/rotate_desktop.sh
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
@Atemu
Atemu / README.md
Created December 7, 2019 09:35 — forked from CRTified/README.md
VFIO Passthrough on NixOS

VFIO Setup on NixOS

Disclaimer: Nobody else tested my setup so far, so this is a "works on my machine" scenario. I am not responsible for anything you break on your machine (although I'd not expect much harm).

Hardware

My system has the following hardware:

  • Board: Asus ROG Strix Z270G
{ pkgs ? import <nixpkgs> { }, ... }:
pkgs.qt5.callPackage ./gammy.nix { }
IOMMU Group 0:
00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:591f] (rev 05)
IOMMU Group 1:
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 05)
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1)
IOMMU Group 10:
00:1d.0 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #9 [8086:a298] (rev f0)
IOMMU Group 11:
00:1f.0 ISA bridge [0601]: Intel Corporation 200 Series PCH LPC Controller (Z270) [8086:a2c5]
IOMMU Group 0:
00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse PCIe Dummy Host Bridge [1022:1482]
IOMMU Group 1:
00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse GPP Bridge [1022:1483]
IOMMU Group 10:
00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Starship/Matisse Internal PCIe GPP Bridge 0 to bus[E:B] [1022:1484]
IOMMU Group 11:
00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 12:
@Atemu
Atemu / filter.nix
Created November 2, 2020 17:35
Filter out subsets of Nixpkgs' top-level pkgs attribute
{ pkgs ? import <nixpkgs> { } }:
with pkgs.lib;
with builtins;
rec {
canEval = x: with (tryEval x); success && (value != false);
sanitise = set: filterAttrs (n: v: canEval v) set;
attrsOf = filterAttrs (n: v: isAttrs v);
@Atemu
Atemu / log
Created December 15, 2020 07:42
python3 pkgsCross.talloc build fail
# project talloc (2.3.1) configured on Tue Dec 15 07:31:42 2020 by
# waf 2.0.18 (abi 20, python 30806f0 on linux)
# using buildtools/bin/waf --prefix=/nix/store/cs5dhs5cgm2lglx8gc9d8wdlajvj0sg8-talloc-2.3.1-armv7l-unknown-linux-gnueabihf --enable-talloc-compat1 --bundled-libraries=NONE --builtin-libraries=replace configure
#
----------------------------------------
Setting top to
/build/talloc-2.3.1
----------------------------------------
Setting out to
/build/talloc-2.3.1/bin
This file has been truncated, but you can view the full file.
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Build type choices are:
1. release
@Atemu
Atemu / pkgsStatic.gcc.log
Created February 4, 2021 08:01
pkgsStatic.gcc build error
$CPATH is `/nix/store/s7p0w6j2529xf8xz23bbyph54n8v0lx5-zlib-1.2.11-x86_64-unknown-linux-musl-dev/include'
$LIBRARY_PATH is `/nix/store/jwzfw458lf9865xs5xlr163kakbf67vj-zlib-1.2.11-x86_64-unknown-linux-musl/lib'
/nix/store/4k7n61apbmyw8wxh0914nyixpig7cia7-builder.sh: line 39: /nix/store/6d8d0za7w183nkrhcg58icmc3p0yxx1n-binutils-wrapper-2.35.1/nix-support/libc-ldflags-before: No such file or directory
/nix/store/4k7n61apbmyw8wxh0914nyixpig7cia7-builder.sh: line 39: /nix/store/1dp66xpwdmj9dv16zc3ip4iggdx8cl7h-x86_64-unknown-linux-musl-binutils-wrapper-2.35.1/nix-support/libc-ldflags-before: No such file or directory
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/5gcbkcivmhbhdr10xww80s84dv69a364-gcc-10.2.0.tar.xz
source root is gcc-10.2.0
setting SOURCE_DATE_EPOCH to timestamp 1595487003 of file gcc-10.2.0/MD5SUMS
@nix { "action": "setPhase", "phase": "patchPhase" }