Skip to content

Instantly share code, notes, and snippets.

{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
-- Imports.
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Actions.SpawnOn
-- import XMonad.Config.Desktop
import XMonad.Hooks.EwmhDesktops
-- import XMonad.Hooks.SetWMName
import XMonad.Layout.NoBorders
-- import qualified XMonad.StackSet as W
-- import XMonad.Layout.ThreeColumns
Config {
-- appearance
font = "xft:Fira Code:size=8:bold:antialias=true"
, bgColor = "#FDF6E3"
, fgColor = "#073642"
, position = Top
, border = BottomB
, borderColor = "#646464"
, textOffset = 11
@sveitser
sveitser / build.sh
Last active June 6, 2018 02:12
Build nix docker images
#!/usr/bin/env bash
#
# To build docker.nix.
# Nice way of building small docker images but currently does not
# have the correct environment to make nix-shell etc. usable.
#
# TODO:
# - Environment.
# - Versioning.
# - Hash of derivations should not change for the same inputs.
@sveitser
sveitser / Entropy.ipynb
Last active September 7, 2018 08:00
Was wondering about entropy of pass phrases.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env bash
set -e
url=$(curl https://nixos.org/channels/nixpkgs-unstable/nixexprs.tar.xz -s -L -I -o /dev/null -w '%{url_effective}')
echo Got tarball URL "$url"
sha=$(nix-prefetch-url --unpack "$url")
echo With SHA $sha
cat > shell.nix <<EOF
@sveitser
sveitser / init.el
Last active August 1, 2018 10:15
~/.doom.d/init.el
;;; init.el -*- lexical-binding: t; -*-
;; Copy me to ~/.doom.d/init.el or ~/.config/doom/init.el, then edit me!
(setq doom-font (font-spec :family "Iosevka" :size 16))
(doom! :feature
;debugger ; FIXME stepping through code, to help you add bugs
eval ; run code, run (also, repls)
(evil +everywhere); come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
@sveitser
sveitser / config.el
Last active August 1, 2018 10:16
~/.emacs.d/modules/private/direnv/
(direnv-mode)
@sveitser
sveitser / clean_emails.js
Last active August 4, 2018 08:34
Google app script to remove old forum messages. Paste into https://script.google.com and schedule or whatever.
function cleanUp() {
// I think this refers to the date when the thread was started.
var delayDays = 90;
var max = 200;
var offset = 0;
var query = 'category:forums older_than:' + delayDays + 'd'
while (true) {
# To later refer to the path of the tarball in the nix store.
# Is there a better way?
{ src ? builtins.fetchTarball {
url = "https://releases.nixos.org/nixpkgs/nixpkgs-18.09pre148461.bf1b50cbc8f/nixexprs.tar.xz";
sha256 = "1kp55q3bp7lrs7qjpyp4mfngw89jrf7rbqhrrz9zwg27rz481gfa";
} }:
with import ( src ) { };
let phonemizer = pythonPackages.buildPythonPackage rec {