<clever>
energizer: i think you could just `cd /mnt` and then `/kexec_nixos`, since it just drops the temp files in the current dir
<clever>
energizer: you could also just format and mount the target disk
<clever>
energizer: `df -h` ?
<clever>
KarlJoad: but pkgs.fetchurl and pkgs.fetchzip are derivations, it just describes how to fetch something later, once the eval is done, nix can do all of the fetching in parallel
<clever>
KarlJoad: builtins.fetchurl and builtins.fetchTarball are both eval time fetches, so that forces it to download things in series, and to stop evaling while it waits on network
<clever>
when it winds up causing a build at eval time
<clever>
,ifd
<clever>
builtins.fetchTarball isnt allowed in nixpkgs itself, since its IFD
<clever>
KarlJoad: pkgs.fetchurl keeps the disk usage down more
<clever>
energizer: mkdir /nix ; mount -t tmpfs none /nix
<clever>
energizer: to simplify the build, it assumes the binaries will still be in /nix/store on the target
<clever>
colemickens: i dont know why, but they are missing when using remote build machines, but present when building locally
<clever>
energizer: the tarball must be unpacked to / so that the files are in /nix/store/hash-foo like normal
<clever>
energizer: the configuration.nix your first building, is for the ramdisk, not the target install
<clever>
energizer: cat will just paste the 2 files together, and feed it to a /bin/sh on the remote box, which runs each line
<clever>
energizer: i think thats just your own shell code, that gets ran before nixos-infect
2020-12-15
<clever>
terlar: ah, not sure then
<clever>
terlar: why are you running cleanSource on a derivation? why not just not include the files in $out ?
<clever>
terlar: why do you need unsafeDiscardStringContext?
<clever>
terlar: and readDir forces it to build it much earlier, at eval time, which can harm performance
<clever>
terlar: unsafeDiscardStringContext gets rid of the data needed to let nix know it wants to build it
<clever>
kdb, lightdm, those feel like things that cant reload at runtime, so you could just pass it on the cli args, if the app allows it
<clever>
but they have no other way of knowing WHERE the new config is
<clever>
pulse, same reason, the config can change when you rebuild, and all apps should respect the new config
<clever>
so you need a symlink at some predictable location, which you can swap out later on
<clever>
and an env var wouldnt take effect until you restart nearly everything
<clever>
energizer: but the path to /etc/nsswitch.conf cant be in an env var or wrapper, because it should use the new config after you rebuild-switch
<clever>
energizer: yeah
<clever>
but with vim, my config is baked right into a shell script that claims to be vim
<clever>
energizer: for that, i would say its so `nix-env -iA nixos.nano` will respect configuration.nix, without having to know its path
<clever>
and syslog then forwarded the logs to the right box, lol
<clever>
the router forwarded 22 to the wrong box
<clever>
then i realized, the hostname in the log msg, syslog was merging both systems into one file
<clever>
the logs turned up in /var/log/ssh, yet the error says the acct doesnt exist, and it does
<clever>
and then i spent 2 hours trying to figure out why somebody cant ssh into my machine
<clever>
i rigged syslog up to do that on some of my pre-nixos machines ages ago
<clever>
that reminds me
<clever>
bqv: run `nix-store -r` on the path
<clever>
world-readable on my end
<clever>
-r--r--r-- 1 root root 33 Oct 11 2015 /etc/machine-id
<clever>
ronthecookie: i had the same basic problem in iptables, because i wanted to append things to a non-standard chain, but nixos was creating it later
<clever>
yeah, lol
<clever>
theres also #nixos-on-your-router
<clever>
ronthecookie: its basically just a random server board that has 2 gigabit ports on the mobo
<clever>
pinpox: which channel and nixpkgs rev are they on?
<clever>
pinpox: and `nix --version` ?
<clever>
pinpox: either should work, what does `which nix` say?
<clever>
pinpox: i recently had that, it was solved with `nix.package = pkgs.nixUnstable;` in configuration.nix
<clever>
pinpox: i'm guessing only krops has to support flakes then, and the remote machine wouldnt need to
<clever>
pinpox: if you build it on one machine (with flake support), then you can nix-copy-closure it to the other machine, and it wont care how you built it
<clever>
and a sha256 capable git can re-hash it with sha256, and validate that signature too
<clever>
a sha1 only git will only see/care-about the old sha1 signature
<clever>
and shove both signatures into the final commit object
<clever>
henri: aha, they just sign it twice now, over both the sha1 and sha256 encodings
<clever>
> It is similar to the existing "gpgsig" field. Its signed payload is the sha256-content of the commit object with any "gpgsig" and "gpgsig-sha256" fields removed.
<clever>
and you can create .o files from c++ or haskell too
<clever>
yeah
<clever>
but once its in a .drv, you cant do overrides or overlays
<clever>
fuzzypixelz: and .overrideAttrs lets you mutate things before the list has been turned into a flat string
<clever>
fuzzypixelz: the stdenv will conditionally switch between host and target based on other things
<clever>
fuzzypixelz: the drv file is the result of running the exprs, after everything gets shuffled around
<clever>
fuzzypixelz: the seperation lets you do things like guix, use a completely different expression language to create .drv files, which nix-daemon can still build without changes
<clever>
ishan: libudev
<clever>
,locate libudev.h
2020-12-03
<clever>
mtr: this code is able to build for both linux and windows, entirely within a pure nix sandbox
<clever>
but that attr only exists if you get cmake from callPackage
<clever>
> cmake.__spliced
<clever>
simonpe^^: behind the scenes, nativeBuildInputs is using __spliced to extract the native version of cmake from the set, when "${cmake}" is target
<clever>
simonpe^^: you can move all of the binaries and libs into a single $out, and then re-patchelf them to look in the new dir
<clever>
simonpe^^: the other option is patchelf
<clever>
yeah
<clever>
simonpe^^: that would leave you free to move the binaries around without things breaking, but it may wind up larger, because your not sharing libc between each binary
<clever>
simonpe^^: ah, thats a bit more complex, i tend to just do everything the nix way
<clever>
simonpe^^: lines 117-135 says to create symlinks at /init, /lib/modules, /bin, and /etc, so i dont have to force modprobe too heavily, and the $PATH is simpler
<clever>
simonpe^^: but the nix binary itself is absent
<clever>
simonpe^^: nope, it has a full /nix/store within the initrd, and a /init symlink at the root so the kernel is happy
<clever>
simonpe^^: this will cross-compile a bunch of things to armv7l, and package them all up into an initrd