Skip to content

Instantly share code, notes, and snippets.

# install MySQL Server
nix-env --install --attr nixos.mysql57
sudo su
groupadd mysql
useradd -M \
--home-dir /var/lib/mysql \
--no-user-group \
--system \
--gid mysql \
@ivanbrennan
ivanbrennan / postgres-in-minikube.sh
Last active March 13, 2025 08:30
PostgreSQL in minikube
# create/update resources
kubectl --context=minikube apply -f ./postgres.yaml
# In order for the service to reach the statefulset, the following should
# be true:
# statefulset.spec.selector.matchLabels.app == service.spec.selector.app
# statefulset.spec.selector.matchLabels.role == service.spec.selector.role
# give the server some time to start up
# ...
#! /usr/bin/env nix-shell
#! nix-shell -i runghc -p "haskellPackages.ghcWithPackages (ps: [ps.conduit])"
import Conduit
trans :: Monad m => ConduitT Int Int m ()
trans = do
takeC 3 .| mapC (+ 1)
takeC 3 .| mapC (* 2)
xs <- foldlC (\z x -> x : (take 2 z)) []
import Criterion.Main
import Data.Foldable (foldl')
import Data.IntMap.Strict (IntMap, (!))
import Data.List (unfoldr)
import qualified Data.IntMap.Strict as IntMap
{-
resultFile=bench-$(date +%s).html
building '/nix/store/21084lh8071hfcb1rjizgn083ppbn2c5-kernel-modules.drv'...
created 19 symlinks in user environment
kernel version is 5.4.31
building '/nix/store/2wwqbwyszf80qhvalcjnwfns41zzjb8r-linux-5.4.31-modules.drv'...
created 19 symlinks in user environment
kernel version is 5.4.31
building '/nix/store/lvv6v9iih20spfjhj5y9m0mcw8r50q64-vimrc.drv'...
building '/nix/store/1fxgfrv7n4nfvvhx2abyf7igc93kgh9k-linux-5.4.31-modules-shrunk.drv'...
kernel version is 5.4.31
root module: xhci_pci
@ivanbrennan
ivanbrennan / premium-xcursor-theme.nix
Created February 13, 2021 21:43 — forked from ottidmes/premium-xcursor-theme.nix
Custom X cursor in NixOS
{ stdenv, lib, fetchurl, variants ? [ "Premium" "Premium-left" ] }:
with lib;
stdenv.mkDerivation rec {
name = "${package-name}-${version}";
package-name = "premium-xcursor-theme";
version = "0.3";
src = fetchurl {