This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
-- | Simple wrapper on top of simpleBot | |
-- adding applicative parser | |
-- and `runBotWithParts` shorthand. | |
-- | |
-- `runBotWithParts` allows passing | |
-- initialization function that inits | |
-- all bot parts and returns them as list. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self: super: | |
let src = "https://github.com/sorki/git-post-receive/archive/master.tar.gz"; | |
ovr = (import "${builtins.fetchTarball src}/overlay.nix"); | |
in { | |
haskellPackages = super.haskellPackages.override (old: { | |
overrides = super.lib.composeExtensions (old.overrides or (_: _: { })) | |
ovr; | |
}); | |
ghcjs = super.haskell.packages.ghcjs.override { | |
overrides = helf: huper: (ovr helf huper // (with self.haskell.lib; { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Network.ZRE.Chan ( | |
zreChan | |
) where | |
import Control.Monad.IO.Class (liftIO) | |
import Control.Concurrent.STM (TChan) | |
import Data.Serialize (Serialize) | |
import Data.ZRE (Group) | |
import qualified Control.Concurrent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ config, pkgs, lib, ... }: | |
let | |
nixpkgs = /home/srk/git/nixpkgs; | |
in | |
{ | |
imports = | |
[ | |
"${nixpkgs}/nixos/modules/services/web-apps/discourse.nix" | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc883" }: | |
let | |
futhark = nixpkgs.haskell.packages.${compiler}.futhark; | |
in | |
nixpkgs.haskell.lib.overrideCabal | |
futhark | |
( oldDrv: { | |
isLibrary = false; | |
enableSharedExecutables = false; | |
enableSharedLibraries = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash -x | |
CROSS_PREFIX=arm-none-eabi- | |
${CROSS_PREFIX}ld -b binary -r -o raw.elf DiscoveryAudioUSB.bin | |
${CROSS_PREFIX}objcopy --rename-section .data=.text \ | |
--set-section-flags .data=alloc,code,load raw.elf | |
${CROSS_PREFIX}ld raw.elf -T stm32_flash.ld -o usbaudio.elf | |
${CROSS_PREFIX}strip -s usbaudio.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Monad | |
import qualified Data.ByteString.Char8 as BSC | |
import System.Nix.Internal.StorePath | |
import Network.HTTP.Client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.udev.extraRules = '' | |
# Access to /dev/bus/usb/* devices. Needed for virt-manager USB | |
# redirection. | |
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664", GROUP="wheel" | |
# fine grained | |
#SUBSYSTEM=="usb", ATTR{idVendor}=="0925", ATTR{idProduct}=="3881", GROUP="users", MODE="0777" | |
''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hardware.deviceTree.overlays = [ | |
{ name = "spi"; dtsFile = ./dt/spi.dts; } | |
{ name = "pps"; | |
dtsText = '' | |
/dts-v1/; | |
/plugin/; | |
/ { | |
compatible = "raspberrypi"; | |
fragment@0 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reflowDict :: Dict | |
reflowDict = dict "reflow" $ do | |
at 0x6000 $ field "temperature" float & ro | |
at 0x6001 $ field "temperature_target" float | |
at 0x6002 $ field "control_effort" float & ro | |
at 0x6100 $ field "pid_p" float | |
at 0x6101 $ field "pid_i" float | |
at 0x6102 $ field "pid_d" float | |
at 0x61FF $ field "pid_reset" bool |