2018-07-10

<clever> srk: i wrote a nixos module for iscsi root support
<clever> srk: the iscsi was full nixos
<clever> srk: the tftp setup is not-os
<clever> pip3000: nope, you need to manually track its changes and undo it yourself
<clever> srk: and i have also made them boot entirely with tftp, with only a bootcode.bin on the SD card
<clever> srk: ive gotten my raspberry pi's to iscsi boot before
<clever> FS overhead and FS compression can result in it gaining too much free space
<clever> optimize can result in a GC deleting something and gaining nothing, but still stopping early
<clever> srk: ignoring savings from --optimize, fs overhead, and fs compression, it will hit max-free bytes free when done
<clever> srk: once it does trigger, it will compute max-freed - current-free, and run nix-collect-garbage --max-freed 1234 on the result
<clever> 205 max-free = ${toString (1024*1024*1024*6)}
<clever> the above is for 3gig
<clever> you can also just have nix do the math for you
<clever> 204 min-free = ${toString (1024*1024*1024*3)}
<clever> srk: that is set to trigger a GC when you have under 2mb free
<clever> srk: what did you set the values to?
<clever> srk: it will check any time nix adds anything to the store
<clever> srk: any time the free space goes under min-free, it will run a garbage collection, aiming to hit max-free bytes free
<clever> srk: nope
<clever> mkaito: an example of one is on lines 14-27
<clever> mkaito: i believe you give it the same function you would have given to filterSource
<clever> mkaito: i think builtins.cleanSourceWith lets you extent the filter
<clever> cocreature: why cant you just sign things on the cache?
<clever> nh2[m]: nix1 didnt save the cache.nixos.org signatures, but nix2 can
<clever> nh2[m]: nix verify can also check signatures, and nix copy-sigs can download signatures from the binary cache
<clever> nh2[m]: run it with --help to see the args
<clever> rindolf: that has to eval all of nixpkgs to find everything by name, and can use a lot of ram
<clever> nh2[m]: nix sign-paths
<clever> rindolf: what command ran out of ram?
<clever> only root needs read access to the secret
<clever> nh2[m]: with that set, nix can sign things it builds
<clever> nh2[m]: and you need to set secret-key-files = /etc/nix/signing.sec
<clever> nh2[m]: you have to generate your own keypair, thats described in the nix-store man page
<clever> nh2[m]: one sec
<clever> but thats all i can think of right now
<clever> chpatrick: i have plans to make a tool to generate an A+B cabal file, that you can then treat as 1 package
<clever> chpatrick: when changing B, you must re-open the nix-shell, which does a full rebuild of B
<clever> chpatrick: ah, nix doesnt really play nicely with that model at all
<clever> chpatrick: this is a derivation that gives you ghc + ghci, that supports datadog, lens, and data-default
<clever> chpatrick: or ghcWithPackages
<clever> chpatrick: you need to use haskellPackages.mkDerivation, not shellFor i believe
<clever> you need to change the configuration.nix option that installed it
<clever> rindolf: then its installed via configuration.nix, not nix-env
<clever> rindolf: what does `type khelpcenter` return?
<clever> rindolf: kde is also not present there
<clever> rindolf: qt isnt installed in nix-env, so it cant be removed
<clever> that bug also broke the ability to rollback via the grub menu
<clever> then all of the users with nixpkgs-unstable came out of the woodwork :P
<clever> nixos-unstable correctly refused to update
<clever> about a year ago, grub was broken, and corrupted the grub config file
<clever> PyroLagus: and if you install nixos from nixpkgs-unstable, you risk breaking the install
<clever> PyroLagus: yeah
<clever> t
<clever> PyroLagus: nixos-unstable only does linux testing, and tests more OS related things, to ensure nixos can still boo
<clever> PyroLagus: thats nixpkgs-unstable, which is used outside of nixos (ubuntu, debian, darwin, and so on)
<clever> rindolf: can you gist the output of `nix-store -qR ~/.nix-profile` ?
<clever> rindolf: remove every package that depends on QT
<clever> rindolf: only names listed in `nix-env -q` can be removed with `nix-env -e`
<clever> but --delete said it had roots keeping in in-use
<clever> which lead to confusion, nix-store --query --roots said a path had no roots
<clever> manveru: nix1 did it, but silently didnt tell you about them
<clever> rindolf: root is needed for -d to get rid of all unused paths
<clever> cocreature: but Setup.hs will always use the library that the nix-shell provided, so its always perfect
<clever> cocreature: id expect it to only break a few years down the road, when the cabal in nix-env has aged, and your using a much newer nixpkgs for the nix-shell
<clever> cocreature: i have seen it break for others before, when they manually installed cabal-install with nix-env, and then tried to manually build in a shell
<clever> cocreature: but if you ignore the Setup.hs entirely, and run `cabal configure` + `cabal build`, it may be the wrong version of cabal
<clever> that can break things, because it wont be the same version as what the nix expressions want
<clever> `runhaskell Setup.hs test`
<clever> either `runhaskell Setup.hs configure` or compile it with ghc, then run it
<clever> gchristensen: that only has the cabal library, not the binary, you need to run Setup.hs
<clever> gchristensen: are you in a shell from haskellPackages.mkDerivation?
<clever> mplayer too
<clever> sphalerite: i think vlc can do it
<clever> you need to partition, format, and mount everything under /mnt, then run nixos-generate-config --root /mnt, edit /mnt/etc/nixos/configuration.nix, and then nixos-install --root /mnt
<clever> shapr: that has to be done manually
<clever> shapr: id also recomend that the efi sys partition be at least 512mb, maybe 1gig
<clever> uefi boot from the installer on usb, and then do a normal uefi install against the "new" drive
<clever> yeah
<clever> just a normal uefi install
<clever> and then it always comes up as an option
<clever> so the uefi firmware will think its a usb stick
<clever> shapr: if you set this flag, then it will configure the drive as a removable one
<clever> but there is a removable option to get around it
<clever> uefi is a pain like that
<clever> so another machine will refuse to boot it by default
<clever> it relies in the efi vars in the nvram being setup right
<clever> if using uefi, then you can just entirely ignore the ubuntu drive, give nixos its own efi system partition and rootfs, and then youll have an option for both in the UEFI menu
<clever> shapr: uefi or legacy booting?
<clever> so it hard-coded itself to open the path "unknown" at runtime
<clever> the nix sandbox had none of the options
<clever> the package was testing for things like /etc/mtab, to detect what your distro is doing
<clever> rotaerk: the problem was that the nix sandbox broke the package, and i had the sandbox off at the time
<clever> rotaerk: it turns out, anything not in the cache worked, and anything in the cache failed, so the bisect just failed to locate the problem entirely
<clever> rotaerk: i once did a bisect like that, and ran into all kinds of trouble

2018-07-09

<clever> IN_NIX_SHELL=impure
<clever> kalbasit: its meant to be edited manually
<clever> Ralith: the entire config set is untyped and ignores any undefined options
<clever> Ralith: overlays is its own attribute, beside config, not inside
<clever> check the above issue
<clever> nope
<clever> tobiasBora: the nixos container framework assumes the host also runs nixos, so its tricky to get the kernel to run
<clever> and its difficult to run it under a container as well
<clever> tobiasBora: yeah, you have to replace the OS
<clever> there are several utils to handle that
<clever> for that, you would need to install nixos to the machine first
<clever> tobiasBora: just make sure nix-channel is using a channel that starts with nixos
<clever> tobiasBora: nixops should work on any machine nix works on
<clever> but i never recreated it on nixos
<clever> ive tied dhcpcd into bind before on gentoo
<clever> kalbasit: let bazel_0_14_1 = ...; in pkgs.mkShell { ...
<clever> kalbasit: move it into a let block to make it into scope
<clever> i never use network manager
<clever> pie___: why not use bind then?
<clever> srk: both are in bytes, in nix.conf
<clever> srk: nix now has a min-free and max-free config flag, for auto-gc
<clever> tank/nix 52G 45G 7.2G 87% /nix
<clever> /dev/disk/by-uuid/3c21b4a1-bc19-449b-815f-60c66ba23bdf 74G 53G 18G 76% /
<clever> naspool/root 56G 52G 4.2G 93% /
<clever> amd/nix 65G 60G 4.5G 94% /nix
<clever> Filesystem Size Used Avail Use% Mounted on
<clever> qualiaqq: $QT_PLUGIN_PATH
<clever> qualiaqq: it needs an env var related to QT to be set

2018-07-08

<clever> and if your output refers to that path, it becomes a runtime dependency
<clever> $src will always point to the result fetchurl made
<clever> it references the copy in the store
<clever> you can just -jar $src directly
<clever> tenten8401: you also dont need to copy $src to $out
<clever> that suffix is inside the double-quotes of something else
<clever> not several
<clever> your passing a single arg to makeWrapper
<clever> i think you need to adjust the double quotes
<clever> tenten8401: you may need \$HOME
<clever> tenten8401: i think you want what i just typed
<clever> > '' --working-dir "\''${XDG_DATA_HOME:-\$HOME/.local/share}/atlauncher" ''
<clever> tenten8401: which ends the string
<clever> tenten8401: thats because you have an extra '' at the end
<clever> > '' --working-dir "\\''${XDG_DATA_HOME:-\$HOME/.local/share}/atlauncher" ''
<clever> and you dont nsee the }\''/atlauncher escape
<clever> so now ${XDG_DATA_HOME:-$HOME} will appear in the bash script its generating
<clever> which escapes it so that bash doesnt eval it
<clever> which results in \${ at the bash level
<clever> and then \\ is the nix level escape for \
<clever> ''${ is the nix level escape to make a ${
<clever> nope
<clever> tenten8401: try \\ for that one
<clever> tenten8401: i think the \' escaped the ' and then the '${ wasnt an escape
<clever> jgt: how did it not work?
<clever> \$HOME
<clever> tenten8401: can you gist what your wanting to do?
<clever> jgt: its applied the same as justStaticExecutables
<clever> jgt: haskell.lib.dontCheck
<clever> jgt: or
<clever> jgt: overrideCabal
<clever> > '' ''${ to escape a $ and {, then ''' to escape double single''
<clever> tenten8401: depends on if its a " or '' string
<clever> tenten8401: should be as simple as swapping out the jar and renaming it
<clever> minecraft is also already packaged
<clever> you have to patch the package to setup LD_LIBRARY_PATH when running it
<clever> ,library
<clever> tenten8401: installing libraries wont help on nix
<clever> clefru: that looks like it should be safe
<clever> waynr: nix-env -q
<clever> waynr: that just means hydra is going to have to (re)build dnscrypt-proxy2 on linux and darwin
<clever> did you nixos-rebuild?
<clever> ps aux | grep ssh
<clever> blu3r4d0n: is it running?
<clever> jtojnar: `type git`
<clever> samueldr: try what infinisil said
<clever> yeah
<clever> git probably looks in its own libexec for utils like that
<clever> nix does away with directories like /usr, /usr/local, and /sbin
<clever> not sure where it would be documented
<clever> it has to install to $out/bin/thd, not $out/usr/bin/thd
<clever> install -D thd /nix/store/w5fii7yk82qadgh1ls5bqkrdr3p1qw7q-hello-2.10//usr//bin//thd
<clever> NoOneRules: oh, i see your problem
<clever> NoOneRules: and if you ls -l ~/.nix-profile/ ?
<clever> and what did it output?
<clever> NoOneRules: did you re-run nix-env after editing it?
<clever> unknown
<clever> jtojnar: so if you just ask pkgconfig to find its .pc file
<clever> jtojnar: those packages should already be in scope
<clever> jtojnar: it might help if pkgconfig has a fixup hook, that scans the requires fields, and populates the propagated-inputs under $out/nix-support/
<clever> Ralith: so i always make my /boot pretty large, and i can also recover from almost any failure
<clever> Ralith: it puts the entire nixos installer into /boot, at the cost of about 400mb
<clever> Ralith: i also use this on most of my machines: https://github.com/cleverca22/nixos-configs/blob/master/rescue_boot.nix
<clever> that order complicates the logic a lot more
<clever> Ralith: if you delete old kernels, plan to copy in new ones, but crash, it wont be able to boot
<clever> Ralith: you need to copy in the current kernels before you can safely delete old ones
<clever> it shows generation numbers, date/time stamps, and paths to the files it uses
<clever> read the grub config file
<clever> if you delete the wrong one, it will just replace it when you nixos-rebuild
<clever> you need to manually deleted 1 or 2 kernels before it can switch and delete old ones
<clever> Ralith: by default, it will setup 100 generations in the grub menu, along with any kernels those 100 refer to
<clever> grub or systemd-boot?
<clever> you can also manually delete some kernels
<clever> you have to GC some system generations, then nixos-rebuild
<clever> Ralith: and /boot is only updated upon nixos-rebuild, even after a GC
<clever> Ralith: from rebuilds prior to the last boot
<clever> import ./foo.nix will be identical to just pasting the contents of foo.nix in at that location
<clever> pretty much
<clever> bpye: you can just make your own nix file containing a set { smtp_server = "foo"; } and then import it

2018-07-07

<clever> Ralith: setup.sh i think is the only place
<clever> you can grep nixpkgs for examples, and how it works
<clever> illegalprime[m]: adding cmake to the buildInputs will automatically change the default configurePhase, and the new one obeys that var
<clever> illegalprime[m]: that would go under cmakeConfigureFlags i believe
<clever> illegalprime[m]: you can also set installFlags = [ "prefix=$out" ];
<clever> illegalprime[m]: headers would be in $out/include/
<clever> illegalprime[m]: it needs to install everything to $out
<clever> fasdfadsfadasd: you can also nix-env -f foo.nix -iA attribute
<clever> __monty__: ive tried, for avahi doesnt listen on that interface for me
<clever> __monty__: then configure nginx to mux it out to the right LAN ip on the remote end
<clever> __monty__: put a /etc/hosts entry to map many subdomains to the toxvpn ip
<clever> socat can just blindly forward it, nginx can be setup as a reverse proxy and inspect the Host: header to redirect it inteligently
<clever> __monty__: so port 80 on the toxvpn host redirects to 80 on the http server
<clever> __monty__: you might also be able to use a tool like socat or nginx to create a transparent proxy
<clever> __monty__: the other option is to run toxvpn on the http server
<clever> __monty__: i have plans to get routing working over toxvpn, but havent gotten around to testing them
<clever> __monty__: currently, you would need to run something like squid on the remote toxvpn machine, then use its tox ip to connect to the squid proxy
<clever> mahagad: an override in config.nix
<clever> so your better off with { pkgs ? <nixpkgs> }:
<clever> gchristensen: oh, and line 2 re-imports a 2nd nixpkgs, and doesnt set system
<clever> gchristensen: i think for nixpkgs itself, you just use system = "x86_64-darwin";, i'm not sure why nixos wants to call it something different
<clever> gchristensen: i think localSystem is for native builds but platform is for cross-builds
<clever> yeah
<clever> without that, it knows localhost cant build, and has no choice
<clever> jgt: because you used --option system, it assumed that localhost can build faster then nix-docker, so it just did that
<clever> jgt: nixpkgs.localSystem.system = "x86_64-linux";
<clever> jgt: that was renamed recently
<clever> jgt: that lies to nix and claims your machine can run linux binaries
<clever> jgt: dont yse --option system
<clever> jgt: near the top, does it mention any warnings about failing to reach a remote system?
<clever> jgt: it should context the nix-daemon that runs as root, which will do the ssh from root
<clever> jgt: a normal user
<clever> jgt: and then if you try the nix build again?
<clever> jgt: run it under a proper root shell, sudo -i
<clever> jgt: then your ssh keypair isnt working right
<clever> jgt: ssh nix-docker -i /etc/nix/docker_rsa
<clever> jgt: and if you try to ssh into it as root, what happens?
<clever> jgt: did you configure the build slave in /etc/nix/machines ?
<clever> Taneb: should have worked like that
<clever> Taneb: did you dd to sdb or sdb1?, how big is the usb stick?
<clever> Taneb: how did you create the bootable usb stick?
<clever> jtojnar: call evalModules with a custom list of modules, https://github.com/cleverca22/not-os/blob/master/default.nix#L12-L34
<clever> how is it only 1? lol
<clever> jgt: then cachix can cache the output of that, and nixops can import it
<clever> jgt: you can also create a new nix file, that imports haskell-packages.nix with a specific version of nixpkgs, and also builds it staticly
<clever> nix-repl> python3.sitePackages
<clever> "lib/python3.6/site-packages"
<clever> jgt: ive not tried cachix yet, so i'm not sure
<clever> jgt: it will only find it on the cache if the cache has a copy that was previously built staticly, with the same <nixpkgs>
<clever> riskbook = pkgs.haskell.lib.justStaticExecutables (import ./haskell-packages.nix { inherit pkgs; }).riskbook;
<clever> no need to re-import a 2nd pkgs
<clever> jgt: also, you may want to switch that to just { inherit pkgs; }
<clever> jgt: ah, then youll want riskbook = pkgs.haskell.lib.justStaticExecutables (import ./haskell-packages.nix { pkgs = import <nixpkgs> { system = "x86_64-linux"; }; }).riskbook;
<clever> jgt: if you gist the nix expressions near systemPackages and riskbook i can help with that
<clever> jgt: if you turn off isLibrary, it will be a dynamic ghc binary, and it will refer to other libraries and have the same issue
<clever> jgt: justStaticExecutables will override that
<clever> building it with haskell.lib.justStaticExecutables will solve that
<clever> it contains dynamic libraries that refer to ghc
<clever> riskbook is to blame
<clever> you may also need to restart the nix-daemon service with launchctl
<clever> to upgrade, sudo -i ; nix-channel --update ; nix-env -iA nixpkgs.nix
<clever> and grep for paths
<clever> for nix 1, you have to nix-store -q --tree, then manually follow the lines
<clever> jgt: you can upgrade to nix 2 easily
<clever> yeah, nix 2
<clever> the above will tell you why it depends on ghc
<clever> ahh
<clever> jgt: nix why-depends /nix/store/2ags0gq0l8q20kdy3r6dmxc50k7gzrn3-nixops-machines /nix/store/wdph2s4xzz4dkrw31cgby2l53892il0c-ghc-8.2.2
<clever> jgt: sort -h and du -h make it a lot more readable
<clever> in my case, current-system is 9.5 gig, with go bloating it a lot
<clever> 1.1G /nix/store/360zh9xvnqzvzvl567b43960fhgq90dw-go-1.10.3
<clever> 9.5G total
<clever> 449M /nix/store/d7qiksl0hzk4kl43j57f0cxscb7zdls8-chromium-67.0.3396.87
<clever> jgt: and if you run this on any storepath (or symlink to one), it shows its parts, sorted by size
<clever> [clever@amd-nixos:~]$ du --max=0 -hc $(nix-store -qR /run/current-system) | sort -h
<clever> jgt: a command like this will give a storepath on the local machine that includes every machine: nixops dump-nix-paths -d mainnet
<clever> jgt: you cant easily see what its copying, but you can look at the closure for the entire deployment, one min

2018-07-06

<clever> LnL: its just "source" for a src = fetchFromGithub build
<clever> source root is source
<clever> [nix-shell:~/iohk/iohk-nixops-devops-923]$ nix-store -l /nix/store/zf78hk92a6jx2s4wglp872yxx6ynrp6m-nix-memoise | grep 'source root is'
<clever> LnL: though sourceRoot tends to be a relative path, and wont be right once the stdenv has cd'd into it
<clever> kalbasit: the source has also already been unpacked to the working directory
<clever> kalbasit: the working directory
<clever> LnL: i think the act of setting LC_ALL causes bash to reload locales, but glibc only reads LOCALE_ARCHIVE once at startup
<clever> but you can also -f '<nixpkgs>'
<clever> by default, it uses ~/.nix-defexpr/
<clever> rrnewton: nix-env is the only tool within the set that has that weird interface
<clever> rrnewton: try instead with `nix-env -f https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.03.tar.gz`
<clever> rrnewton: nix-env ignores $NIX_PATH by default
<clever> infinisil: hadnt looked into why it vanished