Skip to content

Instantly share code, notes, and snippets.

View edef1c's full-sized avatar

edef edef1c

  • Earth
View GitHub Profile
@edef1c
edef1c / default.nix
Last active July 12, 2023 10:09
NixOS module for qemu-user binfmt_misc
{ pkgs, ... }:
let inherit (pkgs) stdenv qemu getopt; in
{
systemd.additionalUpstreamSystemUnits = [
"proc-sys-fs-binfmt_misc.automount"
"proc-sys-fs-binfmt_misc.mount"
];
environment.etc."binfmt.d/qemu-user.conf".source = stdenv.mkDerivation {
name = "qemu-binfmt";
inherit (qemu) src;
@edef1c
edef1c / gist:e1d3dba34d04bec5f8afac6ce815aed0
Last active July 29, 2022 23:36
rustc incremental fingerprint ICE
edef@jaguar ~/s/u/s/ripple (trunk)> cargo test --workspace
Compiling minitrace v0.0.0 (/home/src/unfathomable/src/ripple/minitrace)
Compiling fossil v0.1.0 (/home/src/unfathomable/src/ripple/fossil)
error: internal compiler error: encountered incremental compilation error with def_ident_span(minitrace[a978]::{impl#69}::fmt::__BitFlags::NONBLOCK)
|
= help: This is a known issue with the compiler. Run `cargo clean -p minitrace` or `cargo clean` to allow your project to compile
= note: Please follow the instructions below to create a bug report with the provided information
= note: See <https://github.com/rust-lang/rust/issues/84970> for more information
thread 'rustc' panicked at 'Found unstable fingerprints for def_ident_span(minitrace[a978]::{impl#69}::fmt::__BitFlags::NONBLOCK): Some(minitrace/src/main.rs:574:9: 574:17 (#0))', compiler/rustc_query_system/src/query/plumbing.rs:657:9
@edef1c
edef1c / default.nix
Last active April 20, 2022 06:32
DNS-over-HTTPS module for NixOS
{ pkgs, ... }:
let
doh-proxy = pkgs.callPackage ./doh-proxy.nix {};
in {
systemd.sockets.doh-stub = {
wantedBy = [ "sockets.target" ];
socketConfig.Service = "doh-stub.service";
socketConfig.ListenDatagram = "[::1]:53";
};
systemd.services.doh-stub = {
@edef1c
edef1c / 0001-key-dumping.patch
Last active April 10, 2022 17:22
wireguard-go key dumping patch
From 4181bdea33c11bc0209f1951315107cf0fcff11a Mon Sep 17 00:00:00 2001
From: edef <edef@edef.eu>
Date: Sun, 10 Apr 2022 17:19:29 +0000
Subject: [PATCH] key dumping
Same output format as extract-keys.sh
Signed-off-by: edef <edef@edef.eu>
---
device/noise-protocol.go | 15 +++++++++++++++
@edef1c
edef1c / Makefile
Created August 17, 2021 11:59 — forked from glandium/Makefile
Linux kernel module for Zen workaround for rr
obj-m = zen_workaround.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@edef1c
edef1c / 0001-Linux-consider-ZFS-ARC-to-be-cache.patch
Last active May 20, 2020 14:09
ZFS on Linux ARC support patch for htop (multi's revised version)
From 78ade158ed480a6958fd6d477ee90f2bd2d1f668 Mon Sep 17 00:00:00 2001
From: multiplexd <multi@in-addr.xyz>
Date: Sat, 9 May 2020 20:31:35 +0100
Subject: [PATCH v2] Linux: consider ZFS ARC to be cache
This patch adds an arcSize member to the ProcessList struct, and then
adjusts the usedMem and cachedMem values when the memory usage meter is
initialised in Platform_setMemoryValues(), and not earlier.
---
ProcessList.c | 1 +
building '/nix/store/s103zvdl4nrsi24vl0xvsjmdcphab79m-unit-nix-daemon.service.drv'...
building '/nix/store/4sni1imp36r5mj8vjgphngx2p14aqm1x-system-units.drv'...
building '/nix/store/zf3ypcls84l6pmf516krf888in81syhp-etc.drv'...
building '/nix/store/xxyk1rn73xss107wapp71nkrmdqc1kcg-nixos-system-platypus-20.03pre-git.drv'...
stopping the following units: nix-daemon.service, nix-daemon.socket
activating the configuration...
setting up /etc...
error: cannot connect to daemon at '/nix/var/nix/daemon-socket/socket': Connection refused
Activation script snippet 'nix' failed (1)
reloading user units for edef...
@edef1c
edef1c / env-necessary.pl
Last active October 20, 2019 16:29
perl script to check what environment variables a program actually needs to run
#! /usr/bin/env perl
use POSIX ":sys_wait_h";
my @untested = keys %ENV;
sub choose {
return splice @untested, rand @untested, 1;
}
sub works {
@edef1c
edef1c / ugdb-overlay.nix
Created October 18, 2019 07:21
ugdb packaged for Nix
self: super:
with self;
with rustPlatform;
{
ugdb = buildRustPackage rec {
pname = "ugdb";
version = "0.1.4";
src = fetchFromGitHub {
owner = "ftilde";