Skip to content

Instantly share code, notes, and snippets.

View antifuchs's full-sized avatar
🕴️

Andreas Fuchs antifuchs

🕴️
View GitHub Profile
@antifuchs
antifuchs / dock.nix
Last active September 1, 2024 18:00
A nix module that arranges the macOS dock the way you want it. Note: It won't allow you to manually re-arrange the items on it; the dock gets reset everytime you log in.
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.local.dock;
stdenv = pkgs.stdenv;
in
{
options = {
local.dock.enable = mkOption {
description = "Enable dock";
@antifuchs
antifuchs / config.h
Created April 2, 2023 22:08
My ploopy configuration with some back/forward helpers & ad-hoc and permanent drag-scrolling support
/* Copyright 2023 Andreas Fuchs <asf@boinkor.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@antifuchs
antifuchs / iterm2_zsh_init.zsh
Last active July 19, 2024 07:47
tmux-enabled iterm2 shell integration for zsh.
if [[ -o login ]]; then
TMUX_PREFIX=""
if [[ ! -z "$TMUX" ]] ; then
# Via
# <http://blog.yjl.im/2014/12/passing-escape-codes-for-changing-font.html>:
TMUX_PREFIX='\ePtmux;\e'
TMUX_POSTFIX='\e\\'
fi
# Indicates start of command output. Runs just before command executes.
# To set this up, first get tailscale working in an isolated linux shell:
# 1. sudo systemctl stop tailscaled.service
# 2. tailscaled -port 9993 -state tailscale-luks-setup.state -tun userspace-networking -socket ./tailscaled.sock
# 3. tailscale -socket ./tailscaled.sock up -hostname HOSTNAME-luks
# 4. tailscale -socket ./tailscaled.sock down
# 5. ctrl-c out of tailscaled
# 6 sudo systemctl start tailscaled.service
#
# Then add the .state file to your machine secrets and pass its path as tailscaleStatePath.
@antifuchs
antifuchs / GithubEvalNotify.pm
Last active November 24, 2023 16:45
GithubEvalNotify.pm - a hydra plugin that pushes evaluation status of each commit to your nix flake's github repo
# GithubEvalNotify.pm - a hydra plugin that pushes evaluation status of each commit
# to your nix flake's github repo
#
# Note that this file must live under the path "ci/hydra-plugins/Hydra/Plugin/GithubEvalNotify.pm"
# The "ci/hydra-plugins" can be changed, but you have to adjust it in the hydra.nix config below.
# The "Hydra/Plugin/" directory must be kept intact though, otherwise perl won't load this module.
package Hydra::Plugin::GithubEvalNotify;
use strict;
@antifuchs
antifuchs / nixpkgs.docsetconfig
Last active August 28, 2023 16:45
A Dash7 docset generator that allows indexing the current stable nixpkgs manual
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>allowFilters</key>
<string></string>
<key>basicIndexEnabled</key>
<true/>
<key>cssToInject</key>
<string>footer {
////// Easily customizable stuff
// Step zero: have a filter that sorts all notifications@github.com mail into _github_incoming & archives it
var incomingLabel = '_github_incoming'; // You can hide this in the sidebar.
// github sends to "me", and I want less of that pollution
var toMeLabel = 'asf';
// labels for various conditions:
var meLabel = 'github';
var teamMentionLabel = 'github/team_mention';
///// End of the easily customizable stuff
  • Feature Name: nonzero_uint_literals
  • Start Date: TODO
  • RFC PR:
  • Rust Issue:

Summary

Add an extension to the INTEGER_LITERAL syntax that allows users to specify literals as non-zero unsigned integers. We introduce a new

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.homebrew;
caskAppdirStatement =
if (isNull cfg.cask_args.appdir)
then ""
else "cask_args appdir: '${cfg.cask_args.appdir}'";
from talon import Context, Module
mod = Module()
modes = {
"record": "enable recording mode, writes files to ~/.talon/recordings/",
}
for key, value in modes.items():
mod.mode(key, value)