<clever>
MichaelRaskin: id think git blame would still trace it back to you
<clever>
MichaelRaskin: hmmm, if you can swap out a single file within the tree, it would have to be a hash you previously commited, and nobody has since modified
<clever>
copumpkin: so even if somebody swaps out a commit before mine, the git log will claim i just undid your changes, enless you can collide a whole file
<clever>
gchristensen: each commit is a snapshot of the entire state of the tree at that point in the commit
<clever>
gchristensen: ah, one thing about git, is that it doesnt store differences
<clever>
class LocalFSStore : public virtual Store
<clever>
class LocalStore : public LocalFSStore
<clever>
BinaryCacheStore is a recent addition, that treats the binary cache as another store, allowing you to just throw copy-closure logic at it, and get substitutes
<clever>
both of those require /nix/store to be at /nix/store/
<clever>
while applying some permission restrictions
<clever>
and then nix-daemon just internaly maps everything to the LocalStore instance inside itself
<clever>
RemoteStore is for non-root access, proxying everything via a unix socket to nix-daemon
<clever>
LocalFSStore may also be related
<clever>
when nix commands are ran as root, all operations go thru an instance of LocalStore, that just directly manipulates db.sqlite and /nix/store/
<clever>
though maybe builds do work, via normal sandboxing?, or it can build on the host, and copy over
<clever>
it cant do builds via that, but it can do the bulk of the operation
<clever>
from what i remember, you can just tell nix-store to operate on a normal nix store, that is currently mounted at /mnt/nix/store, and it will just prepend /mnt/ to all paths when doing binary-substituion, and accessing db.sqlite
<clever>
ah
<clever>
i dont remember the syntax, but nix gained support to do limited operations against a storepath not at /
<clever>
there is a new option i was thinking of, that might play into things
<clever>
copumpkin: this allows the chroot env to access the entire store of the "host" (which will be the sandbox of the nix build in your case)
<clever>
copumpkin: oh, another trick nixos-install uses, NIX_OTHER_STORES and a bind-mount to /mnt/root/nix of the host nix
<clever>
yeah, i believe exportReferencesGraph is just runtime
<clever>
copumpkin: because of these 2 lines, the stdenv will be in the runtime closure of the test vm sandbox, which means it wont have to download the stdenv when rebuilding things under a vm
<clever>
copumpkin: and the way you call make-squashfs.nix is also a bit odd, rather then being 2 lambda's like fetchurl and friends, its a single lamba, and it has to be called in a more specialized way
<clever>
copumpkin: but make-squashfs.nix is weird, in that it always strips the /nix/store/ path from things, and expects the FS to be mounted to /nix/store/
<clever>
copumpkin: pkgs.makeInitrd is pretty equal to the others, the contents attr lets you set non-store things, like /init being a symlink to the storepath, then it just gets the entire closure automagicaly
<clever>
copumpkin: i have used the squashfs and initrd scripts a few times
<clever>
copumpkin: ah
2017-02-21
<clever>
ndowens08: what about just normal fetchFromGitHub, like the gist i linked?
<clever>
i was double-checking against the 16.09 copy by mistake
<clever>
ah
<clever>
ndowens08: that error message includes output from git, but fetchFromGitHub NEVER uses git, despite its name
<clever>
no need to touch nix-env or systemPackages
<clever>
and it will be installed and configured for you
<clever>
threshold: set services.postgresql.enable=true; in configuration.nix and run nixos-rebuild switch
<clever>
threshold: what are you trying to get done?
<clever>
threshold: just use sudo to get root
<clever>
threshold: ~/.nix-profile is entirely managed by nix-env, and you would need to make a package describing the change and nix-env -i it
<clever>
gchristensen: i sleep when you least expect it :P
<clever>
gchristensen: lol
2017-02-20
<clever>
romildo: the command will be available, but not its headers or libraries
<clever>
romildo: yeah
<clever>
and header files are never installed globally
<clever>
romildo: it wont be available inside nix builds, and it wont be able to find libraries
<clever>
romildo: you want nix-shell -p llvmPackages.llvm
<clever>
romildo: nix is designed such that you never need to install compilers like that
<clever>
Judson: and if your building something with nix, you can just pass ${builtins.storeDir} to configure at build-time
<clever>
Judson: if you can eval a nix expression, this gives it to you?
<clever>
nix-repl> builtins.storeDir
<clever>
"/nix/store"
<clever>
Judson: there is another way, one min
<clever>
yeah, and no hashes on that
<clever>
i see, its using perl to parse the reference graph
<clever>
oh
<clever>
copumpkin: then it has enough to import a db backup (from exportGraph?) to get the db.nix updated
<clever>
copumpkin: saw the latest comment on the issue, i believe nixos-install just uses rsync and nix-store -qR to get the closure of nix into the chroot
<clever>
copumpkin: only thing i can think of is -qR that destroys the tree, and --query --tree that leaves you with ascii-art
2017-02-19
<clever>
but i believe nix-shell and nix-build have been rewritten recently
<clever>
dont know
<clever>
endformationage: but you can use -I nixpkgs= or NIX_PATH like gchristensen said, to change where <nixpkgs> leads
<clever>
endformationage: nope, it ignores -E and the path you give it (it should probably error with invalid combinations)
<clever>
and you can shove whatever nix expression you want in foo
<clever>
if you -p foo, then it will essentialy do nix-shell -E 'with import <nixpkgs> {}; runCommand "dummy" { buildInputs = [ foo ]; } ""'
<clever>
Baughn: i havent done much with perl, never even see a Makefile.PL before
<clever>
Baughn: that could be improved with a setup hook, that scans $nativeBuildInputs for things in /lib/perl and adds them to $PERL5LIB
<clever>
MP2E: thats usualy what hydra saves you from, if your on nixos-unstable
<clever>
nix-repl> builtins.typeOf "foo"
<clever>
"string"
<clever>
ndowens08: what command are you currently using and what are you trying to test?
<clever>
Judson: does the shell.nix import <nixpkgs> ?
<clever>
ndowens08: the build-vm has a read-only store by default
<clever>
Judson: what is in default.nix?
<clever>
and then its env vars get set inside the shell
<clever>
the env attribute is meant to have nix-shell directly ran on it, via nix-shell -A rubyEnv.env
<clever>
buildCommand*
<clever>
and with an invalid buildEnv, it cant
<clever>
Judson: oh wait no, thats env = rubyEnv.env; which means it has to build that env first
<clever>
Judson: that is copying every attribute from the env, including the build command
<clever>
Judson: how are you trying to inherit it?
<clever>
either keeping the current grub, or blowing it away via nixos-in-place mechanics (running the nix build of grub-install)
<clever>
just edit the existing bootloader to make the recovery image the default
<clever>
and there is another trick, for cases where kexec isnt in the kernel of the target
<clever>
so you just give nixops root access to any linux machine in any datacenter, and it just works
<clever>
one thought i had, is to add the kexec stuff to nixops
<clever>
yeah
<clever>
after that, you just need to ensure nixos always reboots upon any boot failure
<clever>
and in either case, kexec the chosen nixos image
<clever>
contrapumpkin: but if you do give it the right network packets, you get a boot menu over the network
<clever>
contrapumpkin: in theory, i can make a program that runs on bootup, within the initrd, that will wait ~30 seconds for certain network packets, and if it gets none, it boots the default OS
<clever>
contrapumpkin: i also then had another idea on how to further improve the usability of nixos in remote locations
<clever>
then recover it yourself
<clever>
and if you enable ssh in that recovery image, you could ask the datacenter to pick it from grub for you
<clever>
contrapumpkin: now you can basicaly boot the install CD at any time
<clever>
contrapumpkin: and another idea i had recently, just put this initrd in /boot, and give it a grub.cfg entry
<clever>
contrapumpkin: so if you just reboot without formating things, the previous OS boots back up
<clever>
contrapumpkin: the kexec works entirely in ram, without any changes to the MBR or bootloader
<clever>
yeah
<clever>
if i do get in, i can just stop the timer
<clever>
contrapumpkin: but a couple extra lines of nix later, i have a systemd timer that reboots back to the original OS every hour
<clever>
contrapumpkin: the datacenter i had to deal with lately lacks dhcp, so i had to put static ip config into this file, but if i get it wrong, i cant remotely reboot
<clever>
contrapumpkin: line 53-60 of configuration.nix is another addition i did recently to deal with crappy network configs
<clever>
contrapumpkin: yep
<clever>
contrapumpkin: and within 2 minutes, its running full nixos from ram, you can ssh into that, and wipe the hdd, then do a normal nixos-install
<clever>
contrapumpkin: the idea, is that you upload this tarball to any server, unpack it to /, and then just run /kexec_nixos
<clever>
contrapumpkin: if you build the kexec_tarball attribute as shown in line 1 of the config, you get a tarball containing a shell script, kernel, and initrd, and the initrd contains a full nixos build
<clever>
philipp[m]: and next time systemd boots that container, it uses that version
<clever>
philipp[m]: the declarative containers dont have their own profiles, so when you build the host, it also updates the active nixos for every container in the systemd config
<clever>
mojjo: not really, you would need some ugly hacks with unionfs, or just use something raid capable (mdadm, zfs, lvm)
<clever>
viric: i only see a .out on SDL2, no .outputs, so it has 1 output, thats it
<clever>
viric: checking .outputs should tell you what that package has
<clever>
viric: and sometimes a static
<clever>
viric: ive seen bin, dev, lib, and dbg within nixpkgs
<clever>
viric: and derivations are free to make their own ones up, i have one for logs and static binaries
<clever>
viric: every string listed in the outputs attribute becomes an output
<clever>
simpson: either M$ thinks their cloud is bigger then the sum of every single user, or the NSA wants help spying on things, lol
<clever>
and then only the official one will remain, and only if you update
<clever>
so any pre-existing skype clients are going to break
<clever>
and ive heard rumors that skype is shutting down the p2p network and going purely "cloud" based
<clever>
yeah, tox can only talk to other tox users
<clever>
mojjo: toxcore has been working to take over the skype users, https://tox.chat/
<clever>
declarative containers just update every single container, since the host depends on the container builds
<clever>
or one container may wind up on a month old nixos-unstable, because you forgot to run updates on it
<clever>
simpson: so you need to "nixos-rebuild --upgrade switch" every container seperately
<clever>
simpson: yeah, they all share the store, but the "active" nixos build is going to be entirely out of sync
<clever>
with declarative containers, nixos-rebuild on the host updates the build of every container at once for you
<clever>
philipp[m]: imperative containers gain the use of "nixos-rebuild switch" within them for faster updates, but they also have some cons: each container has its own channel, and you now have to nixos-rebuild every container one by one
<clever>
mojjo: yeah, the unfree error should tell you what contents it needs
<clever>
philipp[m]: the only way to update the declarative containers is to restart their systemd units on the host, which does a full container shutdown, and then bootup
<clever>
mojjo: nix-env and nix-build only ever use ~/.nixpkgs/config.nix
<clever>
mojjo: configuration.nix is only used for nixos-rebuild, nix-env never reads it
<clever>
simpson: and also, it forces a linux-32bit build, even on a mac system!!
<clever>
simpson: callPackage_i686 forces skype to use 32bit libraries and to build in a 32bit way
<clever>
hyper_ch: some of them are also r/w and can be changed at runtime
<clever>
hyper_ch: in here is every option to every module loaded into the kernel, including modules that linked in at compile time
<clever>
/sys/module/sg/parameters
<clever>
/sys/module/sg/parameters/allow_dio
<clever>
hyper_ch: find /sys | grep module | grep para | head
<clever>
about the only way to break nix and make it disobey the nix expressions is to forcibly edit existing files in /nix/store/
<clever>
its probably using the real configuration.nix, and ignoring your changes entirely
<clever>
ndowens08: and the option is nixos-config, not nix-config
<clever>
ndowens08: nix always uses a new directory in /tmp for every build, no mater what the sandbox is set to
<clever>
eacameron: nixpkgs will handle ./configure and everything automaticaly
<clever>
eacameron: if the source is available, start with just a derivation containing a name and src = fetchurl and see what happens