Skip to content

Instantly share code, notes, and snippets.

> nixup legacy local
warning: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at (string):1:9; will use bash from your environment
+ unset NIX_PATH
+ cd /home/cole/code/nixcfg
+ mode=default
++ hostname
+ host=xeep
+ [[ legacy != '' ]]
+ mode=legacy
+ shift
Traceback (most recent call last):
File "/nix/store/gqfpc10drmfv614acrqrn425793yfh19-homeassistant-0.112.0/lib/python3.7/site-packages/homeassistant/config.py", line 780, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/nix/store/gqfpc10drmfv614acrqrn425793yfh19-homeassistant-0.112.0/lib/python3.7/site-packages/homeassistant/loader.py", line 322, in get_platform
f"{self.pkg_path}.{platform_name}"
File "/nix/store/fcd1g2a9hmihsk4vvb9sklbswdz0zsp4-python3-3.7.7/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
# <investigate>
# looks like: regression when copying aarch64 derivs from x86->aarch64!!!
# - the first command fails
# - the second one succeeds, doesn't seem right
# first error:
# + nix --experimental-features 'nix-command flakes' --pure-eval --show-trace copy --to file:///tmp/colemickens-nixtmp /nix/store/7dmhqf7a0w0y128gz1xv3wy55ankcrwm-nixos-system-raspberry-20.09.git.drv
# error: --- Error ---------------------------------------------------------------------------------------- nix
# a 'aarch64-linux' with features {} is required to build '/nix/store/9psjdx08hy7wbm3hap4lcsgagam8p660-hm_.configzsh.zshrc.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}
nix copy --to "file://${t}" "${drv}" &>/dev/stderr || true
nix-shell -I nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-unstable.tar.gz -p nix --command "nix copy --to file://${t} ${drv}"
function nixbuild() {
t="$(mktemp -d)"
link="${t}/out"
nix build --out-link "${link}" "${@}"
tl="$(readlink -f ${link})";
rm -rf "${t}"
echo -e "${tl}"
}
0 plugins were checked, 593 plugin(s) could not be downloaded:
Traceback (most recent call last):
File "./update.py", line 384, in prefetch
plugin, redirect = prefetch_plugin(owner, repo, branch, alias, cache)
File "./update.py", line 238, in prefetch_plugin
commit, date = repo.latest_commit()
File "./update.py", line 64, in f_retry
return f(*args, **kwargs)
File "./update.py", line 115, in latest_commit
let
mozpkgs = builtins.fetchTarball { url = "https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz"; };
pkgs = import ../../nixpkgs/cmpkgs {
overlays = [
(import "${mozpkgs}/rust-overlay.nix")
(import "${mozpkgs}/rust-src-overlay.nix")
];
};
in
cole@raspberry ~/c/nixcfg (master) [1]> sudo nix copy --to 'local?root=/mnt/' /run/current-system/
error: cannot enqueue a work item while the thread pool is shutting down
cole@raspberry ~/c/nixcfg (master) [1]>
cole@raspberry ~/c/nixcfg (master) [1]> sudo nix copy --to 'local?root=/mnt/' /run/current-system/
error (ignored): cannot add path '/nix/store/08365mvsv7lsa3s38fmzgaggsydhpig9-etc-fstab' because it lacks a valid signature
error: cannot enqueue a work item while the thread pool is shutting down
cole@raspberry ~> NIX_STORE_DIR=/mnt/nix/store nix-store -q --graph
digraph G {
}
@colemickens
colemickens / amiibo-emulation-with-linux-vm.md
Last active November 16, 2025 06:18
amiibo-emulation-with-linux-vm.md

Easy Amiibo Emulation - https://bit.ly/2z0m09k

(^ that's a short-link to this page, so you can open it in Linux)

Some users are discussing this guide in #hacking on the JoyConDroid Discord: https://discord.gg/SQNEx9v.

DO NOT ask for, or share links to, Amiibo bins in the comments! They will be removed. Thank you for understanding.

(Windows|Linux PC) + JoyControl + Bluetooth = AMIIBO EMULATION

#!/usr/bin/env bash
set -x
set -euo pipefail
grim /tmp/output.png
imv -f /tmp/output.png &
p="$!"
g="$(slurp)"
kill "${p}"
offset="$(echo "${g}" | cut -d' ' -f1)"
these derivations will be built:
/nix/store/wd2ggygj4vfyyqscnax6kfbzfw3rmg7c-gopass-8c7b4a250052d401722b6cbf9308b23a3d3d5661.drv
building '/nix/store/wd2ggygj4vfyyqscnax6kfbzfw3rmg7c-gopass-8c7b4a250052d401722b6cbf9308b23a3d3d5661.drv'...
unpacking sources
unpacking source archive /nix/store/xa6knanrgpsb47ahw425gv8p0fw449vp-source
source root is source
patching sources
configuring
building
Building subPackage .