2017-09-10

<clever> q
<clever> 1004 ++ optionals config.networking.wireless.enable [
<clever> taaperotassu: nixos will automatically install wirelesstools if you networking.wireless.enable = true;
<clever> taaperotassu: what does "type iwlist" say when ran?

2017-09-09

<clever> bbl
<clever> tilpner: my first guess, use https://nixos.org/nixos/options.html#sessioncommands to copy the fetchurl to home
<clever> ahhhh
<clever> it uses ~/.background-image
<clever> tilpner: there is already some code in nixos to handle the wallpaper for you, one min
<clever> brb
<clever> mbrock: although..., i think it might just expect it as an env variable (system.services.hydra-queue-runner.Environment)
<clever> mbrock: not entirely sure where the accesskey gets configured, we would have to dig thru the source on the repo i linked
<clever> mbrock: i think you need a clause like this in the hydra.extraConfig: https://github.com/NixOS/hydra/pull/501/files#diff-807928d9773c33624c2ebdca7a37d24aR298
<clever> mbrock: hydra has a config option where you just give it the accesskeys
<clever> apostolis: --show-trace will spit out the path of the nix expression that is giving the error
<clever> apostolis: do it again with --show-trace, and then look at the path its pointing to
<clever> taaperotassu: yay
<clever> have you tried the above command yet?
<clever> akamaus: one trick is to run this: phases=unpackPhase genericBuild
<clever> akamaus: but bash allows functions and variables by the same name, so "unpackPhase" and "eval $unpackPhase" can potentialy do different things
<clever> akamaus: every variable in the derivation becomes an environment variable
<clever> sounds like the usb key just came uplugged for a moment
<clever> yeah, that should fix it
<clever> maybe you bumped it by mistake?
<clever> did anything happen to the cd/usb your booting from?
<clever> one does it via wpa_supplicant, the other does it via network manager
<clever> yeah
<clever> though in my case, i have brought the network up manually (no services to help) on a display-less laptop (blindly typing into the shell)
<clever> but that still needs network
<clever> one of the first things i do is enable sshd and then ssh in from another more capable machine
<clever> i should probably sleep
<clever> 6am
<clever> your right, misread the https://nixos.org/nixos/options.html#networkmana page
<clever> oh wait
<clever> services.networkmanager.enable
<clever> so i guessed wrong and was still write, heh
<clever> realpath says thats sda1, so its not the iso
<clever> i thought it was mounting the iso to /mnt
<clever> so it WAS the cd's configuration.nix, but not via the path i thought it was
<clever> ah
<clever> how much is missing from that configuration.nix?, did you properly shutdown?
<clever> ah, then that was the right path
<clever> what does "realpath /dev/disk/by-label/nixos" say?
<clever> maybe your looking at the cd by mistake
<clever> try mounting sda1 instead?
<clever> and if you have a boot partition, that must also be at /mnt/boot
<clever> taaperotassu: re-mount all the filesystems under /mnt/ and re-run nixos-install, and it will update it to match configuration.nix
<clever> taaperotassu: and re-installing is painless and at zero loss
<clever> taaperotassu: ah, i think you need to set services.networkmanager.enable = true;
<clever> is the network protected with wpa?
<clever> for nixos-unstable-small, it checks a smaller subset of tests, and doesnt wait for jobs to finish
<clever> failed non-test stuff is allowed
<clever> for a channel like nixos-unstable, it waits for every test to pass, and for every job to finish
<clever> the scripts maintaining nix-channel's on nixos.org also do that, and they wait for hydra to finish building
<clever> in the toxvpn example, it generates linux and darwin builds for the supplied default.nix: https://hydra.angeldsis.com/jobset/toxvpn/toxvpn-unstable#tabs-jobs
<clever> how you do that, is up to you and the power of nix
<clever> all it has to do, is return an attrset of jobname = derivation;
<clever> after that, you need a release.nix file, which imports several versions of nixpkgs
<clever> so is 31-38
<clever> though lines 6-12 and 18 are optional, to enable some more advanced features from a pending PR
<clever> mbrock: this is how i had setup my hydra
<clever> hydra also has its own built-in binary cache
<clever> its relatively simple
<clever> hydra is also capable of using that config to do its own builds
<clever> in total, that just tells nix what arch the slave can support, the ssh key path, and the user@host
<clever> that has to go into /etc/nix/machines (nixos also has an option to make it for you, https://nixos.org/nixos/options.html#nix.build )
<clever> and nix-build would just spit out a tar containing elf and mach-o files
<clever> and you could then have a single derivation, that tar's up the resulting binary, from both OS's
<clever> but you can have a single nix expression that refers to both builds
<clever> it will ssh into a build-slave of the correct type, and do a remote build
<clever> nope, native compiling
<clever> and i686-linux for 32bit linux, and x86_64-linux for 64bit linux
<clever> import <nixpkgs> { system = "x86_64-darwin"; } will force this nixpkgs to produce darwin executables
<clever> you can even do cross-os imports
<clever> it may be more stable for your channel's default.nix to import a hard-coded nixpkgs revision, and overlay that
<clever> does that nixpkgs even support an overlay?!
<clever> but you also have to keep in mind, will your overlay be compatible with the nixpkgs the end-user has?
<clever> mbrock: that is what the default.nix in nixpkgs-mozilla does
<clever> mbrock: you can also make a channel, that just imports <nixpkgs> and passes it an overlay
<clever> some dns caches also have a reload command, that will wipe the cache without causing an outage of service

2017-09-08

<clever> LainuxUser: it just expects you to boot it normally, but you could also chroot it
<clever> LainuxUser: thats what nixos-install does
<clever> sphalerite: convicing the entire userbase to move is a an even bigger issue :P
<clever> sphalerite: that reminds me, teamspeak is non-free, and depends on a special build of the chrome source (via a qt library), and hydra doesnt pre-build that
<clever> LainuxUser: what things is it building?
<clever> jasom: every new install i have done in the last ~2 years has been nixos
<clever> jasom: same, i cant even be bothered to upgrade that last gentoo machine
<clever> Ralith: only time ive ever seen the undo button fail, is when people ran nixpkgs-unstable, and it happened to break the grub config
<clever> ah
<clever> i only ever ran into that because my mp3 player was "full" at only ~5% usage
<clever> Dezgeg: ive had it happen on a 4gig SD card before, dont think fat16 cant go that big
<clever> hmmm, that usually took minutes, maybe the extra 16gig of ram i gave the machine has helped
<clever> 934243
<clever> real 0m5.470s
<clever> $ time ls -U /nix/store/.links/ | wc -l
<clever> FAT is even worse in some areas, the root directory has a hard upper limit on the number of files in the root directory
<clever> they dont expect you to put 1000's of files in a single directory
<clever> splitting it up into 255 smaller directories makes it faster, even if you read all of them, just due to poorly designed FS's
<clever> Dezgeg: but if you want to iterate over the entire directory, it can be abnormally slow
<clever> Dezgeg: when you want to read a file of a known name, the FS can use things like b-tree's to instantly find it
<clever> Dezgeg: weird quirks in the filesystem layer
<clever> vs not linking small-ish files
<clever> but making more subdirs under .links would give more disk savings and make it faster
<clever> ah yeah, that would help some
<clever> doing the same thing git does may help
<clever> sphalerite: ive found that the biggest performance cost is just the readdir on large directories, like .links and the store itself
<clever> yep
<clever> and how often do you actually want to share high-scores with another user on the same box?
<clever> and nixos makes it worse, then you need a nixos module to handle the set gid bit
<clever> so only that game can write to it, and users cant just cheat in their own scores, or put malicious data into a file another user will load into the game
<clever> to set things like this up "properly", it has to have the set gid bit set, and then a group that has write to the shared location
<clever> sphalerite: yeah, so its trying to write to the store
<clever> nwuensche: oh right, there is also a steam-run package, which i believe gives a shell inside the same chroot used for steam
<clever> silver_hook: to nixpkgs, it has to be patched to save to an area under $HOME rather then --prefix
<clever> switch does its best to reload things, but kde cant be reloaded
<clever> only for some stuff in the kde launcher
<clever> silver_hook: you can also just logout and log back in
<clever> and the sh part refused to just unpack and not run the ELF
<clever> the tar contained an ELF that handled the custom archive format
<clever> another problem i have ran into, the .sh was both a tar, and a custom package
<clever> yeah, that sounds right
<clever> sphalerite: the problem is when people assume your PATH is wrong and do /bin/bash
<clever> and only things using myHaskellPackages will get the override
<clever> mpickering: instead of setting haskellPackages in the override, set myHaskellPackages
<clever> mpickering: you can name your override something else
<clever> mpickering: no real way that i know of to do it recursively, other then just making a second haskellPackages set
<clever> mpickering: https://pastebin.com/QUvBgc30
<clever> mpickering: make an override on mkDerivation
<clever> and patchShebangs will mess with those offsets
<clever> nwuensche: the .sh script typicaly has a offset inside it, of what areas it can safely copy with dd, to extract the tar from itself
<clever> nwuensche: ah, the last time i tried patching one of these things, it caused all kinds of problems
<clever> nwuensche: has it been patchelf'd?
<clever> and that overrides the normal config.nix search logic
<clever> so basicaly, it becomes import <nixpkgs> { config = { firefox.enableAdobeFlash = true; }; }
<clever> when nixos imports <nixpkgs> it passes in a config argument
<clever> Jackneill: nixpkgs.config.firefox.enableAdobeFlash = true;
<clever> mbrock: the name of the .drv file is based on a hash of its contents

2017-09-07

<clever> tnks: "nix-store -r /nix/store/foo" downloads from the binary cache, nix-copy-closure can copy between machines, and you can "nix-env -i /nix/store/foo" to download from a binary cache and add it to your profile
<clever> and if you set the type correctly in the nixos config, it properly configures any software you need
<clever> systemd units dont have access to the systemPackages
<clever> yep
<clever> ...; { boot.extraModulePackages = [ foo ];
<clever> oops
<clever> woffs: { pkgs, config, ... }: let foo = config.boot.kernelPackages.tp_smapi.overrideAttrs ...; { merge the two - then reboot.
<clever> woffs: you can move that value into a let block near the top of the file
<clever> for most OS's, it only causes a lack of kernel upgrades
<clever> its a common problem, ive seen it 5+ times in here
<clever> and confirming its configured to mount on bootup
<clever> yonk42: it should be as simple as mounting /boot correctly and re-running nixos-rebuild, which will re-poppulate /boot
<clever> woffs: what about boot.extraModulePackages = [ (config.boot.kernelPackages.tp_smapi.overrideAttrs .... ) ]; and ignore the rest
<clever> woffs: oh right, you need to actually depend on tp_smapi, one second
<clever> peterhoeg: also keep in mind, the last person i asked "is /boot mounted" said yes, when it wasnt, confirm everything with df -h or mount output
<clever> woffs: try instead doing boot.kernelPackages = pkgs.linuxPackages // { tp_smapi = ...; };
<clever> fearlessKim[m]: nix-env -iA nixos.gist
<clever> fearlessKim[m]: can you gist the "git diff" ?
<clever> fearlessKim[m]: nix doesnt care about order

2017-09-06

<clever> kernelModules makes it present, and forcibly loads it
<clever> availableKernelModules are present in the initrd, but not forcibly loaded, the udev layer will just auto-load things as needed
<clever> testuser: boot.initrd.availableKernelModules = [ "nvme" ];
<clever> i think checking that the string ends in x is simpler
<clever> i think you want to allow things ending with certain paths, and disallow things ending in others
<clever> ah
<clever> Denommus: to start with, try running builtins.trace, the value of path may not be what your expecting
<clever> Denommus: if you do ./. in nix, it will automatically become absolute
<clever> Denommus: got an example of what your doing?
<clever> mpcsh: it should say what failed, right after that error
<clever> mpcsh: what derivation gave that error?
<clever> and then upload the logfile to a pastebin
<clever> try strace -e execve -f -o /tmp/logfile nixos-install ....
<clever> so its not a real proxy, but a transparent proxy
<clever> ah
<clever> what error does curl give?
<clever> but --option should have top priority
<clever> nixos-install probably uses /mnt/etc/nix/nix.conf
<clever> bsoudan: what happens if you do "curl https://google.com" ?
<clever> bsoudan: try deleting /nix/var/nix/binary-cache-v3.sqlite and its journal, on both / and /mnt
<clever> it might be the cache cache
<clever> it computed things as being identical to the old config and reused them
<clever> bsoudan: so it tries to rebuild everything from scratch
<clever> bsoudan: if it cant contact cache.nixos.org because of network problems, it thinks there is zero binary cache coverage
<clever> bsoudan: oh right, there is also a weird glitch in nixos-install
<clever> that is only loaded in 2 places
<clever> pkgs/build-support/fetchurl/boot.nix:let mirrors = import ./mirrors.nix; in
<clever> pkgs/build-support/fetchurl/default.nix: mirrors = import ./mirrors.nix;
<clever> bsoudan: yeah, that doesnt sound right, what is the diff for nixpkgs?
<clever> bsoudan: what kind of things is it rebuilding?
<clever> Denommus: ahh
<clever> but you can change when
<clever> pop: by default, it runs it every day at 3:15 am
<clever> pop: nix.gc = { automatic = true; options = "--delete-older-than 30d"; }; for example
<clever> Denommus: there is also buildInputs = with something.pkgs; [ one two ];
<clever> Denommus: oops, misread it then, lol
<clever> pop: and if ran as root, it can also delete nixos generations
<clever> pop: next is `nix-collect-garbage --delete-older-than 30d` to get rid of things older then a month
<clever> pop: to start with, does just plain `nix-collect-garbage` free up enough space?
<clever> [ 1 2 3 ]
<clever> nix-repl> builtins.attrValues { a=1; b=2; c=3; }
<clever> Denommus: thats not a directory, thats an attribute set, and you probably want builtins.attrValues
<clever> your welcome * 2
<clever> mpcsh: packages vs Packages
<clever> 2017-09-06 13:57:41 < mpcsh> clever: maybe I have it backwards then. how can I run, say, `nix-shell -p python36Packages.fontforge`?
<clever> 2017-09-06 13:58:47 < mpcsh> clever: `error: undefined variable ‘python36packages’ at (string):1:66`
<clever> mpcsh: i just noticed
<clever> bsoudan: might want to point out that they are blocking a number of open-source mirrors
<clever> mpcsh: can you gist the entire output of "nix-shell -p python36Packages.fontforge -v"
<clever> bsoudan: should ask your local IT why they are against open source, lol
<clever> mpcsh: what is the output of nix-channel --list and sudo nix-channel --list?
<clever> Denommus: builtins.filterSource
<clever> mpcsh: what if you run nix-repl '<nixpkgs>' and then try to tab-complete pythonPackages ?
<clever> heh, thats even newer then mine
<clever> "17.09pre112691.abdb58e407"
<clever> $ nix-instantiate --eval -E 'with import <nixpkgs> {}; lib.nixpkgsVersion'
<clever> does python 3.6 exist in your copy of nixpkgs?
<clever> mpcsh: and when i run what you pasted, it does just work
<clever> mpcsh: that is an attribute path, it should just work like that
<clever> package names are just the value of the .name attribute on a derivation
<clever> nix-env is the only tool that accepts package names, every other tool in the system uses attribute names
<clever> bsoudan: this is the general area where nixos-install builds nix
<clever> that option isnt valid
<clever> bsoudan: one minute
<clever> but bsoudan has an https proxy with a self-signed cert
<clever> the sandbox opens the network up if a sha256 is present
<clever> yeah, i think its his firewall
<clever> dieggsy: not sure why its not setup like that
<clever> dieggsy: ah, no simple way to turn the sandbox on in that
<clever> bsoudan: yeah, sounds like the binary cache is blocked
<clever> dieggsy: what OS are you on?
<clever> dieggsy: if the sandbox was enabled, it wouldnt allow this
<clever> dieggsy: nix has no idea when it should rebuild the package because the nix expression hasnt changed
<clever> doing otherwise will cause problems down the road
<clever> nix expects the expression to give the same source code every time
<clever> dieggsy: when the nix sandbox is enabled, it will block all network access
<clever> bsoudan: you can also use -r on the storepath of the source
<clever> dieggsy: ah, looks like it doesnt throw an assert, but the sandbox will break that
<clever> dieggsy: it needs a sha256, it will throw an error without it
<clever> bsoudan: run "nix-store -r /nix/store/foo" to download the path from a binary cache
<clever> so when the binary tries to open something relative to itself, it goes into the new share dir
<clever> maurer: i think this line is key, it copies the main binary into the buildenv
<clever> cp --target-directory=$out/bin ${pg}/bin/{postgres,pg_config,pg_ctl}
<clever> you may be able to just run the unmodified postgress daemon and set NIX_PGLIBDIR to point to the lib dir in your build
<clever> maurer: behind the scenes, it makes a buildEnv of postgres, and the plugins, and sets $NIX_PGLIBDIR
<clever> maurer: maybe this? https://nixos.org/nixos/options.html#postgresql.extrapl
<clever> so the user services are still global, and available to every user
<clever> only nixos modules can be used to create systemd-user services
<clever> its getting late here, i should head to bed
<clever> rotaerk: stack2nix is also an option, but that generates a lot of stuff, so its not much different from cabal2nix
<clever> use wildcards in the bash that happens in the next derivation
<clever> ah, not sure there
<clever> so you need to know that name in advance
<clever> the issue, is that the nix expressions run before the build has even started
<clever> ah
<clever> "
<clever> "${mySymptoms}/bin/foo
<clever> rotaerk: haskellPackages.callCabal2nix
<clever> sounds good, and you could probably further optimize it, re-do the previous du to see what the fattest package is now
<clever> fresheyeball: ah, i was thinking of haskell.lib.justStaticExecutables
<clever> let me double-check some things
<clever> run haskell.lib.enableStaticLibraries over the derivation i believe
<clever> yeah, thats a problem with the dynamic linking
<clever> fresheyeball: line 10, your build directly depends on ghc at runtime, likely dynamic linking, what does "grep -r --color mqcmpgd6i0hggx7mvlvx7gvi6cx124c4 /nix/store/f3zyazp6ddx3bcqmi7j6vm8k0xccl2wc-mysymptoms-web-dashboard-0.1.0.0" say?
<clever> fresheyeball: and throw it in a pastebin this time
<clever> fresheyeball: now check nix-store --query --tree /nix/store/f3zyazp6ddx3bcqmi7j6vm8k0xccl2wc-mysymptoms-web-dashboard-0.1.0.0
<clever> the problem is that your build depends on ghc, so the entire 1gig of ghc is present in the docker
<clever> lol
<clever> your spam is going strong, lol
<clever> you will want to use a pastebin
<clever> what is the output of this?
<clever> du -ch $(nix-store -qR /nix/store/f3zyazp6ddx3bcqmi7j6vm8k0xccl2wc-mysymptoms-web-dashboard-0.1.0.0) --max=0 | sort -h
<clever> fresheyeball: what is the path to the haskell binary?
<clever> fresheyeball: run a command like this on the storepath for that haskell binary: du -ch $(nix-store -qR /run/current-system) --max=0 | sort -h
<clever> tnks: you will also want to nix-store --query --roots on the storepath, to confirm its detecting the root
<clever> ah, maybe
<clever> only nix-env as far as i know
<clever> --no-outlink stops that i believe
<clever> thats all it does
<clever> tnks: nix-build -o foo
<clever> you probably have something odd in your .bashrc or .bash_profile
<clever> thats not normal, and it causes the libraries you nix-env to have priority
<clever> /home/cole/.nix-profile/lib probably broke it
<clever> hmmm, and if you "unset LD_LIBRARY_PATH" does that fix nix-env?
<clever> colescott: env | grep LD_LIBRARY gives what output?
<clever> colescott: nixos or another distro?

2017-09-05

<clever> though nix doesnt save the log of failing builds, as far as i know
<clever> enableParallelBuilding just allows derivations to obey build-cores
<clever> -j1 will prevent derivations from being interleaved, the 2nd part will pass -j1 to make inside each
<clever> and maybe nix-build -j 1 --option build-cores 1
<clever> nix-build -j 1
<clever> every nixos-rebuild you have done, that it undid
<clever> so it fails in the future, rather then silently claiming it worked