Skip to content

Instantly share code, notes, and snippets.

View heywoodlh's full-sized avatar
:octocat:
Trapped in Vim

Spencer Heywood heywoodlh

:octocat:
Trapped in Vim
View GitHub Profile

Keybase proof

I hereby claim:

  • I am heywoodlh on github.
  • I am heywoodlh (https://keybase.io/heywoodlh) on keybase.
  • I have a public key ASC2-TcaddNxiPDKqsu2J6SOqXWqDUlp7Y4z4AoSNWeVPwo

To claim this, I am signing this object:

@heywoodlh
heywoodlh / configuration.nix
Created September 17, 2024 17:42
Don't use fprint on NixOS with lid closed (Dell XPS 13 9310)
{ config, pkgs, ... }:
{
# Fingerprint
services.fprintd = {
enable = true;
package = pkgs.fprintd-tod;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-goodix;
};
@heywoodlh
heywoodlh / install.sh
Last active September 16, 2024 03:50
Commands to install Nix on new Alpine Linux host
# Enable the community repository
sed -i 's/#\(.*\/community\)/\1/' /etc/apk/repositories
# Install Nix package
apk add --no-cache nix shadow
# Assuming you're running as root
# Add user to the nix group
# Using shadow because I'm incompetent
myuser=heywoodlh
@heywoodlh
heywoodlh / flake.nix
Last active September 10, 2024 17:32
Zen Browser Home-Manager example
{
description = "my home-manager flake";
inputs = {
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
zen-browser.url = "github:heywoodlh/flakes?dir=zen-browser";
@heywoodlh
heywoodlh / setup-clevis.sh
Last active September 3, 2024 22:28
Ubuntu setup for Clevis
# credit: https://askubuntu.com/a/1475182
# invoke with:
# curl -L https://gist.githubusercontent.com/heywoodlh/b55eb33e248db2b8a7625c1fddc6b8d3/raw/ce517a862ae4b4dd0c7a60912df22c5bcb10d736/setup-clevis.sh -o /tmp/setup-clevis.sh
# sudo bash /tmp/setup-clevis.sh /dev/sda3
disk="$1"
[[ ! -n "${disk}" ]] && echo "Usage: $0 /dev/sda3" && exit 1
[[ -n "${disk}" ]] && [[ ! -e "${disk}" ]] && echo "Disk ${disk} does not exist. Exiting." && exit 1
#install needed packages
@heywoodlh
heywoodlh / flake.nix
Created July 8, 2024 18:57
NixOS flake
{
description = "example nixos flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
@heywoodlh
heywoodlh / server.toml
Last active April 28, 2024 17:50
atticd configuration
# Socket address to listen on
listen = "[::]:8080"
# Allowed `Host` headers
#
# This _must_ be configured for production use. If unconfigured or the
# list is empty, all `Host` headers are allowed.
allowed-hosts = []
# The canonical API endpoint of this server
@heywoodlh
heywoodlh / .envrc
Last active November 7, 2024 23:00
Script for installing Linux environments
use flake
lefthook install
@heywoodlh
heywoodlh / mullvad-browser.nix
Created March 18, 2024 16:32
Example Home-Manager snippet using my branch of Home-Manager for Mullvad Browser
{ config, pkgs, home-manager, nur, mullvad-browser-home-manager, ... }:
let
system = pkgs.system;
browser = if system == "aarch64-linux" then "firefox" else "mullvad-browser";
noproxies = "localhost,127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10,.ts.net";
socksProxy = "some-socks-proxy.example.ts.net";
socksPort = 1080;
browser-settings = if browser == "mullvad-browser" then {
"browser.compactmode.show" = true; # enable compact bar
---
apiVersion: v1
kind: Service
metadata:
name: second
namespace: default
labels:
app.kubernetes.io/name: second
app.kubernetes.io/instance: second
spec: