Skip to content

Instantly share code, notes, and snippets.

View Enzime's full-sized avatar
❄️
Nixing into the night

Michael Hoang Enzime

❄️
Nixing into the night
View GitHub Profile
@Enzime
Enzime / flake.nix
Created August 18, 2023 05:35
private-dotfiles
{
inputs.secrets.url = "path:./secrets";
inputs.secrets.flake = false;
inputs.dotfiles.inputs.secrets.follows = "secrets";
outputs = { dotfiles, ... }: dotfiles;
}
@Enzime
Enzime / extract-starting-script.sh
Created April 6, 2025 06:42
Extracts VSCode Remote SSH script
#!/usr/bin/env bash
set -euo pipefail
cat $(NIXPKGS_ALLOW_UNFREE=1 nix build --impure ln\#vscode-extensions.ms-vscode-remote.remote-ssh --json --out-link $(mktemp -d)/link | jq -r '.[0].outputs.out')/share/vscode/extensions/ms-vscode-remote.remote-ssh/out/extension.js | rg --only-matching --multiline-dotall --multiline 'echo "\$\{a\.getScriptStartMarker.*?\}\\n`;' | sed 's/\\n/\n/g' | sed 's/\\t/ /g'
@Enzime
Enzime / bisect-runner
Last active May 5, 2025 03:34
Skip stdenv and use cached build logs
#!/usr/bin/env bash
set -x
NIXPKGS=$(nix flake metadata --json | jq -r '.path')
STDENV_STORE_PATH=$(nix eval --raw $NIXPKGS#legacyPackages.aarch64-linux.stdenv.outPath)
STDENV_STORE_PATH_HASH=$(echo $STDENV_STORE_PATH | cut -c 12-43)
if ! curl --head --fail "https://cache.nixos.org/$STDENV_STORE_PATH_HASH.narinfo"; then
$ nix build --print-build-logs nixpkgs/952b88fd4efd6be925c9796be27a5d4126dbf4f2#airdrop-cli
airdrop-cli> Running phase: unpackPhase
airdrop-cli> unpacking source archive /nix/store/sjwali3jbi9qvsg04vdh2z412bmb3xws-source
airdrop-cli> source root is source
airdrop-cli> Running phase: patchPhase
airdrop-cli> Running phase: updateAutotoolsGnuConfigScriptsPhase
airdrop-cli> Running phase: configurePhase
airdrop-cli> no configure script, doing nothing
airdrop-cli> Running phase: buildPhase
airdrop-cli> build flags: -j 2 -c release