<clever>
dhess: also, the old /boot/grub/state from before you deploy anything should give details
<clever>
dhess: that FS can only mount when booting via EFI
<clever>
[clever@system76:~]$ mount | grep efi
<clever>
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
<clever>
dhess: i suspect that the nvme aws machines might also be uefi, you should look into what the state of a freshly booted ami is, `nixops deploy --create-only` to stop it from messing with it
<clever>
dhess: /home/clever/apps/nixpkgs/nixos/modules/virtualisation/amazon-image.nix: boot.loader.grub.device = if cfg.hvm then "/dev/xvda" else "nodev";
<clever>
so if your motherboard lacks drivers in the rom, grub cant read the nvme, and you cant cheat by putting grub on a legacy disk
<clever>
dhess: grub assumes the EFI firmware provides nvme drivers
<clever>
dhess: and anoyingly, despite grub "supporting" nvme, grub DOESNT support nvme!
<clever>
dhess: for extra fun, on real hardware, you CANT boot legacy nvme, because it just doesnt appear over the normal legacy api's, so uefi is the only way to boot it
<clever>
nixops doesnt know its aws, and doesnt know what defaults to use
<clever>
dhess: oh, that would explain it
<clever>
dhess: you can also try just setting it yourself, to the correct value
<clever>
cizra: that will import <nixpkgs>, check if that directly has a thinkpad arg (it doesnt), then discard the arg, and basically ignore it
<clever>
cizra: that wont pass thinkpad to libfprint
<clever>
run500: nix-prefetch can already give you the hash of a rev
<clever>
run500: and then every other VCS will want their hashing in nix, and it will get bloated
<clever>
run500: it would need a new type of fixed-output derivation, which would require everybody to upgrade nix to be able to build it
<clever>
nix doesnt care how it creates $out, so you are free to use whatever you want (curl, torrent, git, svn, carrier pidgeon)
<clever>
and the hash keeps them in line
<clever>
run500: fixed-output derivations are just declaring the hash of $out, as a promise of purity, to be granted impure network access
<clever>
run500: and there is still the issue of nix itself knowing how to validate that it matches a given rev
<clever>
run500: yep, but by default, it deletes the .git at the end, before nix validates the hash is correct
<clever>
so you dont have any trace of the .git dir
<clever>
run500: but fetchFromGitHub just downloads the auto-generated zip from github
<clever>
run500: and you would need to clone the entire history to do that
<clever>
run500: also, the rev is a hash over the commit, which contains the hash of the previous commit, so you need the entire chain of commits to validate the rev as being right
<clever>
run500: the nix itself doesnt understand git, so all it can do is hash the directory
<clever>
and maybe have it recover on its own, with a log to warn you
<clever>
Unode: should probably file an issue about uid-map corruption being non-obvious
<clever>
cizra: fetchFromGitHub
<clever>
Unode: that file is mainly so if you delete a user, then later re-add it, it gets the old uid back
<clever>
Unode: you should be able to safely delete it, and nixos will recover
<clever>
Unode: thats a valid json file on my end
<clever>
oooooo
<clever>
Unode: tab completion?
<clever>
i believe it has always had that name
<clever>
ls -lh /nix/store/*users-groups.json
<clever>
thats still valid json, so it shouldnt be an issue
<clever>
Unode: what does the first line of `hexdump -C /path/to/json | head` report?
<clever>
Unode: this will just check all of them!
<clever>
[root@amd-nixos:~]$ for x in /nix/store/*users-groups.json; do echo $x ; jq < $x > /dev/null ; done
<clever>
and see what it says
<clever>
Unode: cat the json | jq
<clever>
ls -l /nix/store/*/bin/jq
<clever>
Unode: hmmm, do you have jq installed?
<clever>
Unode: hmmm, i would just run it directly, rather then sourcing it
<clever>
Unode: sure
<clever>
youll find a line where it runs perl on that user-groups script, and gives it a json
<clever>
Unode: read the `activate` script at that path
<clever>
Unode: above that, you should see the path to the nixos build it was running
<clever>
Unode: did the journal say which json file was invalid?
<clever>
that should get you a link equivelant to ethernet, and from there its all the same
<clever>
then you will want to bring the IF up (ip link set XXX up), then run wpa_supplicant with &
<clever>
wep or wpa?
<clever>
depends on your crypto though
<clever>
wifi is harder to setup
<clever>
which does it normally use?
<clever>
wifi or wired?
<clever>
there is also a --repair command, but it will depend on what is corrupt, there are many choices
<clever>
Unode: the --verify --check-contents should confirm that
<clever>
Unode: that sounds like your nix store is corrupt, so various things are failing on boot
<clever>
Cale: there ^^
<clever>
make-package-set.nix: callHackage = name: version: callPackageKeepDeriver (self.hackage2nix name version);
<clever>
Unode: export PATH again, as i showed before
<clever>
Unode: its reading an absolute symlink from outside the chroot
<clever>
Unode: tell it to continue anyways
<clever>
Unode: then systemd wont even be ran
<clever>
Unode: change the init= to init=/bin/sh
<clever>
dhess: the above path is where the last active generation is kept
<clever>
dhess: /run is a tmpfs, so current-system wont exist on-disk
<clever>
-r-xr-xr-x 1 root root 20377 Dec 31 1969 /nix/var/nix/profiles/system/bin/switch-to-configuration
<clever>
dhess: one sec
<clever>
dhess: and behind the scenes, `--install-bootloader` just does `export NIXOS_INSTALL_BOOTLOADER=1`, and switch-to-configuration then checks for that var
<clever>
dhess: but, you can just run `/run/current-system/bin/switch-to-configuration (switch|boot)` to get the same effect, using whatever is currently active (last deployed)
<clever>
dhess: first, you cant really get nixos-rebuild to easily respect the nixops config
<clever>
41 export NIXOS_INSTALL_BOOTLOADER=1
<clever>
40 --install-bootloader)
<clever>
dhess: one minute
<clever>
rather then silently putting things in the /boot dir of /
<clever>
so if i ever forget to mount, it fails hard
<clever>
Unode: thats why i like to `chmod 0 /boot` before mounting it
<clever>
so you need to mount everything that matters where it belongs
<clever>
it assumes systemd took care of that already
<clever>
nope
<clever>
Unode: then try rebooting again
<clever>
Unode: boot will update /boot for whatever it just build
<clever>
oops, wrong tab-complete
<clever>
yangm97: you want boot
<clever>
Unode: switch will always fail under chroot
<clever>
dhess: ive also had plans to build ssh into the bootloader somehow, either directly into grub, or by booting into a thin distro, that presents a menu, and kexec's into the real distro
<clever>
dhess: then reverse those steps to put it back where it belongs
<clever>
dhess: if you need to, you can disconnect the root EBS, reconnect it to a second instance, and then mount the device and poke around
<clever>
Unode: i would also bindmount them
<clever>
Unode: try to chroot again then, using the bash from the system profile, and then `nixos-rebuild build` and see what happens
<clever>
cizra: and instead of list, you can also ` --delete-generations 42`
<clever>
cizra: thats why i just dont -d, and i manually delete generations
<clever>
just mounting it may show some things
<clever>
no need to chroot
<clever>
Unode: try from the usb stick you booted from, after mounting the rootfs
<clever>
Unode: you can run dmesg to see those errors
<clever>
yeah, its unlikely to corrupt if it wasnt in use when you ran out
<clever>
nix-env profiles will also be lost
<clever>
if the db is lost, then so is all of /nix/store, and it will need to re-download/build everything
<clever>
and is modified every time that is modified
<clever>
Unode: the sqlite db keeps track of what is in /nix/store/
<clever>
sqlite is fairly hardened against a lot of things
<clever>
Unode: IO errors feels more like a failing drive
<clever>
what does dmesg say?
<clever>
check dmesg
<clever>
that doesnt mean the DB is corrupt
<clever>
what points towards it being corrupt?
<clever>
though completion mostly comes from bash sourcing the bashrc stuff in /etc
<clever>
use the bash from the path i gave above and you should be good
<clever>
it turned itself off :P
<clever>
2019-05-15 14:44:52 -!- grahamc[m] [gchristens@gateway/shell/matrix.org/x-tgmttfnyebwhgwkt] has quit [Quit: Idle kick: User has been idle for 30 days.]
<clever>
gchristensen: from matrix
<clever>
gchristensen: you got booted!
<clever>
i'm not sure if its all documented in one spot, i mostly just memorized how everything works
<clever>
that will get you 80% of the stuff you expect
<clever>
and a comment in my house.nix reminds me what it should be, if i ever loose the state
<clever>
i'm using that to pin nixpkgs to a single rev, so it only updates when i choose to update the pin
<clever>
jD91mZM2: you can also use `nixops modify` to change any param you gave during `nixops create`
<clever>
# nixops modify -d house deployments/house.nix -I nixpkgs=https://github.com/nixos/nixpkgs/archive/dae9cf6106d.tar.gz
<clever>
wut? :P
<clever>
that would explain things
<clever>
although, i was also jamming a 2nd llvm into the buildInputs, rather then changing clangs llvm
<clever>
matthewbauer: my understanding is that clang just calls out to llvm to do 90% of the work, but it feels like clang has a whitelist of platforms, and is blocking what should just work
<clever>
for a chip with 32kb of flash....
<clever>
so i went back to avr-gcc and avr-libc, and eventually got a 90kb firmware blob
<clever>
i then realized, i was distracted by rust support AVR via llvm, and realized i wanted to compile plain c code
<clever>
if i instead tell clang to emit llvm IR, then i run llvm on that, it works for basic things, but for crypto code, llvm segfaults!
<clever>
but, clang doesnt know that, so clang refuses to target avr
<clever>
this is enough to get avr "support" in llvm