2019-08-03

<clever> joebobjoe: the sandbox is basically a container, it changes what / maps to, so you cant search!
<clever> joebobjoe: there is also the optional sandbox, which basically builds things in a container, so you cant even be naughty and look in /nix/store/*/ yourself
<clever> joebobjoe: because X is at /nix/store/hash-x, you cant auto-detect it without nix giving you the whole path to it
<clever> joebobjoe: correct
<clever> joebobjoe: and then when i remove X, the package breaks hard
<clever> joebobjoe: when i was on gentoo, some packages would enable featues i didnt say to enable, because it auto-detected X installed, and enabled support for X
<clever> joebobjoe: and sometimes you may run into issues where you have to update 20 things just to remove 1 thing
<clever> joebobjoe: but to apply that new package file, you need to atomicly update everything listed in it
<clever> or `nix-env -e python3` to remove it temporarily, without also updating everything else at the same time
<clever> so you can temporarily ignore this advice, and `nix-env -iA nixpkgs.python38` to update just one thing, rather then updating it all at once
<clever> 1 just tells nix-env to install each thing seperately
<clever> 2 creates a single massive package in nix-env, and you must update it all at once
<clever> i also prefer 1 over 2
<clever> joebobjoe: 1 is directly part of nix, 2 make use of nixpkgs (you almost never use nix without nixpkgs), 3 is a 3rd party extension
<clever> iqubic: single quotes stop ~ from doing its job
<clever> iqubic: use that path instead lf <home-manager>
<clever> iqubic: is home-manager in there?
<clever> iqubic: [clever@amd-nixos:~]$ ls ~/.nix-defexpr/channels/
<clever> joebobjoe: thats why nixos doesnt use /bin and /lib at all
<clever> srhb: *eyes go*
<clever> FRidh: and if it was already installed, then it updates to whatever the expr gave
<clever> FRidh: -u will always use names, but if you -i a list/set, it will install just the things in that list/set
<clever> iqubic: you need to relog the first time you add a non-root channel
<clever> legacy code i'm guessing
<clever> srhb: -u matching by name
<clever> srhb: thats what i suspected
<clever> srhb: does guix even work on darwin?
<clever> joebobjoe: unstable is the latest version of master to pass a set of tests
<clever> joebobjoe: youll also want to look at that line of all-packages.nix
<clever> > builtins.unsafeGetAttrPos "python38" pkgs
<clever> > python38.meta.position
<clever> so users have to want 2
<clever> or 2 has major difference from 1 and breaks things
<clever> joebobjoe: 2.7 may not be stable?
<clever> joebobjoe: 2 > 1
<clever> joebobjoe: thats python 3.8, try nix-env -iA nixpkgs.python3
<clever> joebobjoe: thats exactly what mystuff in config.nix is doing
<clever> what attribute did that come from? :D
<clever> joebobjoe: have fun dealing with `nix-env -E 'giant lump of nix' -i`
<clever> joebobjoe: its all in the nixpkgs manual
<clever> joebobjoe: thats how you override what a package does
<clever> and it will replace the old mystuff with the new mystuff
<clever> joebobjoe: this creates a custom mystuff package, and then i can just nix-env -iA nixpkgs.mystuff
<clever> joebobjoe: i do that with a config.nix file
<clever> joebobjoe: yeah
<clever> joebobjoe: there are plans to improve that further
<clever> thats why people recomend home-manager
<clever> yeah
<clever> because it didnt save the attribute when installing
<clever> both match python3*
<clever> > python38.name
<clever> thats by attribute name, not .name
<clever> > python3.name
<clever> you want `nix-env -iA nixpkgs.python3` as i said above
<clever> -i also searched by name, and leads to unpredictable results
<clever> ,-A
<clever> i prefer -i, so i know exactly what is happening
<clever> probably
<clever> hence why i dont use -u
<clever> 2019-08-03 02:24:51 < clever> joebobjoe: i dont trust -u, and prefer -i
<clever> and it gets confused when you have a dozen versions to pick from
<clever> and -u searches for things with a similar name
<clever> nix-env tracks the name of the package, not the attribute path
<clever> nix-env -i cant track the attribute names
<clever> joebobjoe: thats what home-manager can solve
<clever> joebobjoe: then you want python3, which is 3.7
<clever> python38 is version python3-3.8.0b2
<clever> joebobjoe: nix-env -iA nixpkgs.python38 is what you want
<clever> joebobjoe: i dont trust -u, and prefer -i
<clever> its just not the default version of python3 currently
<clever> > python3
<clever> that exact version is already in nixpkgs
<clever> > python38
<clever> it has already computed the outcome of adding irssi to roots profile, and didnt have to re-compute it
<clever> joebobjoe: those generations are also why installing irssi as root a second time didnt do anything
<clever> joebobjoe: you want to run --set on whatever profile-21-link points to
<clever> joebobjoe: that is the version you where on, prior to the rolback
<clever> joebobjoe: does profile-21-link exist?
<clever> joebobjoe: ls -l /nix/var/nix/profiles/per-user/moon/profile
<clever> joebobjoe: ls -l ~/.nix-profile
<clever> iqubic: such as?
<clever> joebobjoe: figure out what storepath the new generation is at, and use `nix-env --set /nix/store/foo`
<clever> iqubic: channels are just tar files containing nix files
<clever> that will undo the last change you did
<clever> joebobjoe: /nix/var/nix/profiles/default-12-link/bin/nix-env --rollback
<clever> joebobjoe: what does `ls -lh /nix/var/nix/profiles/default` report?
<clever> joebobjoe: you just uninstalled nix!
<clever> joebobjoe: as i said, nix itself is in roots profile
<clever> ,howoldis joebobjoe
<clever> joebobjoe: the stable channels are named after the year and month of release
<clever> joebobjoe: -add will overwrite if the name collides
<clever> joebobjoe: you could use both at once, but you said switch
<clever> then --update to apply the changes
<clever> joebobjoe: you can confirm what has happened with --list, there should just be a single entry named nixpkgs
<clever> joebobjoe: run `nix-channel --add` with the right params, as root
<clever> joebobjoe: always, but most linux distros only give you a single libc, but nixos gives you many
<clever> joebobjoe: nix just applies those same basic rules to every single dependency, so it doesnt care what the host OS is
<clever> joebobjoe: nix hashes every single dependency
<clever> joebobjoe: but now, if the store isnt in /nix/store, the binary breaks, same if you try to use it outside of nix
<clever> joebobjoe: nix sovles that by loading libc from /nix/store/hash-libc/lib/libc.so
<clever> joebobjoe: but now upgrading libc can break things
<clever> joebobjoe: normal linux binaries load libc from /lib/libc.so
<clever> joebobjoe: its the changes nix makes to give you every benefit of nix
<clever> joebobjoe: changing that path will upset the offset of every other value in the binary and just make it corrupt
<clever> joebobjoe: the length of the path is in compiled binaries
<clever> joebobjoe: and darwin doesnt really support chroot or namespaces, so the linux work-arounds dont help
<clever> joebobjoe: changing the directory of /nix/store requires rebuilding every single package from source
<clever> joebobjoe: if you dont own /nix then it will use sudo to make you own it
<clever> iqubic: yes
<clever> joebobjoe: if you own an empty /nix/, the single-user install can act without sudo
<clever> iqubic: they are identical
<clever> iqubic: the order of arguments doesnt matter when its a set
<clever> joebobjoe: but on a single-user, you can just edit anything you want
<clever> joebobjoe: on a multi-user setup, you must go thru nix-daemon to modify it, and that enforces the rules
<clever> joebobjoe: multi-user setup still protects /nix/store from corruption
<clever> iqubic: 2019-08-03 01:40:00 < clever> iqubic: the ... makes it ignore any other arguments it doesnt want
<clever> joebobjoe: but if you do have root, that feature causes confusion, because users tend to wind up with duplicate copies of the channel setup
<clever> joebobjoe: so you can ignore what root's channels are, and manage them yourself
<clever> joebobjoe: that is why nix-channel also works as your own user
<clever> iqubic: add each one it complains about to the function, until it stops complaining
<clever> joebobjoe: correct, you must `nix-channel --update` to update the package set
<clever> iqubic: everything in imports is a module
<clever> iqubic: the module system passes config, pkgs, lib, and others, to every single module
<clever> joebobjoe: did you `nix-channel --update` correctly (within `sudo -i`) ?
<clever> joebobjoe: version 1.1.2 is the latest one in your copy of nixpkgs
<clever> iqubic: the ... makes it ignore any other arguments it doesnt want
<clever> iqubic: change it to { pkgs, ... }:
<clever> iqubic: what is the 1st line of wm.nix ?
<clever> joebobjoe: they will only be removed when you do garbage collection
<clever> joebobjoe: those symlinks it added are in an older generation
<clever> iqubic: the module system in nixpkgs will import it for you
<clever> 2019-08-03 01:28:50 < joebobjoe> nix-env is hashed (/nix/var/nix/profiles/default/bin/nix-env) and nix-env is /var/root/.nix-profile/bin/nix-env
<clever> joebobjoe: no, thats where nix itself comes from
<clever> iqubic: then you must call that function with the right arguments
<clever> joebobjoe: nix-env -e irssi
<clever> iqubic: it will parse whatever file you point it at, and return the top-level value of that file
<clever> joebobjoe: what does `nix-env -iA nixpkgs.irssi` report?
<clever> joebobjoe: what error does it give?
<clever> joebobjoe: what is the ocmmand that fails?
<clever> joebobjoe: is nix-daemon running?
<clever> joebobjoe: both of those are roots profile, so it should be good there
<clever> iqubic: nixos doesnt support single-user
<clever> joebobjoe: what does `type nix-env` return, in both a normal and root shell?
<clever> iqubic: so foo doesnt have roots HOME
<clever> iqubic: the one that perserves $HOME when you `sudo foo`
<clever> joebobjoe: darwin choose to use the "wrong" value
<clever> joebobjoe: its a config option in /etc/sudoers
<clever> joebobjoe: sudo on darwin sets the wrong $HOME, so nix-channel doesnt act on root
<clever> joebobjoe: run `sudo -i` then `nix-channel --list`, dont use `sudo nix-channel --list

2019-08-02

<clever> Miyu-chan: i think it already has an env var that can set ssh flags
<clever> lol
<clever> ah
<clever> Miyu-chan: have you seen remote-store?
<clever> there should be a fuse thing for mtp
<clever> thats the one
<clever> CMCDragonkai: dont think so
<clever> fuse should work then, if we knew what it was called, lol
<clever> fuse also has drivers for it
<clever> CMCDragonkai: you need to use something like gnome or xfce to "mount" it
<clever> cant remember the name of it
<clever> CMCDragonkai: modern cameras dont register as a mass-storage device, they use something else, that directly serves files, not blocks with an FS
<clever> ghasshee: ix nix-daemon running?
<clever> ghasshee: is $NIX_REMOTE set?
<clever> ghasshee: what does `type nix-shell` return?

2019-08-01

<clever> jd823592: ah, the settings youve shown so far look good at a glance
<clever> jd823592: what is the error your getting? what is your current (hardware-)configuration.nix files?
<clever> tazjin: yeah, explaining that __typeOf is special, in that it exists at both __typeOf and builtins.typeOf is a bit complicated
<clever> tazjin: luke, use the source?
<clever> but i can see that causing confusion too
<clever> Miyu-chan: you could just make a lib.filterSource, that has the identical api to builtins.filterSource, but can also compose
<clever> Miyu-chan: it should compose in a chain
<clever> but NickHu's nixpkgs is up to 5.50
<clever> __monty__: my older nix-index DB claims its in blues 5.43
<clever> NickHu: so it found hcidump.h in wireshark
<clever> NickHu: by default the ,locate searches for *hcidump*
<clever> /nix/store/fpbwh44krpxp7q6xaxbskn6848kwpbwv-wireshark-qt-3.0.3-dev/include/wiretap/hcidump.h
<clever> github does say he force-pushed before it got merged
<clever> Miyu-chan: could be an improvement over iteration, and he forgot the docs
<clever> maybe it moved from bluez to wireshark, and your on an older nixpkgs?
<clever> NickHu: also, strangely, my nix-index DB claims its in bluez instead
<clever> bluez.out 409,184 x /nix/store/f6h67gggc9f3abv0f6qrni7cd7rls944-bluez-5.43/bin/hcidump
<clever> NickHu: which nixpkgs rev are you on?
<clever> you need to lib.cleanSourceWith { filter = g; src = ./.; }
<clever> oh, yeah, the docs are wrong then
<clever> > let foo = { outPath = "bar"; }; in "${foo}"
<clever> the magic outPath attr allows that set to be treated as a string
<clever> the return value is a set with 4 attrs
<clever> the lines you pasted look correct
<clever> if you pass that set back to cleanSource with, it can extract the original un-filtered path, and compose the 2 filters together, and remake the special set
<clever> Miyu-chan: but cleanSourceWith will return a special attrset, that remembers the original path, filter function, and has a string of the result of filtering
<clever> thats probably it
<clever> Miyu-chan: for complicated reasons, filterSource cant act on filterSource
<clever> Miyu-chan: you want the newer cleanSourceWith i believe
<clever> ,locate hcidump
<clever> in one case, ld.so didnt exist, so files that clearly exist, claim to not exist
<clever> and when nixpkgs changes, nix wont download the same libraries, and now your cache fails hard
<clever> but stack links to libraries in /nix/store/
<clever> some projects do an impure stack build under nix-shell, and cache ~/.stack-work
<clever> andi-: ive also seen nix/stack problems on travis before
<clever> selfsymmetric-mu: nix repl '<nixpkgs>' will also load nixpkgs for you
<clever> selfsymmetric-mu: pkgs is a function, you forgot the {} again
<clever> nix-repl> pkgs = import <nixpkgs>
<clever> selfsymmetric-mu: adding {} on line 6 of your last gist will call the function and get the package
<clever> selfsymmetric-mu: its a function, that returns a package after you add {}
<clever> selfsymmetric-mu: default.nix contains a function, so your import is putting a function into systemPackages

2019-07-31

<clever> adamantium: change it in the nix-build command, not the nix file
<clever> adamantium: very first line, change it from kexec_tarball to kexec_script
<clever> adamantium: read session.md
<clever> adamantium: session.md shows how to build the tarball image, but if your already using nix, you can skip tar'ing it up
<clever> adamantium: if you run that kexec script, it will immediatelly switch kernels and boot into it
<clever> adamantium: if you nix-build this kexec script, it will generate a kernel+initrd pair, using configuration.nix to generate the entire nixos image, which is baked into the initrd
<clever> adamantium: kexec may help
<clever> adamantium: the zfs has to be built for the right kernel

2019-07-30

<clever> charukiewicz: and that will do the postUnpack for you
<clever> charukiewicz: i believe cabal2nix --subdir also does that for you
<clever> charukiewicz: you want to use postUnpack
<clever> pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix: postUnpack = "sourceRoot+=/cabal-install";
<clever> charukiewicz: haskellPackages.mkDerivation behaves a little differently, one min
<clever> charukiewicz: can you pastebin your expr?
<clever> __monty__: run nix-diff on both .drv files
<clever> what???
<clever> ajs124: it may still need a nixos option, to add it to the sstemd-boot cfg
<clever> ajs124: until you need to use memtest86, or boot on legacy
<clever> i prefer grub, its capable of more things
<clever> kiloreux: mkYarnModules may also be of use, mostly you just read https://github.com/moretea/yarn2nix/blob/master/default.nix#L223-L227, guess what functions do, build them, and see what the result is
<clever> kiloreux: i think you just want mkYarnNix
<clever> kiloreux: as long as you have the package.json and yarn.lock, you should be able to
<clever> bsima: typically, i use it with a single user that everybody should ssh into before running nixops
<clever> fendor: the existing nixpkgs stuff at the time could cross-compile to windows, but didnt obey if statements in cabal files, so it tried to build unix packages for windows
<clever> fendor: iohk wrote haskell.nix to support cross-compiling haskell to windows
<clever> so you can tell haskell.nix your doing a windows build, and it will correctly apply the conditional deps in the cabal files
<clever> fendor: haskell.nix translates the entire build plan, obeying things like your stack file, and translating cabal if statements into nix if statements
<clever> fendor: cabal2nix will just translate a single cabal file into a single nix file, and ignores the if statements in the cabal file, and version constraints
<clever> fendor: and there is also #haskell.nix on freenode
<clever> asymmetric: the example i linked is making such a wrapper as well
<clever> Neo--: src = ./path/to/source;
<clever> ,locate xsltproc
<clever> Church-: its in the nixos manual
<clever> gchristensen: so hydra could then allow teamspeak, but not other things (ir may also be able to inspect the license and be more inteligent, like unfree = false; grayzone = true;, and then base it on that
<clever> gchristensen: basically, its a function, that changes allowUnfree from allow-everything to a whitelist
<clever> only solution i can see, is to have an allow unfree predicate that CI uses
<clever> yeah, we need some gray zone, where CI is allowed to build it, but users must still consent to allow unfree software
<clever> > lib.licenses.unfreeRedistributableFirmware
<clever> unfreeRedistributableFirmware is also non-free
<clever> then just add tests, and let ci do ci things
<clever> ah, just change this line to true, since the author has consented to allow distribution
<clever> so internally, nix treats it as "free"
<clever> or maybe a custom type, i notice unfreeRedistributableFirmware lacks the free = false;
<clever> gchristensen: unfreeRedistributable might be enough to enable it in hydra/ofborg
<clever> gchristensen: the only thing missing, is allowing hydra (and ofborg) to build it, and a basic test to ensure it can find all dynlibs (one got renamed and broke it hard)
<clever> gchristensen: i was just thinking, a recent update to nixpkgs broke teamspeak, and it would be nice to have hydra testing things better (and ofborg indirectly)
<clever> kalbasit: https://gist.github.com/cleverca22/f3e54a2e0ade7e5f38a6ee4b20d83e14#file-default-nix-L178-L182 is how ive been loading and running the images that nix builds
<clever> kalbasit: ive not really done much with docker
<clever> jonreeve[m]: search nixpkgs for all uses of dpkg to find examples
<clever> Church-: youll probably want to fix that first then
<clever> Church-: what happens if you just run glxinfo?
<clever> Church-: and glxinfo appears to hang, you ctrl+c'd? before it quit
<clever> ah, it ran glxinfo
<clever> which spawns another child proc
<clever> 25042 clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f14c1553a10) = 25052
<clever> Church-: and eventually, that pid does `exec steam-wrapper.sh`
<clever> 25042 execve("/nix/store/cnsw71gm6na0kjxlapy72fa8f9mynnv9-steam-wrapper.sh", ["/nix/store/cnsw71gm6na0kjxlapy72"...], 0x2445008 /* 76 vars */) = 0
<clever> Church-: here, we can see it changing the root dir (using namespaces) and executing steam-init
<clever> 25042 execve("/nix/store/bqglrlas1zkidv7r2d8b2x586ssqhk6s-steam-init", ["/nix/store/bqglrlas1zkidv7r2d8b2"..., "/home/noah/.local/share"], 0x17f4080 /* 69 vars */) = 0
<clever> 25042 chroot("/tmp/chrootenv2DTC5Z") = 0
<clever> Church-: everything is happening in a child process, you want to add -f to strace
<clever> clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fde8a778450) = 24862
<clever> Church-: it prints to stderr, you want `strace -o logfile` to make it open its own log
<clever> Church-: thats a massive wall of unprintable characters!

2019-07-29

<clever> it opened a login page and is now asking for a pw
<clever> Church-: https://gist.github.com/cleverca22/a76524700197e6a40f8e1a90d4fe251b is what my steam does when i run it
<clever> thats normal for for steam
<clever> neat
<clever> but it has a man page
<clever> ive never heard of that before...
<clever> [root@system76:~]# type namei
<clever> namei is /run/current-system/sw/bin/namei
<clever> Church-: does it do that every time? steam ; echo $?
<clever> Church-: is it not opening a window? is it exiting with an error code?
<clever> Church-: nix will recreate the same paths
<clever> Church-: that wont help any
<clever> Church-: i always get permission errors like that when i start steam, it still works
<clever> kalbasit: and its reusing all of the nixos service definitions
<clever> kalbasit: this runs nginx, oauth2_proxy, grafana, prometheus, and postgresql, all in a single docker image
<clever> Church-: it will be GC'd later on when you clean things up
<clever> Church-: just remove it from systemPackages
<clever> kalbasit: and postgres refused to run as root, for "security reasons"
<clever> kalbasit: in my case, i wanted to run postgres, and it used sudo to drop root, which fails hard if shadow is readable