Skip to content

Instantly share code, notes, and snippets.

View gist:97cdbb57fc6b5c82a81bb3f014a81422
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
View gist:462726cb271cbee0bb95a866e71f60ef
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
View gist:b56368072132e446331918352ecc8bdf
# 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
View gist:fcb5aa916280ee5df772e68808ba47e8

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 Jul 27, 2020 — forked from BenSchZA/attribute-import.nix
Import attributes from Nix derivation
View attribute-import.nix
let
default = import ./default.nix {};
pkgs = default.pkgs;
python = default.python;
pythonPackages = default.pythonPackages;
in with default; {
# now pkgs, python, pythonPackages are just available.
...
}
View gist:b56f05cd8982ccd614c2a6f273b11c59
> 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
View gist:1b4da8010116549cf2a40465572db38f
#!/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
View gist:50f6d7f60c83e5402ad60cdd7e24b8a0
mke2fs 1.45.5 (07-Jan-2020)
Found a gpt partition table in nixos.raw
Discarding device blocks: 4096/318208 done
Creating filesystem with 318208 4k blocks and 79680 inodes
Filesystem UUID: 5c323265-ed2d-4079-bf3a-66aa682e9b97
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: 0/10 done
Writing inode tables: 0/10 done
View gist:d0c144dd9f724bde50dfc53f1e52758d
> while true; do fastboot boot result; sleep 1; done
< waiting for any device >
Sending 'boot.img' (23196 KB) FAILED (Status read failed (No such device))
fastboot: error: Command failed
< waiting for any device >
Sending 'boot.img' (23196 KB) OKAY [ 1.047s]
Booting FAILED (remote: 'Error verifying the received boot.img: Invalid Parameter')
fastboot: error: Command failed
Sending 'boot.img' (23196 KB) OKAY [ 0.941s]
Booting
View gist:151bad052713b5cd2116194e6526f0b3
~/code/mobile-nixos-blueline mobile-nixos-blueline !1 ---------------------------------------------------------------------------------- 5s 20:59:52
> fastboot flash bootloader ~/Downloads/blueline-qq3a.200705.002/bootloader-blueline-b1c1-0.2-6374987.img
< waiting for any device >
Sending 'bootloader_b' (8537 KB) OKAY [ 0.430s]
Writing 'bootloader_b' (bootloader) Flashing Pack version b1c1-0.2-6374987
(bootloader) Flashing partition table for Lun = 0
(bootloader) Flashing partition table for Lun = 1
(bootloader) Flashing partition table for Lun = 2
(bootloader) Flashing partition table for Lun = 4
(bootloader) Flashing partition table for Lun = 5