2019-10-14

<clever> devalot: yeah
<clever> devalot: usually when it causes major breaking changes, and some people refuse to update their code
<clever> devalot: if you do anything else, your package will depend on 2 different lenses (via other libraries) and bad things will happen
<clever> devalot: write an overlay that does lens = self.lens_4_18;
<clever> fresheye1: nix-store --verify --check-contents --repair, i think
<clever> fresheye1: or just nix-store --delete the path that is corrupt, dont force it
<clever> fresheye1: nix-store --repair-path
<clever> fresheye1: nix-store --verify --check-contents, would have told you what was corrupt

2019-10-13

<clever> Ralith_: is the fix in home-manager or nixpkgs?
<clever> Ralith_: then it will be within your own users home
<clever> Ralith_: depends on if your using plain home-manager or the home-manager module in nixos
<clever> for the user doing the eval
<clever> Ralith_: thats in ~/.cache/nix/tarballs/
<clever> Ralith_: is the fix in a channel yet?
<clever> ornx: only the nixpkgs buildenv can run thngs in the post hook
<clever> ornx: its a limitation of the buildenv that nix-env uses to merge things
<clever> then install just that with nix-env
<clever> ornx: you could manually implement it if you make your own drv with buildEnv and a post command, and then put everything with icons into that buildEnv
<clever> ornx: only systemPackages via configuration.nix supports running commands after merging, to update such caches
<clever> danderson: lib.mkEnableOption may also interest you
<clever> danderson: ah, yep, that will do weird things
<clever> they should all be under config
<clever> danderson: you can also do `nix repl '<nixpkgs/nixos>'` and then eval any option you want, to see what is set to what
<clever> danderson: does the file exist in /etc/systemd/system/ ?
<clever> danderson: that error makes no sense to me either, but i would try `= lib.mkIf cfg.autoStart [ "multi-user.target" ];`
<clever> fresheye1: nix tells you, on the like immediately after that one
<clever> hpfr[m]: what does it hang on if you use -vvvv ?
<clever> hpfr[m]: are all substituters reachable?
<clever> hpfr[m]: its part of this clause
<clever> hpfr[m]: In addition, nixos-rebuild accepts various Nix-related flags, including --max-jobs / -j, --show-trace, --keep-failed, --keep-going and --verbose / -v. See the Nix manual for details.
<clever> fresheye1: you never answered that question
<clever> fresheye1: what did the nix-store -r over ssh return?
<clever> danderson: then it can figure out what your doing later, and not cause recursion
<clever> danderson: but if you instead config.environment = mkMerge ... ; config.systemd = mkMerge ...;
<clever> danderson: and it cant know what your mkMerge returns, until it knows what config.networking was
<clever> danderson: the problem, is that it must know every attribute of config.<?> before it can give you the value of config.networking.pppd
<clever> danderson: you also dont use the @ sign if you are giving each IF its oan ExecStart
<clever> danderson: nixos needs to know which attrs of config you are setting, so it can route around your value, and figure it out later
<clever> danderson: you need to break it up into parts, like i did in the weechat.nix example
<clever> danderson: you cant set config directly to the result of mkMerge, because they you cant depend on any part of config
<clever> jntd: you would need to use "${config.security.wrapperDir}/collectd" i think
<clever> jntd: /run/wrappers/bin/collectd
<clever> jntd: the wrappers all exist in /run/wrappers/bin/
<clever> jntd: systemd runs things as root by default, so you shouldnt need the wrapped binary
<clever> jntd: which one and why do you need it?
<clever> fresheye1: when ran over ssh, and only ssh
<clever> fresheye1: what does nix-store -r say?
<clever> bbl
<clever> evanjs: nix-info formats the channels differently, and doesnt include $NIX_PATH
<clever> fresheyeball: you need to do `nix-store --delete <thatpath>` to reset things and be able to test it
<clever> fresheyeball: and now youve ruined the test, it only works if the path doesnt exist
<clever> evanjs: can you include the full output of `nix-channel --list` (as root and not), and `echo $NIX_PATH` in the ticket?
<clever> fresheyeball: try `ssh user@host nix-store -r /nix/store/fmjrlfw1a8d4rqgiwbi87ia88fhix7fk-hello-2.10`
<clever> > "${hello}"
<clever> fresheyeball: then $NIX_PATH isnt being set, need a different test
<clever> fresheyeball: what error does ti fail with?
<clever> fresheyeball: what about `ssh user@host nix-build '<nixpkgs>' -A hello` ?
<clever> fresheyeball: what about `ssh user@host nix-store --version?
<clever> evanjs: and what channels you have
<clever> evanjs: i think the failure depends on the value of $NIX_PATH
<clever> fresheyeball: sshServe just uses sshd
<clever> its nixos, what do you even need state for? :D
<clever> gchristensen: in my case, its much more of a mystery, the entire network is just offline, including the router, so i have no way to debug anything!
<clever> gchristensen: ouch
<clever> j4m3s__: and what about the 2nd machine?
<clever> gchristensen: ah, still not fixed?
<clever> ,paste
<clever> ,pastebin j4m3s__
<clever> j4m3s__: how do the configs between the 2 differ? can you give more info like the lsblk of both?
<clever> gchristensen: all vpn's that connect out are mia, the public ip doesnt respond
<clever> gchristensen: that reminds me, my entire house just dropped off the face of the internet, while out for thanks giving
<clever> j4m3s__: would need to run tests in a vm to see if it does or doesnt work
<clever> j4m3s__: then something else must be wrong with the cryptodisk setup, are you using luks?, hmmm, maybe grub doesnt understand lvm on luks?
<clever> o1lo01ol1o: usually is
<clever> o1lo01ol1o: most of the time, you can just change the nix-channel, `nixos-rebuild boot`, and reboot
<clever> evanjs: so if the package is in the release.nix, the channel wont update until hydra has tried (but a failure still counts)
<clever> evanjs: the channel doesnt update until hydra has at least tried to build every single package
<clever> evanjs: thats what channels do
<clever> j4m3s__: setting the nixos option will pass that env var to grub for you
<clever> evanjs: either your own, or file a pr to nixpkgs, to hydra.nixos.org could pre-build it
<clever> j4m3s__: ah, that env var is a direct option for grub
<clever> evanjs: get hydra to build it for you
<clever> and nothing in nixpkgs checks that var
<clever> that flag just sets an env var before running install-grub.pl
<clever> j4m3s__: *looks*
<clever> j4m3s__: and youve set boot.loader.efi.efiSysMountPoint ?
<clever> j4m3s__: where is the EFI part mounted to?
<clever> j4m3s__: then grub must open the encrypted disk to find the kernel/initrd, and preLVM wont have any impact until after that step
<clever> j4m3s__: do you have a plaintext /boot ?
<clever> evanjs: both nix-build and configure+make result in a working binary, for `.../nix run nixpkgs.hello -c hello`
<clever> evanjs: 2.3.1pre6936_61e8162 passes here
<clever> cjpbirkbeck: which undid the effects of fixing /boot
<clever> cjpbirkbeck: it sounds like the bootloader was configured wrong, so all reboots where causing a rollback
<clever> nornagon: not sure if that will force-mount it (ignoring noauto), or it will just block the service from starting
<clever> nornagon: this tells systemd to not start the service until the given fs has been mounted
<clever> services/network-filesystems/samba.nix: unitConfig.RequiresMountsFor = "/var/lib/samba";
<clever> evanjs: bisect time!
<clever> nornagon: systemd also has a requires mounts for option
<clever> nornagon: you can use the normal options = [ "noauto" ]; to prevent that
<clever> nornagon: yeah
<clever> cjpbirkbeck: thats only to be used if the fat32 is mounted at /boot/efi
<clever> cjpbirkbeck: try removing this line, boot.loader.efi.efiSysMountPoint = "/boot/efi";
<clever> nornagon: this tells nixos how to run a fuse binary to mount something
<clever> nornagon: finding an example...
<clever> nornagon: you can do that with fileSystems.
<clever> evanjs: but you can use the other commands to get nix-info, to run that for the ticket
<clever> evanjs: nix-shell? nix-env? nix-build?
<clever> cjpbirkbeck: nix-env -iA nixos.gist ; gist --login ; gist -p configuration.nix hardware-configuration.nix
<clever> evanjs: weird
<clever> cjpbirkbeck: can you gist both files?
<clever> cjpbirkbeck: is hardware-configuration.nix listed in configuration.nix?
<clever> lukash_: for the nix-channel cmd
<clever> cjpbirkbeck: is it added to hardware-configuration.nix?
<clever> lukash_: try with --option sandbox false
<clever> cjpbirkbeck: what part doesnt work?
<clever> cjpbirkbeck: how does it not work when you run nixos-generate-config?
<clever> cjpbirkbeck: if /boot isnt mounted, then you wont be updating the boot config
<clever> cjpbirkbeck: is /boot mounted?
<clever> evanjs: that could explain random crashes in many programs
<clever> evanjs: id give memtest86 a pass
<clever> evanjs: got a backtrace?
<clever> lukash_: did you use strace -f?
<clever> bbl
<clever> lukash_: what does dmesg say?
<clever> lukash_: is this on nixos?
<clever> lukash_: is something mounted read-only?
<clever> pikajude: nix will use localhost automatically
<clever> lukash_: what user did you run it as?
<clever> lukash_: what error does --update give?
<clever> lukash_: nix-channel --list?
<clever> nornagon: nix-shell always uses bash, you can also try `nix run nixpkgs.jdk11_headless`
<clever> nornagon: yeah
<clever> nornagon: only add one of them to systemPackages, or add zero, and use nix-shell to pick one as-needed
<clever> Aleksejs: installing it wont add the headers, only nix-shell can do that
<clever> Aleksejs: you should use `nix-shell -p udev`
<clever> danderson: create a foo@.service, and then several foo@bar.service things, and it will spawn several instances of foo@.service, with %i filled in with bar
<clever> danderson: cant find an example, but you can also generate a foo@bar service (like the tty stuff in systemd), and use %i, oh containers
<clever> danderson: you can either use map/fold to generate several: https://github.com/cleverca22/nixos-configs/blob/master/weechat.nix#L54
<clever> or tar file generation
<clever> and there are other utils to list the context, for things like confinement
<clever> and what it must build first
<clever> when you pass such a string to stdenv.mkDerivation, nix uses the context to know what you depend on
<clever> yeah
<clever> and if you grab a sub-section of any string, you get the entire context
<clever> any time you concat 2 strings, the context is merged
<clever> nornagon: that second string, has some invisible data attached to it, saying it depends on hello-2.10.drv
<clever> > "${pkgs.hello}"
<clever> > pkgs.hello
<clever> nornagon: another thing to note, is that all strings in nix can have context
<clever> and the whole thing is shoved into confiment.packages
<clever> line 142 then joins that, with binSh, if binSh wasnt null
<clever> unitPkgs then decides between allPkgs (which is based on every attribute of the service) or execPkgs (only the ones in the execOpts)
<clever> execPkgs, will then map over all options with the execOpts names, and join them into a single string
<clever> execOpts is a list of strings, naming options
<clever> nornagon: i believe it uses any file that is in any of those strings
<clever> it will basically just `nix-store -qR` that binary
<clever> nornagon: ExecStart is a path to a binary in the store
<clever> i learned about the cache caches, because they broke :P
<clever> infinisil: an improper shutdown of my rpi corrupted those caches, causing all nix options on the rpi to fail
<clever> infinisil: fun fact, nix disables some sqlite safeties when interacting with those files (at least in the old days), to make it perform faster
<clever> if you delete them, it will re-check things
<clever> and these files are what hold the cache about the caches
<clever> [root@system76:~]# ls ~/.cache/nix/binary-cache-v6.sqlite*
<clever> /root/.cache/nix/binary-cache-v6.sqlite /root/.cache/nix/binary-cache-v6.sqlite-journal
<clever> jophish: `nix show-config | grep narinfo` tells you the ttl's
<clever> jophish: nix caches what is in the cache
<clever> dsx: ${./foo.sh} in a nix script
<clever> dsx: thats both good (makes it trivial to use) and bad (you could make a mistake, and add 2gig to the initrd)
<clever> dsx: you dont have to do a thing
<clever> dsx: if you reference a script in the nix store, nix will just include it in the initrd automatically
<clever> superbaloo: they could be hacked to accept a cross-compiled nixos closure
<clever> superbaloo: there are also some pre-existing expressions that you could modify, that generate an sdcard image, without running arm code
<clever> superbaloo: with the `nix copy` in step 3, you can copy to a `/mnt` on a remove machine, over ssh
<clever> superbaloo: oh, that reminds me, you may want to also look into the nix copy flags...
<clever> i should give things another spin
<clever> superbaloo: looks like a fairly basic cross-compile setup, last i heard, most packages broke with that, but it sounds like the recent nixpkgs has improve things
<clever> superbaloo: can you pastebin the nix files you used?
<clever> ah, nice, ive heard that had trouble
<clever> superbaloo: just nix? or all of nixos?
<clever> dsx: even if you add the script, what will run it? when do you want it ran?

2019-10-12

<clever> isd: and if you run `vgchange -a y`, does the `LV Status` in `lvdisplay` change?
<clever> isd: can you pastebin the output of `pvdisplay ; vgdisplay ; lvdisplay` ?
<clever> id say this is a bug in nix, when it decides if it should copy to the store or not
<clever> leo_: but youve got pkgs.path pointing to a symlink, which confuses nix, causing it to copy from store->store, and prefix another hash onto it
<clever> leo_: so nixops will always unpack that tar to a stable path, and pkgs.path points to that, and no copying happens
<clever> leo_: i'm also using -I nixpkgs=
<clever> leo_: until its too long and things blow up
<clever> leo_: each time you deploy, it copies that nixpkgs folder, and adds another hash to it
<clever> leo_: ah, then pkgs.path is a timebomb
<clever> leo_: oh, is this deploying to itself?
<clever> the next thing to do, is to find out why the path is that long
<clever> that confirms where the problem is
<clever> leo_: that one isnt referencing any paths that could be called nixos
<clever> just for testing
<clever> yeah
<clever> leo_: in the ${pkgs.path}
<clever> leo_: remove the $ from this line, then try `nixops deploy --build-only`: https://github.com/leosbotelho/cartons/blob/313b3bfa694cb09d9ddd4e757e86290d41f653a1/deploy/default.nix#L47
<clever> while evaluating the option `system.extraSystemBuilderCmds':
<clever> leo_: it may also help to know what changes happened to cause this error, why did it start?
<clever> thats nixops level debug, rather then nix level debug
<clever> --debug likely wont add much of value
<clever> leo_: for each of the hashes in that long path, check if its in the output of `env`
<clever> leo_: if you check `env`, do any of the hashes from the error appear in it?
<clever> Nix path: -I nixpkgs=https://github.com/nixos/nixpkgs/archive/ecf59492c75220e37caf533d09087349ab7e5577.tar.gz
<clever> [clever@system76:~]$ nixops info -d house --no-eval
<clever> that looks file
<clever> leo_: is there a nix path set in `nixops info` ?
<clever> leo_: and what is $NIX_PATH in that shell?
<clever> leo_: try again with -vvvv and --show-trace ?
<clever> leo_: reading more...
<clever> since it would copy the entire dir
<clever> leo_: ah wait, but in this case, id keep it like you have
<clever> leo_: toString is rarely needed, it should still work if you remove that and just ../.;
<clever> let dir = toString ../.;
<clever> leo_: can you pastebin the entire output of nixops?
<clever> leo_: your likely doing something wrong, somewhere
<clever> 8*
<clever> leo_: why do you have 6 hashes in the path??
<clever> leo_: can you paste the entire path here?
<clever> infinisil: ahh, wikipedia reveals that a filename (not a whole path) is limited to 255 chars
<clever> infinisil: yeah, but id expect any modern system to handle >255
<clever> leo_: thats not tht long...
<clever> leo_: how long is the path?
<clever> leo_: what filesystem is the /nix/store directory on?
<clever> leo_: what FS is the nix store on?
<clever> not sure, you would need to test a flag somewhere to see if your doing a native or cross build
<clever> superbaloo: as long as the native version doesnt, it should be fine
<clever> basically, just nix-build nixos, forcibly update the bootloader config, then rm -rf /lib /bin /usr, and fix the permissions!
<clever> isd: in the past, i have converted a single-user nix install on gentoo, into full blown nixos!
<clever> isd: i use `sudo -i` to get root shells
<clever> isd: mine is here
<clever> ls ~/.nix-profile/etc/profile.d/nix.sh
<clever> isd: you need to source the profile.d/nix.sh file
<clever> isd: `echo $NIX_PATH` ?
<clever> AmandaC: nix-store --query --deriver /nix/store/foo.img
<clever> AmandaC: some of the output paths will have to be tweaked
<clever> AmandaC: find the drv for the that path, and run `nix show-derivation` on it, to see the build command, then see if you can reproduce it by manually running the cmd
<clever> AmandaC: 404
<clever> and if its already built, it will just print the path to the result
<clever> and i own my own dir
<clever> drwxr-xr-x 3 clever users 13 Oct 9 04:11 /nix/var/nix/profiles/per-user/clever/
<clever> (its sticky, like /tmp)
<clever> Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)
<clever> File: /nix/var/nix/profiles/per-user/
<clever> i just look at the permissions on a nixos machine and copy them over, for any dir that fails
<clever> you need to own your subdir from /nix/var/nix/profiles/per-user/
<clever> and then fixing ownership for profiles
<clever> yeah
<clever> isd: recursive chown, -R
<clever> isd: it sounds like you dont have a multi-user setup fully configured, /nix/store and /nix/var should be owned by root (along with most of the subdirs), and nix-daemon has to be running as root
<clever> isd: is nix-daemon running?
<clever> infinisil: if you have write to /nix/var/nix/db/ then nix wont try to contact the daemon, and wont gain root automatically
<clever> isd: is nix-daemon running? who owns /nix/var/db ?
<clever> infinisil: --option sandbox false, is the simplest fix
<clever> infinisil: if you run it as root, it will fail because the nixbld group has no members
<clever> infinisil: yep, thats exactly it
<clever> AmandaC: you can run `nix-store -l /nix/store/foo` to get the logs for a build, if it passed
<clever> AmandaC:not sure what else to do then
<clever> and all context around it
<clever> AmandaC: can you pastebin the exact error?
<clever> matthuszagh: you want something like this, to append to it
<clever> pkgs/default.nix:postUnpack = "sourceRoot+=/socket-io; echo source root reset to $sourceRoot";
<clever> matthuszagh: sourceRoot must remain relative to . via the copy
<clever> matthuszagh: the unpackphase will copy $src to ., then set sourceRoot to be the path relative to ., after unpackPhase, it will cd $sourceroot
<clever> freedan42x: it looks like you forgot .env
<clever> but you can also add shellHook at the same time
<clever> freedan42x: this uses overrideAttrs to mutate a cabal2nix drv, and add buildInputs
<clever> freedan42x: override it
<clever> but you need a linux build slave to bootstrap, and sshd doesnt run on bootup yet
<clever> dminuoso: so it can generate a darwin qemu binary, that launches nixos
<clever> dminuoso: it forces nixos to be a linux build (only way it works), but it lets the qemu float, and default to whatever the host is
<clever> dminuoso: `nix-build -A go && ./result` will boot nixos under qemu
<clever> there is also...
<clever> dminuoso: that used to be automated in nixops, but recent improvements to the nix install script broke it
<clever> dminuoso: yep
<clever> dminuoso: its all in the nix manual
<clever> dminuoso: if your using a single-user install of nix on darwin, then nixops will configure the remote nixos machine to be a build slave
<clever> but this example needs a build slave that can actually run arm binaries
<clever> and in theory, it can do x86->arm like this
<clever> dminuoso: thats how nixops can deploy linux from darwin
<clever> dminuoso: nixops can use any build slave configured in /etc/nix/machines
<clever> bbl
<clever> thats why my main rig is still a dual-boot
<clever> avn: or proton!
<clever> AmandaC: try throwing a 20gig swap file at it, lol
<clever> AmandaC: how much free disk space?
<clever> infinisil: first, try to just nix-build the nix file in https://gist.github.com/a0722abf36a1cfc5cadf8e39c356fba5