2020-06-07

<clever> ninjin: the only thing i can think of, is that there is a magic key you can press at the systemd boot menu, to override the default option
<clever> betaboon: yep
<clever> ninjin: do you have physical access, or is it cloud based?
<clever> yep, systemd, it should just work
<clever> ninjin: what does this report?
<clever> grep bootloader /run/current-system/bin/switch-to-configuration -A2 | tail -n1
<clever> ninjin: are you currently using systemd-boot or grub?
<clever> i usually use gist for that
<clever> what about `efibootmgr -v` ?
<clever> yeah, that looks right
<clever> ninjin: what does `df -h /boot/` report?
<clever> ninjin: is /boot/ correctly mounted when you deploy?

2020-06-06

<clever> ldlework: youll need to either import the home-manager modules or define fake ones
<clever> ldlework: nixpkgs/nixos/lib/make-options-doc/default.nix
<clever> jakob_rs: its deep in the source for `class LocalStore` i think
<clever> infinite recursion
<clever> pkgs depends on config.nixpkgs.overlays
<clever> config= depends on pkgs.lib.mkIf
<clever> because nix needs to know what your config= on line 11 returns, before it knows what the value of pkgs is
<clever> and then `with lib;`
<clever> ldlework: try using `{ config, pkgs, lib, ... }:`
<clever> thats not infinite recursion
<clever> anonymous function at /nix/store/lcnb1m4f4h3zm8v3b287l5sysqwh33w9-nixos-20.09pre226148.0f5ce2fac0c/nixos/pkgs/build-support/build-fhs-userenv/env.nix:3:1 called with unexpected argument 'version', at /nix/store/lcnb1m4f4h3zm8v3b287l5sysqwh33w9-nixos-20.09pre226148.0f5ce2fac0c/nixos/pkgs/build-support/build-fhs-userenv/default.nix:8:9
<clever> reading the trace now
<clever> ah
<clever> ldlework: can you pastebin that code?
<clever> ldlework: where does this file then get into imports?
<clever> ldlework: does it fail the same way if you use a local path in imports?
<clever> remote nix*
<clever> but also tells that remote ssh, to act on /mnt/nix/store/
<clever> so `ssh://root@target?remote-store=local?root=/mnt` tells the local nix to talk to a remote nix over ssh
<clever> the ssh://user@host style, also supports taking the same uri as remote-store=
<clever> i'm not sure if its been fully documented, but the above gist shows a bunch of examples
<clever> ?root= will tell it to prefix paths before it opens them
<clever> local means that nix should just open /nix/store directly, instead of asking nix-daemon via a unix socket
<clever> jakob_rs: dont think so
<clever> it behaves like a chroot, so that would look in /other/nix/store/nix/store
<clever> which populates /nix/store/.links/ with hardlinks of duplicate files
<clever> there is also nix-store --optimize
<clever> dont think so, but that might be an idea to request on nix
<clever> yeah
<clever> then it will read /other/root/nix/store and copy things over to its private /nix/store
<clever> add local?root=/other/root/ to substituters in nix.conf
<clever> you can also have seperate /nix's but use the other /nix like a read-only cache
<clever> so you would want the default profile to be different
<clever> for nixos, it gets nix from /run/current-system/sw/bin/
<clever> you could just use the same profile for both OS's
<clever> yeah
<clever> yeah
<clever> jakob_rs: if the target from one of these links goes away, then it can be GC'd
<clever> lrwxrwxrwx 1 root root 47 Oct 7 2019 03x9dj95m1iija6c1bm6akf8s4ym5sjr -> /home/clever/iohk/rust-cross/hello-world/result
<clever> total 179
<clever> $ ls /nix/var/nix/gcroots/auto/ -l
<clever> jakob_rs: the ones in in /nix/var directly are fine
<clever> jakob_rs: the problem is mostly the auto roots
<clever> so you need to add it to imports
<clever> ldlework: but its in the form of a module, its a set with imports
<clever> that should work
<clever> then just symlink ~/.nix-profile to the right one
<clever> i believe $NIX_PROFILE tells nix-env which one to act on by default
<clever> like profile-a and profile-b
<clever> jakobrs: you can just have a different profile in /nix/var/nix/profiles/per-user/$USER/foo
<clever> jakobrs: if you also share $HOME between both distros, it will be less of an issue
<clever> jakobrs: main problem, is that any result symlinks nix-build leaves around, wont be seen from the other OS, and may get garbage collected
<clever> yep
<clever> ldlework: for new modules, just add to imports and your done
<clever> ldlework: look at disabledModules in the nixos manual
<clever> yeah
<clever> > hello.drvPath
<clever> you would have to map over all of nixpkgs, to find which attribute made the drv
<clever> JJJollyjim: there is no way to go back from a .drv to a nix expr, the passthru is lost by that point
<clever> this will take everything in my systemPackages, and extract anything with a .tests
<clever> [ ]
<clever> nix-repl> builtins.concatLists (map (x: if x ? tests then [ x.tests ] else []) config.environment.systemPackages)
<clever> [root@amd-nixos:~]# nix repl '<nixpkgs/nixos>'
<clever> JJJollyjim: that is a key in nix's passthru i believe
<clever> > nix.perl-bindings

2020-06-05

<clever> mkg20001: i was able to get a few blizzard games to run under lutris
<clever> > pkgs.lutris
<clever> so for the above tar, you would want: nix-env -f channel:nixos-16.03 -iA haskellPackages.stack_0_1_10_1
<clever> fragamus_: hackage-packages.nix is what defines haskellPackages
<clever> kenran: `--argstr foo bar` only works if it takes a set
<clever> ashkitten: $out can even be a bare symlink
<clever> hpfr[m]: mkMerge tells the module framework to merge things according to the type for each option
<clever> > :p lib.recursiveUpdate { a.a = [1]; } { a.a = [2]; }
<clever> > lib.recursiveUpdate { a.a = [1]; } { a.a = [2]; }
<clever> hpfr[m]: but when keys collide, it will just overwrite, not merge
<clever> hpfr[m]: lib.recursiveUpdate or lib.mkMerge depending on context

2020-06-04

<clever> Henson: yeah
<clever> Henson: youll need to modify what was adding it
<clever> Henson: you cant map over a nixos option like that, you need to set it without depending on the current value
<clever> nix-env sometimes eats error messages
<clever> dkjii: try `nix-build -E '....'` ?
<clever> dkjii: its possible that that had no impact on the build, so nix didnt need to do anything
<clever> dkjii: the nix sandbox heavily enforces what a package can see while building, to ensure it builds the same way on any machine
<clever> dkjii: any compile errors that would occur would have happened on the cache as well, but you can build with `--option substituters ""` to ignore the cache anyways
<clever> if everything is working properly, your just wasting cpu time to produce the identical result
<clever> dkjii: why?
<clever> dkjii: if any inputs to a build change, it will be rebuilt, no need to force a rebuild from source
<clever> dkjii: nix cant use distcc, but has its own remote builder logic
<clever> dkjii: why do you want to build from source?
<clever> dkjii: add it inside the {} for configuration=
<clever> ritchan: nix-env --profile /nix/var/nix/profiles/system --list-generations
<clever> yeah
<clever> fps: -I takes the same thing that goes into $NIX_PATH
<clever> ritchan: zfs uses hostId to figure out if a pool is being imported on 2 machines at once (via network blocks), vs improper reboot (same hostid)
<clever> ritchan: you only get kernel modules if you set boot.supportedFilesystems = [ "zfs" ];
<clever> fragamus_: `nix repl '<emu>'` and use tab completion to figure out the attr name
<clever> fragamus_: -iA stack
<clever> ,-A
<clever> ,-iA
<clever> imports is just a list of those
<clever> almost anywhere you can put a module, you can have either a naked module (function or set), or a path to a file containing the same
<clever> evanjs: you could change line 22 into a module, configuration = { imports = [ ./configuration.nix ]; other.config = true; };
<clever> evanjs: and how are you building it?
<clever> evanjs: what you can do with --arg, depends on what the default.nix can accept, so i would have to see that file first
<clever> evanjs: that is basically the only thing --arg/--argstr can do
<clever> one sec
<clever> evanjs: --argstr cant set nixos options
<clever> ohhaimark[m]: and you already have one commented out on 75
<clever> ohhaimark[m]: i believe home-manager's pkgs tree is isolated, and respects the nixpkgs.config.allowUnfree in the home-manager modules
<clever> ohhaimark[m]: and in which file did you install dropbox?
<clever> ohhaimark[m]: which package is causing the error?
<clever> evanjs: and thats the same as just `imports = [ path ]; virtualbox.params = value; }`
<clever> energizer: only if your running nixos-install inside docker or another namespace
<clever> energizer: i'm out of ideas then
<clever> energizer: try ext4 just to see if it behaves any different
<clever> energizer: try ext4?
<clever> energizer: i think its filesystem related, not physical
<clever> or try the install ISO, or kexec
<clever> wait for somebody else to know more
<clever> i wouldnt expect formatting to fix it
<clever> check lsof
<clever> not sure what else to do then
<clever> and did `nix copy` get ran first?
<clever> what cmd gave that error?
<clever> and `nix copy` will copy from host to chroot
<clever> the `nix build` builds it on the host store
<clever> its just the output path from building the derivation
<clever> energizer: the product that `nix build` created
<clever> local?root= basically makes nix chroot
<clever> ah
<clever> ?
<clever> yeah
<clever> you would have to build with the new names it will have, when you plan for it to boot
<clever> the initrd may have trouble finding things
<clever> energizer: maybe, it also depends on if the values for things like fileSystems."/".device are going to still be correct after you do that
<clever> it shouldnt have to build anything, and complete much more quickly
<clever> and once thats done, try the nixos-install again
<clever> energizer: then when its done, `nix copy --to local?root=/mnt/dev/fsroot/ /nix/store/product` to copy it to the new hdd
<clever> energizer: that should build the target, in the host /nix/store
<clever> energizer: to work around it, first try doing `nix build -f '<nixpkgs/nixos>' system --arg configuration /mnt/dev/fsroot/etc/nixos/configuration.nix`
<clever> energizer: thats weird
<clever> energizer: can you pastebin the entire output, including the cmd you ran?
<clever> energizer: was nixos-install ran as root?
<clever> dkjii: ah, why are you trying to build nix from source?
<clever> dkjii: and then run autoreconfPhase i think it was
<clever> dkjii: nix-shell -p autoreconfHook
<clever> dkjii: add autoreconfHook to nativeBuildInputs and it will do that step for you
<clever> alternate solution: stdenv.mkDerivation ({ most options; } // lib.optionalAttrs bool { conditional; })
<clever> dkjii: anything you dont update, keeps using the old glibc, that it was last built against
<clever> dkjii: but only firefox will use the new glibc
<clever> jgerhardt: id do it as an attribute, libpcap_bluez = libpcap.override { withBluez = true; };

2020-06-03

<clever> infinisil: oh, thats new
<clever> you can get it there with nix-instantiate or nix-copy-closure
<clever> lovesegfault: you need the .drv on your local machine first
<clever> lovesegfault: run `nix-store -r` on it
<clever> ph88^: build-time is whatever you passed to the derivation, runtime is whatever your output still contains the paths to
<clever> energizer: yeah, ssh also pokes a hole automatically as well
<clever> energizer: INPUT says packets have to first go thru nixos-fw, and nixos-fw then defines the primary rules, ultimately ending in `-j nixos-fw-log-refuse`
<clever> energizer: nixos-fw-accept is a special chain used to accept packets, and things only go there if another rule in INPUT related chains decides to allow it
<clever> energizer: i find it much easier to read the output of `iptables-save`
<clever> jlv[m]: ^
<clever> > pkgs.steam-run
<clever> yeah, thats basically to handle the FHS layer, to make it look more like debian
<clever> that also makes it very difficult to diagnose compatability problems
<clever> jlv[m]: some games have some DRM in place, which makes it very difficult to launch outside of steam

2020-06-02

<clever> betaboon: if you flag it as readonly in the tgt config, that cant happen
<clever> betaboon: thats because it assumes that each client will be writing, and they will corrupt the fs
<clever> joehh1: look up disabledModules in the nixos manual
<clever> so they cant clone anything
<clever> also, activation scripts run before the network is up

2020-06-01

<clever> hazel: watch how it reacts when you try to use some ram though
<clever> hazel: `arcstat -v` explains what each field is
<clever> hazel: run this, and you can see zfs stats
<clever> arcstat -f time,read,dmis,dhit,dh%,mrug,mru,mfu,mfug,mread,c,ph%,pm%,mm%,miss,hits,mhit,mh%,mmis,hit%,eskip,arcsz 10
<clever> yeah, i need to use rsync more
<clever> so the result symlinks turn into directories with a random store path
<clever> one nasty surprise i ran into when doing similar, `scp -r` wont preserve symlinks
<clever> immae: yeah
<clever> immae: which requires using legacy
<clever> immae: the initrd scripts arent fully zfs aware, and just blindly use `mount -t fs ${dev} ${mountpoint}` to mount things
<clever> immae: once systemd is kicking into gear, your mountpoint=/anything stuff should take effect, and fill in the holes nixos isnt aware of
<clever> immae: and anything involved in / and /nix/store has to be like that
<clever> immae: anything that is in the fileSystems attrset should use mountpoint=legacy
<clever> LevelChart8: ghc863 may not be in your version of nixpkgs, just remove it from the config
<clever> LevelChart8: the `let ... in;` goes before the { on 3
<clever> LevelChart8: by adding another { on 34, you broke things
<clever> LevelChart8: the { in my example, is the { you already have on line 3
<clever> ,locate bin gsettings
<clever> LevelChart8: or do `let ...; in { environment.systemPackages = [ ... ]; }`
<clever> LevelChart8: you need to either do `{ environment.systemPackages = let ....; in [ .... ]; }`
<clever> gchristensen: but if doesnt re-add all LUN's when tgtd restarts, and has other weird bugs
<clever> gchristensen: its generating a seperate systemd service for each LUN, and using tgtadm to add/remove/change the LUN
<clever> gchristensen: ive tried removing that, and making one systemd service per block-dev, but its got some bugs, and your wireguard changes kind of fit the same style i was aiming for
<clever> betaboon: instead, tgt-admin (a perl script) will parse the config file, and run tgtadm to change the daemon state to match the config
<clever> betaboon: but neither tgtadm not tgtd support its own config file!
<clever> betaboon: tgt is a bit of a confusing package, tgtadm is the c binary to control tgtd (the daemon)
<clever> gchristensen: and we got matrix'd hard, lol
<clever> i'll keep digging
<clever> maybe thats not an option
<clever> betaboon: oh, also...
<clever> betaboon: tgtd should have a flag to make it export read-only, to enforce things
<clever> betaboon: and fileSystems could mount the ext4 by LABEL=
<clever> betaboon: the iscsi could export either a squashfs or just a plain ext4 fs
<clever> betaboon: yeah
<clever> betaboon: leading to days of debugging, where X cant build because Y doesnt exist, yet Y clearly exists, and its not the nix sandbox
<clever> betaboon: those same programs, also assume any non-zero return from readdir, means end of dir, and claim the directoryis then empty
<clever> betaboon: and half a dozen things in nixpkgs are built without, so they get EOVERFLOW just trying to readdir()
<clever> betaboon: that means any program calling readdir from 32bit, needs to be compiled with large file support, or it just gets EOVERFLOW
<clever> betaboon: my nfs server was using xfs, so inode numbers went over 4 billion (32bit limit)
<clever> betaboon: https://backreference.org/2013/12/23/diskless-iscsi-boot-with-pxe-howto/ this also has a quick guide on how to manually connect to iscsi and format things
<clever> betaboon: and thats the daemon that iscsi talks to
<clever> > pkgs.tgt
<clever> > pkgs.tgtd
<clever> betaboon: that code also pre-dates the initrd having proper network support, and some things may need tweaking
<clever> betaboon: but in my case, i was using the pi's as builders, so they needed a writeable store
<clever> betaboon: and leave / as a tmpfs
<clever> betaboon: you would adjust it to just mount the /nix volume read-only
<clever> betaboon: i used this to netboot my rpi's, because nfs on a 32bit system gives you way way more trouble then your expecting
<clever> betaboon: ah, that sounds like you want iscsi-boot
<clever> betaboon: you could use your postDeviceCommands to symlink /dev/store to /nfs/nix-store.squash, and then fileSystems can mount it
<clever> betaboon: this will use a tmpfs for / and fetch the squashfs from whatever root= was (which gets symlinked to /dev/root)
<clever> ahh
<clever> yeah
<clever> betaboon: have you seen how the existing read-only netboot in nixos works?
<clever> betaboon: you can put the ro and rw parts at outside of the final rootfs as well, let me find an example
<clever> betaboon: yeah
<clever> betaboon: why are you bound to nfs?
<clever> veleiro: stderr is still stderr, so its up to whatever started php
<clever> betaboon: use postDeviceCommands to parse the info out of the kernel cmdline
<clever> betaboon: what about something like iscsi and squashfs?
<clever> does it even need to be nfs?
<clever> betaboon: does the / actually need to be nfs mounted? what if / was a tmpfs and just discarded? and nfs mount /nix/store/
<clever> betaboon: you could also just use $root in postDeviceCommands to mount things yourself
<clever> betaboon: but that would let you refer to /dev/root in the configuration, fileSystems."/.ro" = { device = "/dev/root"; }
<clever> betaboon: not entirely sure what will happen if /dev/root is a symlink to an nfs server,when it tries to mount it later on
<clever> betaboon: it would be simpler to jsut use the initrd as it exists in nixpkgs, and set fileSystems like the examples i linked
<clever> betaboon: stage1 is meant to be ran from the initrd, so running it like that will likely malfunction massively
<clever> stage-1 lives in the initrd, and youve skipped it
<clever> betaboon: then stage-1 is never ran at all
<clever> betaboon: are you actually using the initrd?
<clever> betaboon: the rootfs you specify doesnt become / until line 602
<clever> betaboon: that is operating on the initrd / not the rootfs /
<clever> betaboon: where is stage-1 assuming that the / is writable?
<clever> /home/clever/apps/nixpkgs/nixos/modules/installer/cd-dvd/iso-image.nix: { fsType = "overlay";
<clever> betaboon: you can do the same against / as well i believe
<clever> betaboon: this mounts a ro fs to /nix/.ro-store, then a tmpfs to /nix/.rw-store, then uses overlay to merge them at /nix/store/
<clever> betaboon: there are already scripts to automate that with the current stage1
<clever> hazel: last i checked, zfs doesnt support any form of hibernation

2020-05-31

<clever> noreferences: better to not "install" any jdk's in that case, use makeWrapper&friends to make certain programs use the right jdk directly
<clever> abathur: sounds like the nix-daemon is too old for the new hashing setup
<clever> chaoflow: sqliteInteractive has readline support
<clever> Stuck_: depends on the machine, some have it in hw, some just have fn+f2 to toggle it in semi-software
<clever> Stuck_: that implies you hit the switch to disable wifi
<clever> Stuck_: have you checked rfkill?
<clever> ,tofu romdisc
<clever> romdisc: look at the original gperf, `nix edit nixpkgs.gperf` and set src the same way, but with the new version and hash
<clever> romdisc: you need to override name and src
<clever> romdisc: also gperf doesnt use the version attribute, so overriding version wont actually change the version
<clever> romdisc: why is it not using stdenv.mkDerivation ?
<clever> romdisc: can you pastebin the shell.nix?
<clever> romdisc: how did you assign the overlay in shell.nix?
<clever> its part of the c++ builtins, but not in the builtins set
<clever> > baseNameOf
<clever> > baseNameOf ./foo/bar
<clever> ,xy
<clever> baseName = baseNameOf (toString name);
<clever> lovesegfault: oh, you want basename right?
<clever> > builtins.tail [ 1 2 3 ]
<clever> for haskell style `x:rest = list` pattern matching
<clever> hmmm, yeah, tail is not the last element, but rather, the 2nd element onward
<clever> and return the path to the copy instead
<clever> but if you treat the path as a string (dont toString it), then it will copy to the store
<clever> > "${./.}"
<clever> if you toString a path, it returns its original location
<clever> > toString ./path/does/not/exist
<clever> lovesegfault: so, line 3 will print self.lib.tail (the function), and then return the list
<clever> lovesegfault: line 3, the problem is that trace takes 2 args `builtins.trace "foo" "bar"` will print "foo", but return "bar"
<clever> lovesegfault: how are you calling it?