Skip to content

Instantly share code, notes, and snippets.

pool: tank2
state: DEGRADED
status: One or more devices has experienced an error resulting in data
corruption. Applications may be affected.
action: Restore the file in question if possible. Otherwise restore the
entire pool from backup.
see: http://zfsonlinux.org/msg/ZFS-8000-8A
scan: scrub repaired 282K in 0 days 00:03:06 with 259 errors on Wed Sep 16 20:11:02 2020
config:
function instantiate() {
machine="${1}"; shift
# do it
true
#drv="$(nix eval --pure-eval ".#nixosConfigurations.${machine}.config.system.build.toplevel")" # TODO: why????
set -e
drv="$(set -eu; nix --experimental-features 'nix-command flakes' --pure-eval \
eval \
--raw ".#machines.${machine}")"
drv="$(set -euo pipefail; nix --experimental-features 'nix-command flakes' --pure-eval \
+ ssh colemickens@aarch64.nixos.community \
'nix-shell -I nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-20.03.tar.gz -p cachix \
--command "echo /nix/store/w71nsc8cf7jrg1wpm5psqxr1d4frnx2m-nixos-system-raspberry-20.09.20200731.e197520 | env CACHIX_SIGNING_KEY=eREDACTED== cachix push colemickens" >/dev/stderr'
compressing and pushing /nix/store/71fg94rcf2fqfxwq221c7mdn3yf09wjb-system-path (4.31 MiB)
compressing and pushing /nix/store/apalrjqm9i9iscgl9kqpgsmj87myngsg-etc (33.73 KiB)
compressing and pushing /nix/store/b3ajfqw3s0a1ybdcyhczw2pj92a5shhr-user-units (9.10 KiB)
compressing and pushing /nix/store/f6x4sk20gncmbvjhh7r2mv93mrw1lz8z-unit-firewall.service (1.78 KiB)
compressing and pushing /nix/store/gzd3cd0raprqik1mk8x6zpwmildy9rdd-unit-polkit.service (1.23 KiB)
compressing and pushing /nix/store/ihjqi107r7m6p35kmpp7s85lhyds5f05-system-units (97.42 KiB)
compressing and pushing /nix/store/kd47ikfwq0zx4ljw66gm4jxyi9ibbghw-firewall-reload (1.95 KiB)
Jul 31 05:43:56 raspberry pixiecore[17884]: [DHCP] Got valid request to boot dc:a6:32:47:73:14 (IA32)
Jul 31 05:43:56 raspberry pixiecore[17884]: [DHCP] Offering to boot dc:a6:32:47:73:14
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:invalid MAC address "e43b854b"
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:invalid MAC address "e43b854b"
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:not found
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:not found
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:not found
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:not found
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:not found
Jul 31 05:43:56 raspberry pixiecore[17884]: [TFTP] unable to extract mac from request:not found
querying info about missing paths...
starting pool of 7 threads
checking substituter 'https://cache.nixos.org' for path '/nix/store/fw6m497sbl2n7cpqs8lppvah856qjswk-nixos-system-raspberry-20.09.20200726.dirty'
querying info about '/nix/store/fw6m497sbl2n7cpqs8lppvah856qjswk-nixos-system-raspberry-20.09.20200726.dirty' on 'https://cache.nixos.org'...
downloading 'https://cache.nixos.org/fw6m497sbl2n7cpqs8lppvah856qjswk.narinfo'...
download thread waiting for 10000 ms
starting download of https://cache.nixos.org/fw6m497sbl2n7cpqs8lppvah856qjswk.narinfo
curl: Couldn't find host cache.nixos.org in the .netrc file; using defaults
download thread waiting for 100 ms
download thread waiting for 100 ms
# sadly, this is considerably faster than
# using nix and its usual remote building functionality
function remote() {
cache="colemickens"
cachixkey="$(set -e; gopass show "websites/cachix.org/apikey/${cache}")"
machine="${1}"; shift
remote="${1}"; shift

This is really painful.

sudo nix --experimental-features 'nix-command flakes' --pure-eval build --profile /nix/var/nix/profiles/system -j 0 --builders-use-substitutes --builders 'ssh://myuser@20.191.64.192 x86_64-linux - - - big-parallel kvm' .#nixosConfigurations.xeep.config.system.build.toplevel

warning: Git tree '/home/cole/code/nixcfg' is dirty                                            
error: --- Error -------------------------------------------------------------------- nix      
unable to start any build; either increase '--max-jobs' or enable remote builds   
@colemickens
colemickens / attribute-import.nix
Created July 27, 2020 07:43 — forked from BenSchZA/attribute-import.nix
Import attributes from Nix derivation
let
default = import ./default.nix {};
pkgs = default.pkgs;
python = default.python;
pythonPackages = default.pythonPackages;
in with default; {
# now pkgs, python, pythonPackages are just available.
...
}
> sudo nix --experimental-features 'nix-command flakes' --pure-eval build --profile /nix/var/nix/profiles/system github:colemickens/nixcfg/main#nixosConfigurations.xeep.config.system.build.toplevel
trace: ___________________ SYS=x86_64-linux HOSTNAME=xeep
~/code/nixcfg main ------------------------------------------------------------------ 7s direnv impure nix 16:57:50
> ls -al ./result
lrwxrwxrwx 1 root root 84 Jul 22 16:57 ./result -> /nix/store/b8lg5yam4d5slnhqhxb9xy8yqgf4632i-nixos-system-xeep-20.09.20200719.5717d9d
~/code/nixcfg main ---------------------------------------------------------------------- direnv impure nix 16:58:12
#!/nix/store/4la2w29x16vnm4fwcz7qfs0m45dgb8hl-bash-4.4-p23/bin/bash -e
function usage {
echo "USAGE: $0 INITRD_FILE" >&2
echo "Appends this configuration's secrets to INITRD_FILE" >&2
}
if [ $# -ne 1 ]; then
usage
exit 1
fi