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
let # invert is O(n^2); it's not obvious to me that we can do much better without a lot of work | |
# invert :: Map a [b] -> Map b [a] | |
invert = m: | |
let allBs = builtins.concatLists (builtins.attrValues m); | |
exploded = builtins.concatMap (a: map (b: { ${b} = a; }) m.${a}) (builtins.attrNames m); | |
in builtins.listToAttrs (map (b: { name = b; value = builtins.catAttrs b exploded; }) allBs); | |
# Given a package that installs .desktop files in the usual location, | |
# return a mapping from mime types to lists of desktop file names. | |
# This is suitable for use in home-manager's | |
# xdg.mimeApps.defaultApplications. |
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
{ runCommand, patchelf, coreutils, binutils-unwrapped, find-libs }: | |
targetPrefix: inputPackage: | |
runCommand (inputPackage.pname + "-portable") { | |
inherit inputPackage targetPrefix; | |
} '' | |
set -euo pipefail | |
cp -a "$inputPackage" "$out" |
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
$ gcc acltest.c && sudo strace -f ./a.out | |
execve("./a.out", ["./a.out"], 0x7ffe03614de8 /* 17 vars */) = 0 | |
brk(NULL) = 0x1189000 | |
access("/etc/ld-nix.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
openat(AT_FDCWD, "/nix/store/n0axl4pks91d841aivjqm3m0gmdj3f2h-shell/lib64/tls/x86_64/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/nix/store/n0axl4pks91d841aivjqm3m0gmdj3f2h-shell/lib64/tls/x86_64/x86_64", 0x7fffea8d7150) = -1 ENOENT (No such file or directory) | |
openat(AT_FDCWD, "/nix/store/n0axl4pks91d841aivjqm3m0gmdj3f2h-shell/lib64/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/nix/store/n0axl4pks91d841aivjqm3m0gmdj3f2h-shell/lib64/tls/x86_64", 0x7fffea8d7150) = -1 ENOENT (No such file or directory) | |
openat(AT_FDCWD, "/nix/store/n0axl4pks91d841aivjqm3m0gmdj3f2h-shell/lib64/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/nix/store/n0axl4pks91d841aivjq |
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
unpacking sources | |
unpacking source archive /nix/store/c36x4l6a4raqxc9krkf3nbrv4kwfxk3h-source | |
source root is source | |
patching sources | |
applying patch /nix/store/bn2glwzfc4dwdqzbdsyd9jawn9f694vr-1230afb211f85e0cdf5fb10c9becf318cd626d88...nixos-zfs-2018-08-13.patch | |
patching file .github/PULL_REQUEST_TEMPLATE.md | |
patching file cmd/zdb/zdb.c | |
patching file cmd/zed/agents/zfs_mod.c | |
patching file cmd/zpool/zpool_main.c | |
patching file cmd/ztest/ztest.c |
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, lib, pkgs, ... }: | |
#TODO: Hairpinning | |
#TODO: WiFi AP | |
# - NAT | |
# - DHCP | |
with lib; | |
let externalInterface = "enp1s0"; |
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 #-} | |
{-# LANGUAGE RecursiveDo #-} | |
import Control.Monad (ap) | |
import Control.Monad.Trans (lift) | |
import Data.Semigroup (First (..)) | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Reflex.Dom | |
newtype MonoidalWidget t m e = MonoidalWidget { unMonoidalWidget :: EventWriterT t (First e) m () } |
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
{ stdenv, fetchurl, cups, dpkg, ghostscript, patchelf, a2ps, coreutils, gnused, gawk, file }: | |
let version = "1.1.2-1"; | |
printerName = "hl3170cdw"; | |
lprDownloadId = "007056"; | |
cupswrapperDownloadId = "007058"; | |
in stdenv.mkDerivation rec { | |
name = "${printerName}-cupswrapper-${version}"; | |
inherit version; | |
srcs = |
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
networking.nat = { | |
enable = true; | |
internalInterfaces = ["ve-+"]; | |
externalInterface = "enp6s0"; | |
forwardPorts = [ | |
{ sourcePort = 3000; destination = "192.168.100.2:3000"; } | |
]; | |
}; | |
containers = { |
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
import Reflex.Dom | |
main = mainWidget $ do | |
bChangeWidget <- button "changeWidget" | |
el "div" $ widgetHold (text "placeholder") $ fmap (\_ -> text "changed") bChangeWidget | |
return () |
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
templateRenderCanvas qrcInfoD cnvInfo newBaseImage initialBaseImage = do | |
cnvRef <- liftIO $ mkCanvas' cnvInfo | |
qrcInfo <- sample $ current qrcInfoD | |
imgRef <- liftIO $ canvasDisplay cnvRef imgInfo | |
qrcRef <- liftIO $ canvasDisplay cnvRef qrcInfo | |
liftIO $ canvasAddChild cnvRef imgRef | |
liftIO $ imageAddChild imgRef qrcRef | |
return () |
NewerOlder