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 / 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";
};
@sorki
sorki / log.txt
Last active July 19, 2020 10:14
supercollider sc3plugins
-> SuperDirt
loading synthdefs in /home/srk/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/core-modules.scd
---- core synth defs loaded ----
loading synthdefs in /home/srk/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/core-synths-global.scd
loading synthdefs in /home/srk/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/core-synths.scd
loading synthdefs in /home/srk/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/default-synths.scd
exception in GraphDef_Recv: exceeded number of interconnect buffers.
WARNING: SynthDef superfm too big for sending. Retrying via synthdef file
loading synthdefs in /home/srk/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/try-load-extra-synths.scd
loading synthdefs in /home/srk/.local/share/SuperCollider/downloaded-quarks/SuperDirt/classes/../synths/tutorial-synths.scd
@sorki
sorki / A.hs
Created June 12, 2020 12:14
hnix-store-polysemy
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE LambdaCase, BlockArguments #-}
{-# LANGUAGE GADTs, FlexibleContexts, TypeOperators, DataKinds, PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
module System.Nix.Store.Poly where
import Polysemy
import Polysemy.Error
main/Repl.hs:75:31: error:
• Could not deduce (MonadException
(Control.Monad.Trans.State.Lazy.StateT
(M.HashMap FilePath NExprLoc) m))
arising from a use of ‘controlIO’
from the context: MonadException m
bound by the instance declaration at main/Repl.hs:74:10-63
There are instances for similar types:
instance MonadException m =>
MonadException (StateT (M.HashMap FilePath NExprLoc) m)