Skip to content

Instantly share code, notes, and snippets.

View sorki's full-sized avatar
🦊
Tying the Knots

Sorki sorki

🦊
Tying the Knots
View GitHub Profile
@sorki
sorki / log.txt
Created February 23, 2021 13:21
NIX_PATH=nixpkgs=$( pwd ) nix-build nixos/tests/qemu-guest-agent.nix
starting VDE switch for network 1
running the VM test script
starting all VMs
machine: starting vm
machine # Formatting '/build/vm-state-machine/machine.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=536870912 lazy_refcounts=off refcount_bits=16
machine: QEMU running (pid 10)
(0.04 seconds)
machine: waiting for the X11 server
machine: waiting for the VM to finish booting
machine # c[?7lSeaBIOS (version rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org)
@sorki
sorki / bt.txt
Created February 23, 2021 08:28
lool dump
[root@vmlool:~]# coredumpctl debug
PID: 1775 (kit_spare_001)
UID: 997 (lool)
GID: 998 (lool)
Signal: 6 (ABRT)
Timestamp: Mon 2021-02-22 22:17:43 CET (5s ago)
Command Line: /run/wrappers/bin/loolforkit --losubpath=lo --systemplate=/var/lib/lool/systemplate --lotemplate=/var/lib/lool/lotemplate --childroot=/var/lib/lool/child-roots/ --clientport=9980 --masterport=loolwsd-dPpP0Kk9 --rlimits=limit_virt_mem_mb:0;limit_stack_mem_kb:8000;limit_file_size_mb:0;limit_num_open_files:0 --version
Executable: /nix/store/xy9ddi8gxdsqpd0vrrfx0ld1l4pagh3s-libreoffice-online-7.0.1.1/bin/loolforkit
Control Group: /system.slice/loolwsd.service
Unit: loolwsd.service
@sorki
sorki / containers-nested.nix
Created February 22, 2021 10:47
nested NixOS containers
import <nixpkgs/nixos/tests/make-test-python.nix> ({pkgs, ...}: rec {
name = "nesting";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ sorki ];
};
machine = { lib, ... }:
let makeNested = subConf: {
boot.enableContainers = true;
@sorki
sorki / wireguard-nat.nix
Created February 22, 2021 10:46
wireguard nat test
{ system ? builtins.currentSystem
, config ? {}
, pkgs ? import <nixpkgs> { inherit system config; }
, lib ? pkgs.lib
}:
let
inherit (import "${pkgs.path}/nixos/lib/testing-python.nix" { inherit system pkgs; }) makeTest;
#wg-snakeoil-keys = import <nixpkgs/nixos/tests/wireguard/snakeoil-keys.nix>;
#peer = (import <nixpkgs/nixos/tests/wireguard/make-peer.nix>) { inherit lib; };
@sorki
sorki / default.nix
Created February 21, 2021 19:49
scoped self-import
let
roundTwo = builtins.hasAttr "inScope" builtins;
pinnedPath = builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/2b973d233906fb0483263bca71bb789cad61513e.tar.gz";
sha256 = "11h21zsas7xgdax6xs2lh3mz8spvdk8i63czysr4p69yir1h1cd7";
};
in
if roundTwo
then throw "yep - ${<nixpkgs>}"
else
@sorki
sorki / callNode2nix.nix
Created January 8, 2021 13:35
callNode2nix.nix
{ pkgs ? import <nixpkgs> {}, ... }:
# experiment based on https://github.com/MatrixAI/TypeScript-Demo-Lib/pull/13
# needs `--option sandbox false` so not used for now
with pkgs;
let
callNode2nix = name: src: { nodeVersion ? builtins.elemAt (lib.versions.splitVersion nodejs.version) 0 }:
let
@sorki
sorki / o.nix
Created November 9, 2020 14:27
Overlay list
nixpkgs.overlays = [
# local would be
(import ./nixos-novena/overlay.nix modulesPath)
# remote
(import "${ builtins.fetchTarball { url = "https://github.com/novena-next/nixos-novena/archive/master.tar.gz"; }}/overlay.nix" modulesPath)
# some other
(self: super: { mpv-unwrapped = super.mpv-unwrapped.override { sambaSupport = false; }; })
]
@sorki
sorki / y
Created September 24, 2020 10:30
it6251-dump-dptx
[nix-shell:/etc/nixos/it6251-dump-dptx]# ./it6251-dump-dptx
reg0E = 90, Link Rate = HBRreg0D = 3e, HPD Video Stable
frequency = 27648000, xCnt = 1
Data Enable start: (114, 30)
Modeline "1920x1080" 27.648 1920 2004 2050 2080 1080 1106 1108 1112 -HSync -VSync
00000000 00 ff ff ff ff ff ff 00 0d ae 43 13 00 00 00 00 |..........C.....|
00000010 34 15 01 04 a5 1c 10 78 02 93 ad a9 53 4c 96 25 |4......x....SL.%|
00000020 11 4f 53 00 00 00 01 01 01 01 01 01 01 01 01 01 |.OS.............|
00000030 01 01 01 01 01 01 36 36 80 a0 70 38 20 40 2e 1e |......66..p8 @..|
00000040 24 00 1a a5 10 00 00 18 24 24 80 a0 70 38 20 40 |$.......$$..p8 @|
@sorki
sorki / binGHCsDiff.diff
Last active September 24, 2020 10:34
diff -u pkgs/development/compilers/ghc/8.6.5-binary.nix pkgs/development/compilers/ghc/8.10.2-binary.nix
--- pkgs/development/compilers/ghc/8.6.5-binary.nix 2020-09-08 09:38:38.112547979 +0200
+++ pkgs/development/compilers/ghc/8.10.2-binary.nix 2020-09-24 12:26:35.216890173 +0200
@@ -1,6 +1,6 @@
{ stdenv
, fetchurl, perl, gcc
-, ncurses5, gmp, glibc, libiconv
+, ncurses6, gmp, glibc, libiconv
, llvmPackages
}:
@sorki
sorki / configuration.nix
Created August 25, 2020 14:13
rpi cross
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix>
];
nixpkgs = {
crossSystem.system = "armv7l-linux";
};