Skip to content

Instantly share code, notes, and snippets.

View getchoo's full-sized avatar
🤠

Seth Flynn getchoo

🤠
View GitHub Profile
@getchoo
getchoo / download-nar.py
Created February 26, 2025 10:02
Python script for downloading NAR (Nix ARchive) files
#!/usr/bin/env nix-shell
#! nix-shell --pure -i python3 -p nix python3 python3Packages.requests
import argparse
import requests
import subprocess
from pathlib import Path
# https://nix.dev/manual/nix/2.24/store/store-path
DIGEST_SIZE_BYTES = 32
STORE_PATH = "/nix/store"
@getchoo
getchoo / optimized-java.nix
Created December 3, 2024 04:29
Demo of using optimized CFLAGS with Nixpkgs
let
pkgs = import <nixpkgs> {
config = { };
overlays = [ ];
};
inherit (pkgs) lib;
# Packages we want to build optimized versions of
packages = lib.getAttrs [
"hello" # Test package
@getchoo
getchoo / pacman-vm.nix
Created September 23, 2024 22:23
nix build -f pacman-vm.nix config.system.build.vm && ./result/bin/run-nixos-vm
/*
Once in the VM, you will also need to setup pacman's keyring, which you can do with the following:
```
curl -Lo archlinux-keyring.tar.zst https://archlinux.org/packages/core/any/archlinux-keyring/download
tar -xf archlinux-keyring.tar.zst
sudo pacman-key --init
sudo pacman-key --populate --populate-from usr/share/pacman/keyrings/
```
*/

$argon2id$v=19$m=512,t=256,p=1$AxD20DJbxdktjim3l3zeEQ$RFeW/Q8qaDj7vmuLg6jdpFFWgJGpG152EufvZK4gYTA

@getchoo
getchoo / ffmpeg-av1.nix
Created September 1, 2023 15:07
ffmpeg av1 funni
{system ? "x86_64-linux", ...}: let
nixpkgs = builtins.getFlake "nixpkgs/3e52e76b70d5508f3cec70b882a29199f4d1ee85";
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.callPackage ({
ffmpeg_6-full,
fetchFromGitHub,
}:
ffmpeg_6-full.overrideAttrs (prev: {

openpgp4fpr:0E15C4B54D8FFEBD3A5FDF73D31BD0D494BBEE86

// getchoo's cs{go,2} config
sensitivity "1.3"
zoom_sensitivity_ratio_mouse "0.818933027098956"
cl_crosshairstyle "4"
cl_crosshaircolor_r "0"
cl_crosshaircolor_g "255"
cl_crosshaircolor_b "255"
cl_crosshairsize "4.4"
@getchoo
getchoo / tcmalloc-monster.nix
Created April 25, 2023 23:54
building libtcmalloc against llvm16, to see if it fixues issues in tf2 on an llvm16 system
let
commit = "2c627d9c702202d75746fd45045d20008bf7ed86";
nixpkgs = import (builtins.fetchTarball {
url = "https://github.com/RaitoBezarius/nixpkgs/archive/${commit}.tar.gz";
sha256 = "sha256:002sz5nqsr7nvwp6bdapwmb691snhrcwdlp4flbhwgqgfzzpyksc";
}) {system = "x86_64-linux";};
inherit (nixpkgs.llvmPackages_16) stdenv;
inherit (nixpkgs.pkgsi686Linux) gperftools;
in
@getchoo
getchoo / fardfetch
Created February 18, 2023 14:16
a debloated, blazing fast system information tool written in posix sh only using posix-compliant command line utilities on posix-compliant libre gnu/linux distributions using gnu coreutils and openrc
#!/bin/sh
# fardfetch: a posix information tool
echo "$(id -un)@$(uname -n)" && printf "distro: " && grep -E '^NAME=' /etc/os-release | sed "s/NAME=//;s/\(\"\|'\)//g" && printf "kernel: " && uname -r && printf "uptime: " && uptime | cut -d" " -f 2 && printf "installed packages: " && opkg list-installed | wc -l && echo "shell: $SHELL" && printf "cpu model: " && grep -m 1 'cpu model' /proc/cpuinfo | awk '{for (i = 4; i <= NF; i++) printf "%s ",$i}' && printf "\n" && printf "memory: " && free -h | awk '{print $3,"/"$2}' | sed '1d;3d' && printf "\n" || exit 1
@getchoo
getchoo / link.ps1
Last active February 17, 2023 02:00
symlink files from a retail Team Fortress 2 build to a patched build