2019-07-17

<clever> Yaniel: because name is based on the old version, you must override name= also
<clever> Yaniel: you need to set src also, version doesnt update right because of rec {
<clever> Yaniel: can you pastebin what your currently doing?
<clever> worldofpeace: nixos 17.09 can boot, so this did work at one time
<clever> worldofpeace: doing a bisect...
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ nix-build ./nixos/ -A vmWithBootLoader --arg configuration '{}'
<clever> [clever@amd-nixos:~/apps/nixpkgs-master]$ git checkout --track origin/release-16.09
<clever> worldofpeace: yep, fails to boot here
<clever> jcrd: override the src attr
<clever> worldofpeace: are you using the qemu script it provides?
<clever> worldofpeace: nixos adjusts the config for you
<clever> samueldr: tab completion
<clever> worldofpeace: and yep, both of my methods set that nixos option
<clever> worldofpeace: nix-build '<nixpkgs/nixos>' -A vmWithBootLoader -I nixos-config=./configuration.nix
<clever> worldofpeace: nixos-rebuild build-vm-with-bootloader
<clever> sounds like 2.2 is enough to fix it
<clever> ris: youll want to upgrade the nix-daemon to make that build
<clever> it broke things :P
<clever> so the daemon must be upgraded on all of your machines!
<clever> outputHashAlgo is just not specified anymore, and outputHash has changed format
<clever> looks like its a nix-daemon level breakage
<clever> "outputHash": "sha256-MRY2CCjnTPSWIv0/aguZcg5U+DA+ODLKl9vjB/qXFpU=",
<clever> strangely, i CAN build nixflakes with nix 2.2.2
<clever> no idea, news to me too
<clever> ris: it looks like only the nixFlakes derivation has this problem, so you need a new nix to get the new nix
<clever> the args to fetchFromGitHub where radically changed...
<clever> + hash = "sha256-MRY2CCjnTPSWIv0/aguZcg5U+DA+ODLKl9vjB/qXFpU=";
<clever> - sha256 = "1fq99fmlag5hxvgzxrclgfsnc1fhhfwnslyshad1934wi9nzx1s2";
<clever> commit 31c38894c90429c9554eab1b416e59e3b6e054df
<clever> ris: which version of nixpkgs are you on?
<clever> ris: does --show-trace give more details?
<clever> davidak: try starting it again and see if it makes it further
<clever> since i only had 10 per machine, i didnt run into davidak 's 2nd issue, with 100 on a single machine
<clever> aanderse: nixops creating 10 machines in aws, that each run 10 declarative containers
<clever> davidak: glancing at your issue, it seems to be more with starting the contains, then building things
<clever> davidak: and yes, it needed to eval nixos 110 times, which was murder on the ram :P
<clever> davidak: ive started 100 nixos containers, at 10 each, over 10 nixops deployments
<clever> dsx: `module =` is a full nixos config, which gets baked into a pxe image, and then the rest of this configures the machine to perform nat and router duties, and share that pxe image
<clever> nix-env -f '<nixpkgs>' -iA aws
<clever> ,locate bin/aws
<clever> kiloreux: it may help if both aws and glibcLocales come from the same nixpkgs
<clever> kiloreux: it sounds like the bash from aws, is linked against a glibc that cant understand the glibcLocales
<clever> kiloreux: i cant see anything obviously wrong
<clever> kiloreux: yep, it is opening the locale archive
<clever> open("/home/vagrant/.nix-profile/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
<clever> kiloreux: what about `strace -o logfile aws` and then pastebin the whole logfile, after confirming it doesnt contain your access-key-secret from aws
<clever> kiloreux: what is line 4 of ~/.nix-profile/bin/aws ?
<clever> kiloreux: and what does `locale` print out?
<clever> kiloreux: and it should be a subdir like this
<clever> export LOCALE_ARCHIVE=/nix/store/1pnj3bmp7cfk4c6fbrmzli9w3kcdlgmw-glibc-locales-2.27/lib/locale/locale-archive
<clever> kiloreux: if installing it with nix-env, you would point LOCALE_ARCHIVE to somewhere under ~/.nix-profile i think
<clever> kiloreux: how did you install it? nix-env? systemPackages?
<clever> kiloreux: what is the error your getting?
<clever> teto: i try to avoid with for that reason
<clever> teto: what was it?
<clever> not the chain of imports that created the thunk
<clever> teto: one problem, is that the --show-trace, is the call-stack of how a thunk got forced
<clever> teto: check over all of your files to see where you do pkgs =
<clever> teto: i think you have a pkgs =, in a nixos module
<clever> teto: including the _file additions
<clever> teto: can you link a branch on github with your changes?
<clever> but imports = [ { foo } ]; doesnt know where the attrset came from
<clever> teto: that is a special internal option that can be set on any nixos module, imports sets it for you, which is why you normally get useful errors
<clever> teto: _file = ./myself.nix;

2019-07-16

<clever> ah
<clever> hydra will also fail to eval the expr, because nixos lacks /usr/bin/xar
<clever> so you cant use the binary cache to help you if xar has a different hash
<clever> but "${/usr/bin/xar} -foo -bar" will hash the xar binary, copy it to /nix/store/, and your $out is based on the hash of xar
<clever> infinisil: so the closure is heavily stripped down
<clever> infinisil: when nixos is generating an initrd, it will copy just the bin/plymouth file, and then run ldd to find the .so's it needs, then copy just those, and re-patchelf things
<clever> infinisil: the initrd stuff excludes a lot of that
<clever> infinisil: commented on the issue
<clever> infinisil: what part of the closure is so big?
<clever> elvishjerricco: yeah, it also has a prompt thingy
<clever> infinisil: and zfs should wrap its prompt with that
<clever> infinisil: i believe there is a special plymouth command you have to run, to expose the text console
<clever> sphalerite: i had plymouth working in not-os at one point, lol
<clever> andi-: you dont want to make a nix expr to allow you to nix-build your videos? lol
<clever> and you can also just generate those xml yourself to declaratively edit things
<clever> i think behind the scenes, it generates xml files, and there is a CLI util to do the actual editing
<clever> andi-: https://kdenlive.org/en/ is packaged in nixpkgs, and ive used it before
<clever> andi-: one min
<clever> and after postUnpack, the stdenv will cd $sourceRoot
<clever> unpackPhase will set sourceRoot to the dir it made
<clever> it may be $sourceRoot/setup.py
<clever> exarkun: you want to run substituteInPlace on just plain setup.py, not $src/setup.py
<clever> you want to patch the copy thats already in .
<clever> exarkun: the unpackPhase already copied it to . for you
<clever> exarkun: is this in $src ?
<clever> exarkun: why wont the build system use it?
<clever> exarkun: copy the file to the working directory, and then use that
<clever> > xmlsec.outputs
<clever> frognix: nix will get .dev automatically, you shouldnt need to list both
<clever> frognix: what and how did you install it?
<clever> so you could have ~/.nix-defexpr/foo/bar/baz/default.nix, which appears as nix-env -iA baz.hello
<clever> nix-env will recurse until it finds either foo/default.nix or foo.nix, and then create a foo attr
<clever> thats why non-root can see roots channels
<clever> lrwxrwxrwx 1 clever users 44 Oct 11 2015 .nix-defexpr/channels_root -> /nix/var/nix/profiles/per-user/root/channels
<clever> and then you can let others read your default exprs
<clever> the `test` part of the directory is like a namespace, so each user can have their own namespace, with write permissions for only 1 user
<clever> note the lack of {}, so nix-env will supply that arg
<clever> or `import (builtins.fetchTarball ....)`
<clever> yorick: you can put any nix expr in there, that will return the top-level function of nixpkgs, like `import <nixpkgs>` would work
<clever> yorick: this allows me to nix-env -iA foo.hello
<clever> import /home/clever/apps/nixpkgs
<clever> [clever@amd-nixos:~]$ cat .nix-defexpr/test/foo/default.nix
<clever> yorick: you can also edit .nix-defexpr
<clever> yorick: you could
<clever> yorick: and this is all under nixops, so the deployment files refer to nas.nix and router.nix
<clever> yorick: nix-env -f '<nixpkgs>' -iA hello
<clever> jD91mZM2: probably
<clever> jD91mZM2: for my main desktop, i had to entirely disable efi before it would obey the CSM and boot legacy
<clever> jD91mZM2: compatability module? csm?
<clever> jD91mZM2: you will also need a bios boot partition, 1mb, not formated, not mounted
<clever> jD91mZM2: yeah, for nixos, you just need to set boot.loader.grub.device = "/dev/sda"; and then it will do both legacy and efi at the same time
<clever> jD91mZM2: i'm not sure its supported under efi, you may need to temporarily switch to legacy booting
<clever> jD91mZM2: dont think that will help much
<clever> jD91mZM2: try enabling btrace?
<clever> yorick: its a top level argument, check line 4 of the file i linked
<clever> yorick: check the nix code i linked above
<clever> yorick: isDefined might work there
<clever> for the same option?
<clever> yorick: options.thing.defined
<clever> c00w: nix-store -qR /run/current-system
<clever> for floppies, the reverse, the hole means its writeable
<clever> yeah, for tapes, the hole means its read-only
<clever> and you could just cut a notch into the floppy to make it writable
<clever> samueldr: "read-only" floppies just didnt have the write-enable nogth
<clever> samueldr: and now your back to how actually floppy floppies worked, lol

2019-07-15

<clever> andi-: in theory, you could then have a gdb plugin, that will use `nix-store --query --deriver` to find the drv behind a path, then `nix-store --query --binding debug` to find its .debug, and dynamically load that
<clever> andi-: there an idea i had before, if you build a package with splitDebug = true;, then you get a .debug output on it
<clever> __monty__: maybe open the pr, and mark it as being 90% done, so people can begin to comment on it
<clever> you must fix it for every single user, one by one
<clever> so you cant just fix it system wide
<clever> one problem i did run into, is that darwin's bash, will only source ~/.bashrc, and nothing from /etc/
<clever> symphorien: just confirmed, ~/.bashrc is ran, on the gentoo machine, with non-interactive shells
<clever> symphorien: it does still source one of them, i cant remember which
<clever> you can test it with `ssh user@host nix-store --version`
<clever> ensure both update PATH
<clever> ashkitten: .bash_profile vs .bashrc
<clever> ,libraries wildtrees
<clever> wildtrees: how did you wind up with that ssl in your profile?
<clever> wildtrees: one is the bootstrap tools openssl, the other is the non-bootstrap openssl
<clever> $ nix-diff $(nix-store -q --deriver /nix/store/wmry6hqygyysl97iflc3z7vg03imklvh-openssl-1.0.2r) $(nix-store -q --deriver /nix/store/c8k8dl7k6hahagzzkyw501dp1548sp99-openssl-1.0.2r)
<clever> __monty__: it would be interesting to find the JS files in both the debian and darwin builds, and diff them, to see why they differ
<clever> __monty__: i just unpacked the darwin pkg, and ran electron against it
<clever> __monty__: dont worry, i was doing the exact same thing for daedalus initially :P
<clever> wildtrees: yeah, what is the full path to both of them
<clever> wildtrees: what is the full path to the library?
<clever> wildtrees: if installed from the same nixpkgs, it will point to the same storepath for both users
<clever> tilpner: so you can change the binary without loosing connections
<clever> tilpner: irssi has a /upgrade command, that will re-exec itself, and forward all open sockets
<clever> __monty__: i think `dpkg -x` is just to extract the contents of the deb
<clever> __monty__: and the usual purity stuff like people assuming /bin/bash exists
<clever> __monty__: and often, the source isnt available
<clever> __monty__: mostly, to save the trouble of having to figure out their yarn deps and everything
<clever> __monty__: attr = self.callPackage ./local.nix {};
<clever> __monty__: any package overrides?
<clever> but it seems fairly simple to install nix inside docker
<clever> avn: not that i know of
<clever> avn: which could maybe itself be a docker image, lol
<clever> avn: doesnt need full nixos, just a linux kernel with nix installed
<clever> and once its in docker, you could just push it to a docker repo and leave nix behind
<clever> avn: line 180 even has a helper script, to auto-load it, so i could iterate faster
<clever> avn: this nix expr generates a docker image, so you can then just `docker load < result` to import it
<clever> exarkun: https://gist.github.com/cleverca22/f3e54a2e0ade7e5f38a6ee4b20d83e14 or 185 lines of nix, to generate a full docker image, that contains prometheus, grafana, oauth2_proxy, and nginx!
<clever> __monty__: try just using the latest version for all platforms and see what breaks
<clever> Filesystem Size Used Avail Use% Mounted on
<clever> tank/nix 160G 152G 8.0G 96% /nix
<clever> Miyu-chan: ive seen bigger
<clever> __monty__: its using yarn to build the final JS, but you can just rip that final JS out of the existing .deb
<clever> exarkun: its in both, lol
<clever> ,locate node_exporter
<clever> exarkun: prometheus is already packaged fully
<clever> Miyu-chan: also, `ncdu -x /` is great
<clever> du -ch /tmp/ --max=1 | sort -h
<clever> Miyu-chan: --max=1
<clever> Miyu-chan: dont use * there, du is already recursive
<clever> Zer0xp: youll want to use --add to switch it over, check the man page, then --update
<clever> Zer0xp: it should be showing this
<clever> Zer0xp: change the channel on root and rebuild as normal, `nix-channel --list` as root to see the current channels
<clever> Miyu-chan: what if you have a file named ..foo ?
<clever> Miyu-chan: a for loop and an if, lol
<clever> its patching the pre-built binary, for both platforms
<clever> __monty__: oh, maybe i was just mis-remembering that part
<clever> __monty__: nix-store --delete /nix/store/foo to remove corrupt things, dont use --force
<clever> __monty__: nix-store --verify --check-contents will look for any damaged paths
<clever> __monty__: you want `rm result` not `rm result/`
<clever> __monty__: once electron is packaged, both platforms can run it with something as simple as https://github.com/input-output-hk/daedalus/blob/develop/installers/nix/linux.nix#L19-L28
<clever> __monty__: then you (and others) can go with my original idea, and just run the nixpkgs electron on it
<clever> __monty__: i would maybe look into packaging electron for darwin, via its .pkg file
<clever> __monty__: and if you want to build electron with nix, your in for some fun!
<clever> oh, but electron itself is packaged the same way, lol
<clever> __monty__: so you could just extract the JS/html assets, and then run ${pkgs.electron} against it
<clever> __monty__: is it electron based?
<clever> betaboon: because its fetching the debian package, and patchelf'ing it
<clever> jackdk: i would expect that to just work
<clever> jackdk: how did you write the nixos iso to the usb?
<clever> to update hardware-configuration.nix
<clever> hiroshi[m]: yes, but youll want to re-run nixos-generate-config, after you mount them
<clever> hiroshi[m]: https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix#L95-L105 is how ive been doing my installs lately
<clever> and i try to also make /home its own dataset too
<clever> hiroshi[m]: also, i make sure to put /nix onto its own zfs dataset, seperate from /
<clever> and since EFI needs vfat, i just make /boot vfat and the ESP
<clever> for legacy booting, i make /boot ext4
<clever> hiroshi[m]: grub has trouble when /boot is on zfs
<clever> hiroshi[m]: personally, i make /boot the ESP (vfat) on zfs+efi machines
<clever> emily: line 9 tells nixos to use an overlay in the overlays dir, and line 13 bakes that overlays dir into the default NIX_PATH
<clever> emily: this is what ive done before
<clever> emily: it only obeys nixpkgs.overlays = [ ... ]; in configuration.nix
<clever> emily: last i checked, nixos-rebuild ignores overlays in NIX_PATH

2019-07-14

<clever> i can see exactly how many caches of what size exist, and how they are shared
<clever> and also makes the hyperthreading mess very clear
<clever> oborot: (hwloc.override { x11Support = true; }) re-enables the x11 gui
<clever> oborot: `lstopo --of ascii` gives the best ascii
<clever> oborot: lstopo from hwloc
<clever> rsoeldner: nix-shell -p myHaskellEnv
<clever> rsoeldner: its best to enter haskell envs with nix-shell, not nix-env
<clever> if the config is in git, you can just git clone, nixos-install, and 90% of your machine is back instantly
<clever> oborot: yeah
<clever> __monty__: if you run `nix repl ~/src/nixpkgs` and then eval `wire-desktop`, what does it return?
<clever> __monty__: what is the exact command you ran?
<clever> if that is missing, it loads default.nix in the current dir
<clever> the raw path you give it, is the path to a nix file it loads
<clever> nix-build ~/apps/nixpkgs -A foo, for example
<clever> you need to give it the path without any args
<clever> you need to be in the root of nixpkgs, or give it the path to the root default.nix
<clever> thats your issue
<clever> __monty__: are you in the root of the nixpkgs dir?
<clever> the config on how to find /boot, is baked into the 1.5 binary, in the bios boot partition
<clever> so it has to decrypt that before it can read it
<clever> but the grub config file is on /boot/
<clever> yes
<clever> a motivated attacker can just modify the part of grub that is asking for a passphrase
<clever> it heavily complicates things, and doesnt add that much security, because the grub stage 1.5 is still in cleartext
<clever> is /boot encrypted or cleartext?
<clever> nixos is responsible for it
<clever> and that output only happens if /boot is encrypted, which i generally avoid
<clever> oborot: that error is coming from grub, not nixos, its possible that grub failed to install correctly, and thats your old grub config
<clever> oborot: can you screenshot the error?
<clever> oborot: and what is the exact error?
<clever> oborot: what does hardware-configuration.nix and configuration.nix say?
<clever> the automation is also cheap enough that i just make multiple certs
<clever> aveltras: ive not tried using security.acme yet
<clever> aveltras: when using virtualHosts.foo.enableACME, its fully automatic
<clever> 26 people in there right now
<clever> chreekat: there is #haskell.nix to discuss it
<clever> Miyu-chan: bit distracted right now, but remind me to check it in a few hours
<clever> thats what i prefer
<clever> and skip the lvm
<clever> Miyu-chan: but nixos now remembers the passphrase, so you can just make 2 luks devices, on 2 partitions
<clever> Miyu-chan: that was to avoid having 2 passphrase prompts on bootup
<clever> Miyu-chan: that guide is saying to create a luks volume, and then put lvm inside of luks, and then put swap+root on lvm
<clever> Miyu-chan: ah, i think i see part of the problem, and its not needed anymore
<clever> Miyu-chan: nixos-generate-config doesnt understand zfs either
<clever> Miyu-chan: i think that depends on if your mixing luks and lvm
<clever> chreekat: fairly difficult to do that
<clever> chreekat: yeah, the point where the nix exprs turn into derivations
<clever> chreekat: often the name is just "source", so if you give it a sha256 that exists in /nix/store, it just uses that path, and doesnt download it
<clever> chreekat: it will compute the /nix/store/foo of a fixed-output drv, based on the sha256 and name
<clever> chreekat: if you use the hash of a random thing, it will give you that random thing, not an error about an incorrect hash
<clever> ,tofu chreekat
<clever> Miyu-chan: things like imports = [ { module } ];
<clever> that saves each user from having to generate a unique image for their keypair
<clever> if you create /ssh_pubkey before you /kexec_nixos, it will be copied into the image, and added to /root/.ssh/authorized_keys
<clever> its already setup to get an ssh key at start time
<clever> but that should be possible
<clever> not currently
<clever> :D
<clever> note that the state file contains an ssh private key with root access
<clever> i would just keep a single copy of the nixops state file on a central-ish machine
<clever> just re-run nixops create on the same nix files, and you can deploy
<clever> for the none backend, yep
<clever> nixops will generate its own keypair for root ssh, but it will need a password or ssh-agent to get in the first time
<clever> but any non-default users will be removed automatically
<clever> its on by default, so passwords will persist
<clever> aveltras: depends on if you have mutable users enabled or not in the config nixops deploys
<clever> aveltras: and anything needed to make it boot and get network
<clever> aveltras: yes
<clever> gchristensen: i think it gets picked up right away
<clever> lol
<clever> you want hasPrefix (toString /path)
<clever> so its likely comparing against the storepath too
<clever> yep, its the length of the storepath copy
<clever> but then == compares against a different str?
<clever> stringLength may use toString, which doesnt copy
<clever> __monty__: rawapp is the result of yarn2nix
<clever> __monty__: here is an example of an electron app ive packaged with nix, https://github.com/input-output-hk/daedalus/blob/develop/installers/nix/linux.nix#L19-L28
<clever> __monty__: i generally prefer building from src