Skip to content

Instantly share code, notes, and snippets.

{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
let
inherit (stdenv.lib) optionals;
isCross = stdenv.buildPlatform != stdenv.hostPlatform;
in
stdenv.mkDerivation {
pname = "raspberrypi-armstubs";
version = "2020-10-08";
// code is MIT licensed etc etc copyright 2018 @puckipedia
// - dsmrv5 parser / @yorickvp
// -- Libraries used --
#pragma GCC diagnostic warning "-Wall"
#pragma GCC diagnostic warning "-Wextra"
// ESP8266 OTA
#include <ArduinoOTA.h>
// look I'm not going to pay for a signal inverter. hooray for software
#define INVERT_SERIAL
@yorickvP
yorickvP / build-portable-image.nix
Last active October 21, 2020 09:04
build-portabled-image
{ pkgs ? import <nixpkgs> {}, runCommandNoCC ? pkgs.runCommandNoCC }:
{
name,
config,
extraMountDirs ? [],
extraMountFiles ? []
}:
let
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
{ stdenvNoCC, fetchFromGitHub, telink-825x-sdk, tc32-gcc, python3 }:
stdenvNoCC.mkDerivation {
pname = "ATC_Thermometer";
version = "20201003";
src = "${fetchFromGitHub {
owner = "atc1441";
repo = "ATC_MiThermometer";
rev = "772348a2266ea22bd58795314be148a8154e6462";
sha256 = "05ggw0c61fbhw751c5icpv31i0cjk2nx5nmnkixid07ajsmhb7fw";
}}/ATC_Thermometer";
@yorickvP
yorickvP / tr1.txt
Last active September 20, 2020 10:32
[nix-shell:~]$ seq 1000 | perf stat -e r002c:u,r0225:u,r0425:u,r0825:u,r0e25:u sort > /dev/null
Performance counter stats for 'sort':
1 r002c:u
2 r0225:u
43 r0425:u
84 r0825:u
129 r0e25:u
@yorickvP
yorickvP / default.nix
Last active May 29, 2020 19:24
nix-reason-react-starter-build
let
pkgs = import <nixpkgs> {};
nix-npm-buildpackage = pkgs.callPackage (builtins.fetchTarball "https://github.com/yorickvp/nix-npm-buildpackage/archive/yorickvp/packageOverrides.tar.gz") {};
in
nix-npm-buildpackage.buildNpmPackage {
src = ./.;
installJavascript = false;
packageOverrides = {
bs-platform = pkgs.bs-platform;
};
{ pkgs ? import <nixpkgs> { }, stdenv ? pkgs.stdenv, love_0_7 ? pkgs.love_0_7 }:
let
name = "nottetris2";
src = pkgs.fetchzip {
url = "http://stabyourself.net/dl.php?file=${name}/${name}-linux.zip";
sha256 = "1zwwp4h1njwl3jnwkszcsqx868v16312pbfy5rp9h48ym79spd36";
stripRoot = false;
};
in pkgs.writeShellScriptBin name ''
exec ${love_0_7}/bin/love "${src}/Not Tetris 2.love"
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix
index 85305e84266..91301d6a199 100644
--- a/pkgs/servers/sql/postgresql/default.nix
+++ b/pkgs/servers/sql/postgresql/default.nix
@@ -28,7 +28,7 @@ let
inherit sha256;
};
- outputs = [ "out" "lib" "doc" "man" ];
+ outputs = [ "out" "lib" "doc" "man" "dev" ];
@yorickvP
yorickvP / omnidb-pkg.sh
Last active April 7, 2020 13:01
omnidb-python.nix
poetry init
cat requirements.txt | perl -pe 's/([<=>]+)/:$1/' | xargs -t -n 1 -I {} poetry add '{}'