2020-04-11

<clever> yourfate: i try to keep everything split up, and all in the imports list
<clever> yourfate: you can just add more files to the imports list, and nixos will merge the files for you
<clever> ah, i forgot i added that, lol
<clever> there is?
<clever> ixxie: the kexec ones i wrote arent
<clever> not sure, but enough to eval every single package in nixpkgs
<clever> pinkieval: oh, i think that step just naturally needs a lot of ram
<clever> pinkieval: `git stash list` ?
<clever> pinkieval: check `git reflog` to find the commit
<clever> pinkieval: `git status` ?
<clever> thibm: was thinking that nix-shell got stuck in a recursive loop
<clever> pinkieval: what does dmesg say?
<clever> pinkieval: `git status` ?
<clever> pinkieval: what happens with `nix-shell -p nixpkgs-review --arg config {} --arg overlays '[]' --run "nixpkgs-review wip"` ?
<clever> pinkieval: do you have any overlays setup?
<clever> ixxie: the kexec tarball is meant to be used when you can already boot linux on a remote box, but cant boot a disk image
<clever> ixxie: line 69 may be your problem, it forcibly stops auto-start of sshd
<clever> ixxie: last modified 10 months ago
<clever> ixxie: have you seen my kexec scripts?
<clever> file an issue and it will get fixed eventually
<clever> --store has a lot of edge cases like that
<clever> you had quotes on the wrong end
<clever> > hello + "/bin/hello"
<clever> > "${hello}/bin/hello"
<clever> zeta_0: should be able to leave it as it is in my example

2020-04-10

<clever> ncurses has to be added to the pkgconfig path, to allow `make menuconfig`
<clever> this is how ive been doing similiar
<clever> pie_[bnc]: it got moved to https://status.nixos.org/
<clever> vika_nezrimaya: then why even do it? :P
<clever> for example, you may find yourself unable to nixos-rebuild a simple 1 line config change, because virtualbox needs 2 hours to compile
<clever> i think the main value of home-manager is to update stuff in your user, seperately from nixos
<clever> vika_nezrimaya: have fun with problems like this :P
<clever> Apr 06 04:50:45 router kernel: e1000 0000:04:02.1 enp4s2f1: Detected Tx Unit Hang
<clever> vika_nezrimaya: that can work, as long as its not a network error causing the failure you want to debug
<clever> vika_nezrimaya: about the only thing of importance i can think of is the uid map (or define all uid's in configuration.nix) and the journals
<clever> vika_nezrimaya: note that if you have any result symlinks in NFS, and you run a garbage collection when it isnt mounted, the things they point to will get deleted
<clever> vika_nezrimaya: technically, all nixos needs to boot is /nix, but you will need /boot mounted to update the config, and the rest is more what you want to have persist
<clever> vika_nezrimaya: yeah, that should boot just fine
<clever> vika_nezrimaya: `nixos-rebuild build-vm` and the ISO's basically boot just like that
<clever> peelz: i dont think it is, it only works from within that nix-shell
<clever> peelz: you can also run `nix-shell` in that dir, to get a shell with the "right" nix-universal-prefetch
<clever> peelz: i might be using a fork of nix-universal-prefetch, to deal with my custom fetch functions
<clever> peelz: looks like the error type has changed, so you either need to use the last-known-good nixpkgs, or update the code
<clever> peelz: and then generate everything from there
<clever> peelz: line 118 of gclient2nix.hs is hard-coded to start fetching a specific revision of electron
<clever> peelz: that should build all of the haskell code, then you can just ./result/bin/something
<clever> peelz: the project already has a default.nix, try `nix-build -A gclient2nix'`
<clever> Guest1: https://nixos.org/nixos/options.html#ystem.autoupgrade.da
<clever> Guest1: thats an option
<clever> peelz: cant think of any others
<clever> peelz: not sure, heh
<clever> peelz: thats all using the hnix project, which is also trying to re-produce the full nix-build in haskell
<clever> peelz: and 146 says its `let sources = stuff; in runCommand "name" { preferLocalBuild = true; } stuff`
<clever> peelz: 148 says what the arguments to the function are, and 147 says its going to be `let sources = stuff; in stuff`
<clever> peelz: line 149 says topLevel is a function, that takes a certain set of params, and returns a let block, so `{ stuff }: let stuff`
<clever> peelz: line 150 will turn topLevel into nix code, and print it
<clever> peelz: i cant find any example outputs though
<clever> peelz: it should generate a file something like `{ runCommand, fetchzip, fetchgit ....}: let sources = ...`
<clever> peelz: oh, line 150, it just prints the generated nix to stdout!
<clever> hmmm, no, thats just a cache to generate faster
<clever> peelz: the root problem though, is not fully understanding what gclient is doing, and how to recreate it all
<clever> peelz: and nix can reuse those smaller fetches
<clever> peelz: then i use normal nix to fetch each part, and jam them all together, to re-create the 30gig mess, from 100's of smaller fetches
<clever> peelz: and generate some nix code containing URLs, names, and sha256's
<clever> peelz: this haskell code will parse the DEPS file, then recursively fetch everything and parse more DEPS files
<clever> peelz: until it began looking simpler to re-write all of gclient in nix :P
<clever> peelz: so i had to edit something, re-download 30gig, and re-fail, 10+ times in a row
<clever> peelz: in my case, the problem is more that it fetched 30gig, then failed to run a post-fetch hook
<clever> Guest1: check the man page for more
<clever> Guest1: there is also a CLI flag to turn on a normal menu bar at the top
<clever> Guest1: press and hold control, then press and hold left/middle/right, release to activate something
<clever> Guest1: ctrl+left and ctrl+right are the other 2 menus
<clever> Guest1: hold control and middle-mouse to get the menu with the scrollbar option
<clever> Guest1: xterm does have a scrollbar, and a whole menu youve never seen
<clever> Guest1: the 5th box on the 3rd page
<clever> Guest1: one min...
<clever> bhipple: but, i have since discovered that the SSD i was running on at the time, had a firmware bug
<clever> bhipple: it then took just as many hours to delete those .drv files
<clever> bhipple: i tried btrfs on nixos a while back, i ran some hydra related stuff, and it took several hours to create 1000's of .drv files (rather slow performance) and then hard-crashed the machine
<clever> Guest1: i run zfs on all of my machines
<clever> peelz: or re-write gclient in nix
<clever> peelz: the only real solution is to patch gclient to be able re-patch more gclients after fetching but before running a post-fetch hook, so the patch spreads like a virus
<clever> peelz: yeah
<clever> peelz: and some of those post-fetch hooks, run a copy of gclient, that was shipped with that dep, and hasnt been patched yet
<clever> peelz: the problem is that gclient will run post-fetch hooks in the dependencies
<clever> peelz: i think so, you start from a git repo and a DEPS file, and that DEPS file says what version of things to get, recursively
<clever> Guest1: the longer its running, the more likely it is to scramble things
<clever> Guest1: but your better off just rebooting asap
<clever> Guest1: i would stop the browser before copying it
<clever> peelz: but, when the product is 30gig in size, it becomes a pain to re-download when one piece changes, so you want to do something more like yarn2nix, where it uses pkgs.fetchurl to fetch each piece, and puts it all together
<clever> peelz: the simplest is the route pkgs.fetchgit does, just define the hash of $out, and run a tool in a derivation to generate $out, and if you can create a bit-identical $out each time, you win
<clever> peelz: there are 2 main routes you can go
<clever> cole-h: irssi
<clever> Guest1: my irc client colapses it down
<clever> Guest1: 2020-04-10 15:03:52 -!- Netsplit over, joins: claudiii, emily, Ox4A6F, cocreature, Dandellion, awygle, matthewbauer, goibhniu, nbp, misuzu (+44 more)
<clever> Guest1: just `fsck /dev/sda5` should do
<clever> yeah, that
<clever> maybe things have changed since i last looked at it
<clever> Guest1: nixpkgs or -bin?
<clever> nschoe: something about you could use the wrong compile flags, and give firefox a bad name
<clever> nschoe: mozilla doesnt allow the title bar to say firefox, on any unofficial build
<clever> nschoe: while firefox(-unwrapped) is compiled by nix
<clever> nschoe: firefox-bin is the official firefox build, that has been patchelf'd
<clever> nschoe: if you havent enabled any plugins, then pkgs.firefox silently acts like an alias to pkgs.firefox-unwrapped
<clever> nschoe: plugins do things like flash and java
<clever> nschoe: plugins are binary, extensions are pure JS and xml
<clever> nschoe: the wrapper sets env vars, so the plugins youve chosen can be loaded by firefox
<clever> Yaniel: smartctl says nothing is wrong
<clever> Yaniel: but, a simple power-cycle later (full shutdown, not reboot) and the drive magically returned
<clever> Yaniel: that was the only trace left
<clever> Apr 08 15:04:17 amd-nixos kernel: ata3: link online but 1 devices misclassified, device detection might fail
<clever> Yaniel: it had just vanished, lsblk, bios, grub, nothing could see it
<clever> Yaniel: i tried booting my windows disk (dual-boot) ~2 days ago, only to discover it was missing
<clever> peelz: escape, 52i0, escape
<clever> Guest1: because windows is windows
<clever> Guest1: if you instead used `file=/dev/sda2` for example, then windows can only access a subset of the disk, and cant mess with sda5
<clever> thats where things go wrong
<clever> Guest1: partition, or entire disk?
<clever> Guest1: and they dont work in virtualbox?
<clever> Yaniel: havent heard that one before
<clever> its in virtualbox, with proper virtual disk images
<clever> Guest1: not activated here
<clever> Guest1: its never done that to me
<clever> and then wondered why he lost all his data :P
<clever> ive seen one user that went back to ext2, specifically so he COULD mount it from both at once
<clever> Guest1: depends on if you mounted it from both windows and linux at the same time...
<clever> Guest1: https://www.youtube.com/watch?v=J6UG1Jlwiow Dueling Banjos
<clever> Guest1: that will do it
<clever> ?
<clever> Guest1: and then try booting again
<clever> Guest1: youll want to run `fsck` on it, probably from a livecd
<clever> [21585.443642] EXT4-fs error (device sda5) in ext4_free_inode:357: Corrupt filesystem
<clever> Guest1: anything in `dmesg` ?
<clever> wut??
<clever> ln: failed to create symbolic link '/bin/.sh.tmp': Bad message
<clever> Guest1: try `/run/current-system/bin/switch-to-configuration switch` ?
<clever> try a `nixos-rebuild switch` or just plain reboot
<clever> thats not where that symlink should go!
<clever> Guest1: that is totally wrong for that file, what about `ls -l /etc/inputrc` ?
<clever> Guest1: also, what are the contents of /etc/inputrc ?
<clever> Guest1: can you run `nix-store --verify --check-contents` ?
<clever> and the drive is only ~132 days old
<clever> Guest1: no sectors have failed and been remapped
<clever> 0 Reallocated_Sector_Ct
<clever> Guest1: can you pastebin the entire output?
<clever> ,locate bin smartctl
<clever> vika_nezrimaya: yep
<clever> Guest1: smartctl -a /dev/sdX, what does it report for the hdd in question?
<clever> yeah, you could mkFore the extraPackages, and undo something that was being added to systemPackages
<clever> peelz: either an FHS shell, or a full debian docker container
<clever> thibm: builtins.fetchTarball would likely be the fastest, http://github.com/nixos/nixpkgs/archive/${REV}.tar.gz
<clever> peelz: ive not looked into how electron is doing webrtc
<clever> peelz: the reason the whole gclient2nix thing started, is because i had a bug in electron (hanging), and needed a build with debug symbols
<clever> peelz: just override the nixpkgs electron derivation to change the src, and your done
<clever> peelz: ive mostly just been patchelf'ing the binary builds of electron
<clever> peelz: ive yet to even get nix to download electron's source in a pure manner, its a nightmare :P
<clever> evertedsphere: yeah, ive ran not-os on my rpi's before
<clever> evertedsphere: nope, not-os can boot on qemu withotu any docker
<clever> peelz: which is a nightmare to try and get nix to wrap, so i was trying to re-implement gclient in nix
<clever> peelz: but gclient also wants to patch things as it goes, and re-run copies of itself (that havent been nixified) after it downloads them
<clever> peelz: gclient wants to download over 30gig worth of junk to build electron, this code is supposed to download everything as seperate fetchurl/fetchzip/fetchFromGitHub calls, and then mash it all together into a single 30gig heap
<clever> ehmry: oops, ^
<clever> evertedsphere: ive also got a kernel building here: https://github.com/librerpi/lk
<clever> evertedsphere: then it could maybe work
<clever> evertedsphere: oh, but i also didnt implement any switch mechanics, so you have to reboot for any changes
<clever> evertedsphere: with a few tweaks to stage1, you can make /nix just be a normal partition on a normal hdd
<clever> ehmry: i already have nix compiling rpi firmware
<clever> vika_nezrimaya: it runs a range of systemd services (grafana, prometheus, nginx, oauth_proxy, and others) under runit, inside a single docker image
<clever> evertedsphere: it was originally meant to be an embedded image in a server
<clever> evertedsphere: just never tried to port it over
<clever> evertedsphere: the biggest thing not-os currently lacks, is xorg
<clever> vika_nezrimaya: i have a half-working util to translate systemd to runit
<clever> evertedsphere: you would need to add the services you care about, or fully translate systemd->runit, like my recent docker thing
<clever> niso: i think part of the point of a microkernel, is to have fewer things in ring0, and out-of-tree modules dont give you that

2020-04-09

<clever> zeta_0: you could modify line 22 to do the `env { something}` for you
<clever> zeta_0: yeah, 22 is making env not a function anymore, remove it
<clever> zeta_0: line 22 breaks env being used as a function
<clever> zeta_0: what errors is it throwing?
<clever> energizer: nope, only after the pr gets merged
<clever> energizer: thats how things like fetchgit can run tools like git to fetch things
<clever> energizer: if you declare the hash of $out, nix gives you unrestricted access to the network, but the build fails if you dont meet the claimed hash
<clever> energizer: what if my fixed-output derivation does a query against 192.168.1.1 ?
<clever> energizer: what if i upload a derivation with `src = /etc/shadow;` ?
<clever> energizer: if you let others upload to it, youll have a security nightmare
<clever> energizer: you can just run your own hydra and build whatever you want
<clever> zeta_0: i think so
<clever> energizer: correct
<clever> numkem: probably
<clever> numkem: the `-I nixpkgs=` will change what <nixpkgs> refers to, and nixops internally uses <nixpkgs> to load everything
<clever> numkem: you can just point it to an existing revision on the original nixpkgs, whatever a channel was last on
<clever> numkem: and it will keep using it every time you deploy
<clever> numkem: when you run `nixops create` or `nixops modify` with a `-I nixpkgs=`, nixops will remember that override
<clever> zeta_0: so if you do `(developPackage { returnShellEnv = false; ... }).env { withHoogle = true; }` then it will work
<clever> zeta_0: the .env attr, is actually a function, that takes a { withHoogle = ?; }
<clever> zeta_0: have you looked at the source of developPackage ?
<clever> zeta_0: developPackage cant really be modified to use ghcWithHoogle directly, enless it already has an option to enable that
<clever> numkem: you can run `ssh-add -l` to test if an agent is running, and list what is in it
<clever> numkem: then anything using ssh (ssh itself, scp, nixops) will just magically be able to use those keys without prompting for a passphrase
<clever> numkem: just run `ssh-agent`, export the vars it says to export, then run `ssh-add` on a private key file
<clever> numkem: nixops will just try every key in the agent
<clever> numkem: temporarily add it to an ssh-agent with ssh-add
<clever> zeta_0: like, ghcWithHoogle (ps: [ ps.lens ])
<clever> zeta_0: ghcWithHoogle is a function, not a package, you must run it on a list of packages
<clever> numkem: nixops will create its own keypair and use that to deploy, but the ssh agent leaks and gives it more keys it can use
<clever> numkem: yeah, none is the default targetEnv
<clever> numkem: if the machine is already created, then you need to use the none backend, which wont do any aws special things
<clever> numkem: though, nixops will add that metadata, if in use
<clever> numkem: only at runtime i believe
<clever> asbachb: yeah
<clever> asbachb: nix uses the hash of the build directions to compute $out, so if the steps to make somehting havent changed, it finds the old product in the store, and just reuses it
<clever> and defexpr will restore itself every time you login
<clever> DamienCassou: there shouldnt be a channels folder in the home dir, just def-expr
<clever> DamienCassou: nix.nixPath
<clever> DamienCassou: nix.nixPath
<clever> DamienCassou: you can skip them
<clever> /home/clever/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels
<clever> $ echo $NIX_PATH
<clever> lunik1: this is how i do a similar task, it shows up at /run/current-system/nixcfg, https://github.com/cleverca22/nixos-configs/blob/master/core.nix#L126-L128
<clever> lunik1: thats meant to remake a missing configuration.nix on first boot, and doesnt give easy access to the config files
<clever> lordcirth: that does what you want and more!
<clever> lordcirth: one min
<clever> chpatrick: if its not set, then it defaults to auto, which tests if it can write to things in /nix
<clever> chpatrick: i believe it first checks $NIX_REMOTE, daemon means use the daemon, auto is the default, which tests if it has write to stuff in /nix
<clever> ah, out of ideas then
<clever> chpatrick: does the output device appear in pavucontrol?

2020-04-08

<clever> timokau[m]: much more readable :)
<clever> timokau[m]: and if you throw some ``` around the quote, it will keep the <clever> from irc intact
<clever> timokau[m]: sure, my github username is @cleverca22
<clever> timokau[m]: if you use `--argstr system aarch64-linux`, then your telling nixpkgs to do an aarch64 build, and leaving the local arch intact
<clever> timokau[m]: if you use `--option system`, then your lying to nix that the LOCAL machine is aarch64, which causes builtins.currentSystem to repeat that lie, and nix will try to run aarch64 binaries (causing your issue)
<clever> timokau[m]: id recomend against using `--option system`, that will break a lot of things

2020-04-07

<clever> lovesegfault: yeah, anything in the buildInputs (and some parts of the stdenv) can add themselves to phases
<clever> lovesegfault: patchShebangs, it uses the binary already in $PATH
<clever> ahh
<clever> gchristensen: can the metadata be obtained at a later time, via the api?
<clever> gchristensen: probably
<clever> gchristensen: yeah, and then you can use stuff like ram size to adjust limits of programs, and cpu core count to adjust concurrency
<clever> gchristensen: and nixops can do similar, via a file in /tmp/
<clever> gchristensen: simplest option i can see is to just encode all of that metadata as json (or hnix it into nix), and then have a nix file in /etc/nixos/ that sets something like hardware.packet.metata = builtins.parseJSON (builtins.readFile ./metadata.json);
<clever> gchristensen: for normal nixos, or nixops?
<clever> gchristensen: ask away
<clever> atemu12[m]: measured boot in the TPM also helps, smaller firmware blob involved in the critical thing
<clever> atemu12[m]: but somebody could backdoor the binary in the ESP, and steal your pw
<clever> atemu12[m]: yeah, the ESP can be seperate from /boot/
<clever> atemu12[m]: the efi firmware cant deal with decryption, so the ESP must be in plaintext
<clever> atemu12[m]: if you encrypt /boot, are you using efi or legacy?
<clever> srid: the repo your nix-env'ing could be different from the main one, just a helper repo
<clever> srid: then the default.nix could re-fetch the repo, using builtins.fetchgit
<clever> srid: the default.nix within the tar, must then have a `{ gitrev ? "default" }:` and fetch that one
<clever> srid: nix-env -f https://github.com/owner/repo/archive/branch.tar.gz -iA attr --argstr gitrev 12345
<clever> srid: nix-env -f https://github.com/owner/repo/archive/branch.tar.gz -iA attr
<clever> srid: its so you can do something like `nix-env -E 'channels: (import channels.nixos {}).hello' -i` i believe
<clever> srid: you want to likely add a `_:` to the start of the expr
<clever> srid: but note, it must return a function, and nix-env will run that function with every channel as a set
<clever> srid: nix-env -E works just fine
<clever> xfix: i choose to use a either a fat32 or ext4 /boot, with zfs on luks for /
<clever> gchristensen: of note, zfs cant encrypt the dataset names, so if you have a tank/uber-secrets, somebody is going to have questions for you when they notice it :P
<clever> xfix: ah, that would explain things
<clever> lordcirth: online, damn!!
<clever> srid: simplest, is to use builtins.readFile to read the file in the derivation
<clever> ,ifd srid
<clever> thibm: more for when your using nixops, you can `nixops deploy --build-only`, then copy that product up
<clever> thibm: but for any FS the distro already supports, nix + nix copy would likely do
<clever> thibm: if your doing zfs, it would probably be simpler to kexec into nixos
<clever> depends on what the cloud provider offers
<clever> ixxie: you could also package the kernel+initrd from it, into a normal /boot with grub, and then just boot that as a disk image
<clever> ixxie: kexec is also somewhat optional, since you could also use the nix copy trick in the above issue
<clever> mounted&
<clever> assuming things have already been partitioned and installed
<clever> thibm: if you install just nix, then you can use phase 3 here, to copy a pre-built nixos to /mnt/nix/store on a remote machine
<clever> thibm: one sec
<clever> ixxie: nixops has a script to auto-install on hetzner
<clever> ixxie: they both stop ssh from running on boot by default
<clever> vika_nezrimaya: so, nixos, on apple hardware, with a zfs root, and then darwin in qemu, with zfs volumes for the disk image
<clever> vika_nezrimaya: its only legal if you do it on apple hardware
<clever> vika_nezrimaya: darwin under qemu, on nixos
<clever> vika_nezrimaya: every time the darwin guest reboots, nixos will do a zfs rollback of it
<clever> vika_nezrimaya: the nixos mac builders all use darwin in qemu on nixos+zfs
<clever> vika_nezrimaya: basically, you make an install media with justdoit included, boot it on something, type justdoit into the shell, and it does it
<clever> just with less customization options
<clever> vika_nezrimaya: justdoit can do basically the same thing
<clever> vika_nezrimaya: i think /home is its own dataset, so it isnt lost