2018-08-16

<clever> ldlework: then you can create a machines.nix+aws.nix cluster for amazon, and machines.nix+vbox.nix to deploy the same cluster to virtualbox
<clever> ldlework: you could also have 3 files, machines.nix defines every machine in the cluster, aws.nix sets aws options, and vbox.nix sets vbox options
<clever> ldlework: and if 2 files define the same machine, the config is merged, the same way nixos modules merge when added to imports
<clever> ldlework: if the files define different machines, then the cluster will have all of those machines
<clever> you would then need to +v everybody
<clever> #osdev tried that a few hours ago, and had the same discovery
<clever> yeah
<clever> kandinski: when you can, edit a copy of nixpkgs, and then file a PR to github
<clever> kandinski: nix-env -f ~/nixpkgs -iA hello

2018-08-15

<clever> android vs ios have similar problems, the flexibility to do anything, also allows people to do anything, which then breaks things, lol
<clever> and even if you have systemd, it may work differently on some distros
<clever> but with linux, is it init.d?, systemd?, something else?
<clever> erickomoto: so its simpler to do service level stuff with launchctl on darwin
<clever> erickomoto: part of it, is that darwin is a lot more predictable then the mess of every linux distro under the sun
<clever> nix.conf can inject impure things into the sandbox
<clever> plus nix.conf flags
<clever> sphalerite: nix mounts a lot of things for its sandbox, so you would need some form of API (maybe a json file) detailing what you want mounted where
<clever> and that includes no power to create another namespace
<clever> so the uid's within the container are fake and have no real power
<clever> the problem, is that a mount namespace by non-root, requires a user namespace
<clever> which makes it a pain in the ass to run a nix-bundle based installer/updater, from within a nix-bundle based app
<clever> MichaelRaskin: and nix-bundle also fails inside a container made by nix-bundle
<clever> you need root to use namespaces, or flip a sysctl
<clever> sphalerite: ive run into problems deploying things with nix-bundle because of that
<clever> MichaelRaskin: debian disables those by default
<clever> yeah
<clever> multi-user requires somebody with root to administer it every now and then
<clever> lol
<clever> erickomoto: multi-user requires nix-daemon to be running as root, so it can switch to the chosen users
<clever> erickomoto: that would be a single-user setup, so all builds are just ran as whoever started nix-build
<clever> (also the reason you shouldnt install a random .deb file without trusting the source)
<clever> erickomoto: it would probably only take 5 minutes to whip up a .deb that just does exactly that, lol
<clever> ah
<clever> erickomoto: the curl | sh script can then take it from there, and never need sudo
<clever> erickomoto: due to how the install script works, the admin can simply `mkdir /nix ; chown $YOU /nix` and thats all he has to do
<clever> binaryphile: just refer to it, and nix will automatically build it
<clever> thats weird
<clever> or fix the module
<clever> jtojnar: which is why i never use that in modules i write
<clever> jtojnar: the module system is usually used to generate the service files
<clever> joepie91: you can also just stop the nscd service
<clever> joepie91: also check /etc/resolv.conf
<clever> gentoo is most likely
<clever> i cant even remember what distro is on the 2 missing ones
<clever> disasm: one of my older laptops is still missing, ive been digging thru the piles on and off for 2 months and stil havent found it, lol
<clever> ah
<clever> but if you just set services = { hostapd.enable = true; dhcpd4.enable = true; }; then nixos will configure it all and you dont even need bindings
<clever> and i avoid network manager like the plague :P
<clever> 2 different ways ive configured dhcp servers, but ive not done hostapd on nixos yet
<clever> if the nix-shell is not open
<clever> yeah, nix-collect-garbage will clean them up automatically
<clever> inquisitiv3: they are just added to /nix/store/ and then inserted into env vars
<clever> ghci is just a bash script that runs ghc --interactive
<clever> exec "/nix/store/p372bagly14f82850qkzpjyimvw8ipqy-ghc-8.2.2/bin/ghc-8.2.2" --interactive "$@"
<clever> inquisitiv3: yeah
<clever> inquisitiv3: yeah, it will download both of them, and put them into PATH
<clever> which is identical to just pasting that string into a .nix file and running nix-shell on it
<clever> inquisitiv3: internally, `-p hello` gets translated into `-E "with import <nixpkgs> { }; (pkgs.runCommandCC or pkgs.runCommand) \"shell\" { buildInputs = [ (hello) ]; } \""
<clever> inquisitiv3: yeah
<clever> inquisitiv3: it will drop you into a shell that has the listed derivations in $PATH
<clever> inquisitiv3: if you want to use a library like lens, then you would use nix-shell -p 'haskellPackages.ghcWithPackages (ps: [ ps.lens ])'
<clever> growpotkin: looks like a simple fetchurl against github
<clever> philippD: if its on github, you can just use the URL from viewing it as raw
<clever> sphalerite: it doesnt need to be, but would need some rewrites to be async
<clever> so, check your nix-store -qR on the drv, and then multiply that by the round-trip ping
<clever> sphalerite: i think every call to builtins.derivation requies a round-trip over the network
<clever> and unzip will alter the unpackPhase to support zip files in src
<clever> the setup hook on cmake will mutate the configurePhase to run cmake for you
<clever> cmake and unzip are other examples of setup hooks
<clever> yeah
<clever> and then when you put one of those into the inputs, it will add itself to the var
<clever> you can also use setupHook (like like 4 of your gist) on the derivations containing the emojocode
<clever> and if you add that derivation to the inputs of anything, the hook will be sourced
<clever> that will generate a derivation with the given deps, and setup hook
<clever> makeSetupHook { deps = []; } ./path/to/hook.sh
<clever> 77 { deps = [ autoconf automake gettext libtool ]; }
<clever> 78 ../build-support/setup-hooks/autoreconf.sh;
<clever> pkgs/top-level/all-packages.nix: autoreconfHook = makeSetupHook
<clever> Xyliton: setup hooks have to be part of a derivation in the inputs
<clever> sphalerite: stage-1 should have copied libkmod and patchelf'd it
<clever> you can also `nix edit nixpkgs.pkgconfig` to directly open it in your $EDITOR
<clever> > pkgconfig.meta.position
<clever> sphalerite: irc says thats not one line, lol
<clever> sphalerite: yeah, theres no real good way to create indirect drv roots
<clever> sphalerite: of note, nix-store -r /nix/store/foo --add-root result --indirect
<clever> sphalerite: only tool ive seen that does this is hydra, and its a bit tricky to get it to do just that
<clever> to grab it from the cache
<clever> infinisil: you can still run `nix-store -r` against an old storepath of it
<clever> robstrr: try putting the string i gave above into a file, and then run nix-build on that file
<clever> it will mostly work, but you will sometimes get an error
<clever> it may try to use 2.0 features
<clever> infinisil: you want nix-repl, a seperate package
<clever> robstrr: sounds like hydra would be best maybe?
<clever> something like this to start with maybe?
<clever> with import <nixpkgs> {}; let compilers = builtins.attrNames haskell.compiler; in map (c: import ./. { compiler = c; }) compilers
<clever> > "${curl}"
<clever> > curl.outputs
<clever> Myrl-saki: foo will return the 1st output in .outputs
<clever> another option
<clever> "/nix/store/188avy0j39h7iiw3y7fazgh7wk43diz1-hello-2.10"
<clever> [clever@amd-nixos:~]$ nix-instantiate --eval -E 'with import <nixpkgs> {}; "${hello}"'
<clever> readonly can also jam IFD
<clever> yep
<clever> if its in the binary cache, it will just download
<clever> johanot: nix-build '<nixpkgs>' -A hello
<clever> > pythonPackages.zlib
<clever> emily: i think nixos-install and nixops are already using it
<clever> emily: you could maybe patch nixos-rebuild and file a PR
<clever> emily: nixos-rebuild build --fast is nearly identical, but yeah, the UI differences
<clever> it can also help to put all of these things into github
<clever> then ${curl}/bin/curl would have actually worked
<clever> so you could have also done curl = pkgs.curl; and then you would have a bash $curl that has the path
<clever> also of note, every attribute passed to mkDerivation, becomes an env var during the build
<clever> so i prefer to always use source, its also harder to miss, a stray . can just look like a typo
<clever> but when i was first learning linux, i sometimes got ./foo and . ./foo mixed up and it led to confusion
<clever> source and . are identical
<clever> ah
<clever> so you can then export whatever=${curl} then source ${./foo.sh}
<clever> this will copy foo.sh into /nix/store, and then substitute in its storepath
<clever> source ${./foo.sh}
<clever> you can also mix things in fun ways
<clever> has to be escaped
<clever> > '' double single ''${foo%bar} ''
<clever> neither one allows that
<clever> > '' double single ${foo%bar} ''
<clever> > "doublequoted ${foo%bar} "
<clever> yeah
<clever> need to escape the ${
<clever> > '' prefix ''${foo} suffix ''
<clever> that also makes it a bit tricky sometimes to do actual shell variables
<clever> > "an example: ${curl}/bin/curl and more"
<clever> yep
<clever> and if it still has an issue, just edit the gist to include the new file and i can check it again
<clever> yeah
<clever> you can do the same things with buildCommand, and it also be much easier
<clever> switch over to buildCommand = '' .... ''; and just paste the entire contents of build.sh into that string
<clever> bash is also in the buildInputs by default, so that doesnt need to be there at all
<clever> jasom: 99% of the time, you never need to set builder, that just makes everything harder for yourself
<clever> jasom: can you gist your nix files?
<clever> Profpatsch: ping
<clever> jasom: you can also do ${curl}/bin/curl

2018-08-14

<clever> Zajcev: did you restart the container?
<clever> Zajcev: either run it outside the container, or disable the chroot'ing
<clever> Zajcev: vsftpd is trying to namespace itself, but containers are not allowed to create namespaces
<clever> Dedalo: that is the location within nixpkgs
<clever> > sway.meta.position
<clever> Dedalo: you can check master first on github
<clever> Dedalo: you need an override the changes the src and name attributes
<clever> infinisil: but i can steal it as an example, and write a haskell.lib.getHaskellBuildInputs variant
<clever> infinisil: it only searches propagatedBuildInputs and propagatedNativeBuildInputs, and even those will have holes due to the runtime nature of that system
<clever> infinisil: the one in deprecated.nix ?
<clever> shlevy: is there a simple function that can be combined with haskell.lib.getHaskellBuildInputs to flatten a dep tree down to a single list?
<clever> Denommus: should be able to do that
<clever> Denommus: should be as simple as `nixos-container root-login gitlab-runner`
<clever> Denommus: or ssh?
<clever> Denommus: or nixos-containers?
<clever> Denommus: with nixops?
<clever> q3k: nope, dont have merge powers
<clever> samrose_: if you dont care about the extensionpack, you can just override .src and .name
<clever> samrose_: let blocks cant be overridden
<clever> SirMadam: nix-store -r /nix/store/hash-name
<clever> all good fo rnow
<clever> > pkgs.hello.name
<clever> yeah, good question
<clever> > pkgs.hello.name
<clever> > pkgs = import <nixpkgs> { config.allowUnfree = true; }
<clever> :D
<clever> but irc cant show an example of that
<clever> JonReed: you can also use a ''string'' for the 2nd argument, then just use normal newlines in your editor
<clever> JonReed: ignore the bot, that will generate a bin/scriptname shell script, which when ran, will copy the snapshot of ./. (insert whatever you want there) to .
<clever> > writeScriptBin "scriptname" "#!${pkgs.stdenv.shell}\ncp -vir ${./.} ."
<clever> > writeScriptBin "scriptname" "#!${pkgs.stdenv.shell}\ncp -vir ${something} ."
<clever> JonReed: but you could create a bash script that does the cp for you
<clever> JonReed: not really
<clever> JonReed: wrapProgram can be setup to run cd before running the binary
<clever> yep
<clever> gcc.cc is the raw gcc package, that doesnt understand how to find things in buildInputs
<clever> gcc is a wrapper package, that generates a bash script called gcc, which deals with making nix work
<clever> EmilHem: add gcc.cc to the library list
<clever> EmilHem: thats in the gcc package
<clever> EmilHem: then you run result on the node binary that NVM had downloaded
<clever> EmilHem: you would just run nix-build directly on that file, and it generates a bash script called result
<clever> or for just testing what libs you need before you write a full package
<clever> the gist is more for things like games, where you dont(or cant) use steam-run, and need to re-patch them regularly
<clever> but in this case, its easier to just `nix-shell -p node`
<clever> so you can ./result node to re-patch node at any time
<clever> symphorien: the result symlink is also a bash script that will patch $1
<clever> symphorien: fix the library list, run nix-build, the result symlink is now a GC root for those libraries
<clever> symphorien: i also have a util to solve both issues at once...
<clever> yep
<clever> EmilHem: you would need to re-run patchelf on the binary every time nvm decides to update it
<clever> "nix-shell -p nodejs", or nodejs-10_x or nodejs-6_x ...
<clever> EmilHem: any tool that downloads ELF files like that is going to break on nixos, its simpler to just use the versions packaged in nix
<clever> EmilHem: just use the node already packaged in nixpkgs?
<clever> EmilHem: nodejs?
<clever> Meep: you must set the grub device to sda, not sda2
<clever> wpa_gui also gives you a gui without touching NM
<clever> inquisitiv3: then youll need to configure it with either wpa_passphrase or wpa_gui
<clever> inquisitiv3: and did you enable wpa_supplicant or network manager?
<clever> inquisitiv3: does `iwconfig` or `ip link` show a wireless interface?
<clever> inquisitiv3: yeah, cleverca22 is me
<clever> MichaelEden[m]: you can add any module you want to the imports section of configuration.nix
<clever> aanderse: if you provide a rev, it should mostly be good
<clever> aanderse: builtins.fetchGit runs the git clone outside of any nix sandbox, so it can just use normal ssh keys in $HOME
<clever> aanderse: have you looked at builtins.fetchGit, it doesnt need most of that ssh setup
<clever> you beat me!
<clever> ,paste aanderse-work
<clever> sphaugh: you can also just let pkgs2 = import /home/clever/nixpkgs {}; and then add pkgs2.customfont to the config
<clever> aminechikhaoui: i dont think there is any way to disable a user, just force change the ssh keys and password so nobody can access it
<clever> sphaugh: fonts have to be in the fonts.fonts option in nixos
<clever> aminechikhaoui: if the uid is null, it will just auto-assign the uid
<clever> aminechikhaoui: what happens if you users.extraUsers.foo = lib.mkForce null;
<clever> i would use self.lib
<clever> silver_hook: i would avoid installing python or haskell in such a manner, and just load that with nix-shell
<clever> lo_mlatu: ah
<clever> lo_mlatu: when i checked the service, it didnt even have a udev rule in the package
<clever> Taneb: yeah
<clever> Taneb: yeah, i have also found that the order matters
<clever> hyper_ch2: because sometimes a drive in the array takes 40 seconds to come online, and its a very bad idea to start a degraded pool
<clever> Taneb: i checked, and aggregate is just a normal derivation, with _hydraAggregate=true; and constituents = [ list of derivations ];, and a buildCommand that sets up some nix-support stuff when passing
<clever> hyper_ch2: that might solve things
<clever> hyper_ch2: have you set the missing drive as offline with `zpool offline` ?
<clever> hyper_ch2: ah, and Baughn's safety wont allow a degraded pool to import immedietly
<clever> hyper_ch2: after you manually import the pool, do `zpool status`, what does it say?
<clever> hyper_ch2: are they both sata drives?
<clever> hyper_ch2: are both halves of the ssd mirror on the same protocol?
<clever> aggregate does some special stuff, so hydra is aware of it being an aggregate job, and then hydra can show the contents of it
<clever> > ./.
<clever> synergy source code is on github, yet you have to pay for windows binaries
<clever> q3k: it builds and runs, but another license nag
<clever> q3k: hmmm, cant test it any further because i need a name/pw...
<clever> ah
<clever> q3k: have you heard of http://www.clash-lang.org/ ?
<clever> yeah, that sounds better
<clever> 20374 diamond = callPackage ../applications/science/biology/diamond { };
<clever> 8087 diamond = callPackage ../development/tools/diamond { };
<clever> error: attribute 'diamond' at /home/clever/nixpkgs/pkgs/top-level/all-packages.nix:20374:3 already defined at /home/clever/nixpkgs/pkgs/top-level/all-packages.nix:8087:3
<clever> fun
<clever> ah
<clever> q3k: and line 92 of the new one, i dont see any arguments being passed to makeWrapper, so it likely isnt doing anything more then ln
<clever> q3k: line 36-49 of the old builder, instead of bin/lin64/programmer bin/lin64/pgrcmd, you can do bin/lin64/{programmer,pgrcmd,....}
<clever> q3k: in generall, you probably want to use buildCommand, not builder, it makes things simpler
<clever> q3k: nice, i need to get back into fpga stuff some time
<clever> not sure
<clever> kisik21: https://github.com/peti/hydra-tutorial if you have a machine you can leave on 24/7
<clever> kisik21: it would probably be simpler to just run a hydra
<clever> tertle||eltret: services.xserver.desktopManager.xfce.enable = true;
<clever> tertle||eltret: yep
<clever> tertle||eltret: i use xfce on all of my machines
<clever> jbaum98: you might also want to set installCheckTarget, it will `make installcheck` by default

2018-08-13

<clever> jbaum98: doInstallCheck = true; instead of doCheck=true;
<clever> jbaum98: thats what the installCheckPhase is for
<clever> comment those lines out and nixos-rebuild, and it will go back to the old config
<clever> tertle||eltret: how did you install musix?
<clever> tertle||eltret: how did you change the kernel initially?
<clever> use sudo or `sudo -i`
<clever> tertle||eltret: then you never need to use su again
<clever> tertle||eltret: are you in the wheel group?
<clever> but the new interface sometimes lacks the off switch for fancy features
<clever> 2.0 includes all of the old 1.0 tools
<clever> nix-build is the old 1.0 interface, nix is the new 2.0 interface
<clever> q3k: nix-build
<clever> good
<clever> pie__: it should all be food
<clever> most of this is a weird haskell example ive never found the source of, that i never used, lol
<clever> your new shell.nix should contain: (import ./. {}).shell
<clever> then rename this entire thing to default.nix
<clever> fix the names to be less confusing
<clever> pie__: moreshell is for nix-build, while shell is for nix-shell
<clever> pie__: rec also means 49 has to be `inherit drv;`
<clever> pie__: and if you make line 48 rec {, then you can just put moreshell into the buildInputs, no need to duplicate code
<clever> pie__: the derivation on line 50 is missing a name=
<clever> close, the stdenv will do a lot of startup stuff for you before that
<clever> tertle||eltret: in /boot/
<clever> pie__: can you pastebin your derivation?
<clever> sphalerite: though you might want to copy the src, to stop ghc from dumping .hi files in /nix/store/
<clever> sphalerite: ghc ${./main.hs} -o $out/bin/foo, dont even have to copy
<clever> sphalerite: and if it starts to get more complex, i generate a .cabal file, and switch to callCabal2nix
<clever> sphalerite: i generally start with a runCommand based derivation, using ghcWithPackages in the inputs
<clever> pie__: builtins.derivation doesnt work on darwin when the sandbox is enabled
<clever> ,pastebin
<clever> yes
<clever> pie__: use -A with both nix-build and nix-shell, to select which attribute to use
<clever> pie__: runCommand "foo-wrapped" { buildInputs = [ makeWrapper ]; } "mkdir -pv $out/bin ; makeWrapper ${drv}/bin/input $out/bin/output --prefix VAR : VALUE";
<clever> add a derivation using runCommand, that uses makeWrapper
<clever> ./result/bin/binary
<clever> pie__: and for nix-shell, add a second attribute to the attribute set, that has an mkDerivation as its value
<clever> q3k: check the oraclejdk for an example