samueldr changed the topic of #nixos-dev to: #nixos-dev NixOS Development (#nixos for questions) | NixOS 19.09 is released! https://discourse.nixos.org/t/nixos-19-09-release/4306 | https://hydra.nixos.org/jobset/nixos/trunk-combined https://channels.nix.gsc.io/graph.html | https://r13y.com | 19.09 RMs: disasm, sphalerite | https://logs.nix.samueldr.com/nixos-dev
liamdiprose has quit [Remote host closed the connection]
ris has quit [Ping timeout: 258 seconds]
drakonis has quit [Ping timeout: 268 seconds]
drakonis has joined #nixos-dev
drakonis has quit [Quit: WeeChat 2.6]
drakonis has joined #nixos-dev
drakonis has quit [Quit: WeeChat 2.6]
drakonis has joined #nixos-dev
drakonis_ has quit [Ping timeout: 246 seconds]
cjpbirkbeck has joined #nixos-dev
orivej has quit [Ping timeout: 240 seconds]
Jackneill has joined #nixos-dev
<adisbladis> jtojnar: So many times I have wished for that..
peti has joined #nixos-dev
__monty__ has joined #nixos-dev
tilpner_ is now known as tilpner
lassulus has quit [Quit: WeeChat 2.4]
Synthetica has joined #nixos-dev
peti has left #nixos-dev ["WeeChat 2.1"]
peti has joined #nixos-dev
cjpbirkbeck has quit [Quit: Quitting now.]
tilpner has quit [Quit: tilpner]
orivej has joined #nixos-dev
lassulus has joined #nixos-dev
__Sander__ has joined #nixos-dev
lassulus has quit [Quit: WeeChat 2.6]
lassulus has joined #nixos-dev
<Mic92> dtz: do you have some expressions by chance to build clang-tools-extra from master?
<Mic92> dtz: because I want to add a cc wrapper that makes use of CLANGD_FLAGS: https://github.com/llvm/llvm-project/commit/8faffec4e22191ad3d2a78b50f73d1010f666b60
tilpner has joined #nixos-dev
psyanticy has joined #nixos-dev
<arianvp> Question. What is the semantic difference between the substituters and trusted-substituters option in nix.conf ?
<arianvp> I see that --substituters _option_ sets the trusted-substituters config option. but why doesn't it set the "substituters" one
<arianvp> why this split?
<gchristensen> are not used by default, but can be enabled by users of the Nix daemon by specifying --option substituters urls on the command line. Unprivileged users are only allowed to pass a subset of the URLs listed in substituters and trusted-substituters.
<gchristensen> https://nixos.org/nix/manual/#conf-trusted-substituters does that make sense?
<arianvp> yes I just read that. it doesnt explain why substituters and trusted-substituters aren't combined into one option though right?
<gchristensen> well you might have a binary cache you don't want to use by default, but you do want to allow users to opt in to it
<arianvp> is it such that trusted-substituters "extends" whatever is in "substituters" because otherwise it would replace it and that's not what you want?
<gchristensen> I'm having a hard time knowing how to explain it, because what is written makes perfect sense to me :P
<__monty__> Fwiw, arianvp, I think you've got it right in your last message.
<gchristensen> it doesn't extend it ... it adds a list of optional, trusted substituters
* peti invites interested Nix/Haskell hackers to join https://www.twitch.tv/events/wMB5ytBITPCcLsyyyXLWpA tonight at 9:30 PM +0200.
<clever> arianvp: non-trusted users can mutate substituters with --option, but they are restricted to selecting from the trusted-substituters
<clever> arianvp: substituters is just the default value, and if set in the global nix.conf, they dont have to be trusted
<arianvp> clever: that's not waht I'm reading. they're restricted to "substituters + trusted-substituters"
<clever> the substituters set in the global nix.conf are trusted automatically, so yeah, its limited to the combination of both
<arianvp> so what does trusted mean here in this context?
<clever> trusted just means a non-trusted user can choose it with --option substituters
<arianvp> aaah wait so trusted-substituters are _not_ used as a substituter by default unless someone specifically specifies it wiht --option ?
<clever> exactly
<arianvp> and ahaaa
<arianvp> thanks
FRidh has quit [Ping timeout: 240 seconds]
FRidh has joined #nixos-dev
FRidh has quit [Ping timeout: 276 seconds]
peti has quit [Quit: WeeChat 2.1]
<Profpatsch> jtojnar: I’m gonna submit something soon.
<Profpatsch> To be exact:
<Profpatsch> # Pipe a value through a few functions, left to right.
<Profpatsch> # pipe 2 [ (v: v +1) (v: v *2) ] == 6
<Profpatsch> # TODO upstream into nixpkgs
<Profpatsch> pipe = val: fns: let revApply = x: f: f x; in builtins.foldl' revApply val fns;
<Profpatsch> Usability is pretty great.
<Profpatsch> worldofpeace: ^
das_j has quit [Remote host closed the connection]
das_j has joined #nixos-dev
xwvvvvwx has quit [Quit: ZNC 1.7.5 - https://znc.in]
xwvvvvwx has joined #nixos-dev
<jtojnar> 👍
jonringer has joined #nixos-dev
ixxie has joined #nixos-dev
<infinisil> Profpatsch: I think it would be better to call this something along the lines of "compose"
<infinisil> Because it's really just function composition
<infinisil> And I'd flip around the argument positions
<Profpatsch> infinisil: No, it’s explicitely this way around
<Profpatsch> That’s the base idea.
<Profpatsch> Forward application, not backward
<Profpatsch> You don’t write your pipes like this: grep "foo" | sed 's/bar/foo/' | echo "abc", do you?
<Profpatsch> Especially since lists are left-to-right data structures.
<Profpatsch> Eta-conversion usually does not help readability very much, and that would be the only reason why you’d want to have the data to the right.
<infinisil> Profpatsch: It's harder to compose that way though
<infinisil> `compose [ <f1> <f2> ]` is just another function
<jonringer> maybe it's just my background with haskell, but I think it should be right associative as well
<Profpatsch> infinisil: compose would be flipped around
jonringer has quit [Quit: Leaving.]
jonringer has joined #nixos-dev
<Profpatsch> compose [ <f2> <f1> ] data
<Profpatsch> jtojnar and worldofpeace were talking about F#’s |>.
<Profpatsch> (or clojure’s (->) macro)
<infinisil> Hmm..
<Profpatsch> First rule of good API/language design: either left to right or right to left, don’t change direction.
<Profpatsch> Maybe not the first rule, but pretty far up.
<infinisil> I'm not sure, [ <f1> <f2> ] seems like the more natural direction for me. The first element of the list is used first, then the second
<infinisil> Even with compose
<Profpatsch> Then that’s another reason why compose shouldn’t exist.
<infinisil> Hm though I guess we don't really have anything like that in nix already, so maybe the other direction would work too
<infinisil> pipe x [ f1 ... fn ] = fn (... (f1 x))
<infinisil> compose [ fn ... f1 ] x = fn (... (f1 x))
<infinisil> I think the nix world would be more used to the latter
<infinisil> Since we're always composing functions like fn (... (f1 x)) already
<Profpatsch> I don’t think appeal to authority is a good way to argue, especially for some nebulous authority like “the nix world”
<Profpatsch> :)
<infinisil> That's not an authority..? I'm just saying most nix people would probably find the compose direction more natural
<Profpatsch> The primary thing that pipe gives you is forward-readability of pipelines.
<Profpatsch> infinisil: Okay, I’m saying it would be the other way around.
<Profpatsch> Especially after working with pipe for some time.
<infinisil> I have to say, the pipe way looks nicer
<infinisil> But the compose way composes better and people are more used to it
<infinisil> I guess we should have a vote on this :P
<infinisil> Hmm yeah..
<infinisil> I am conflicted
<Profpatsch> compose doesn’t give us anything. Well, apart from unecessary overhead
<infinisil> It gives the same thing as pipe, just in different order..?
<Profpatsch> compose [ fn ... f1 ] is right-to-left and has the overhead of list allocation.
<Profpatsch> while compose [ f1 ... fn ] might seem more natural, but it changes direction.
<infinisil> Why would pipe not have that overhead?
<infinisil> lists in nix are arrays, not linked lists
<Profpatsch> pipe is the “natural” pipe, it still has the overhead but the direction is the right way around
<Profpatsch> I’d also argue we should have either pipe or compose, because otherwise people can’t remember the order in which the functions should appear in the list.
<infinisil> Probably, though we also have forEach and map
<Profpatsch> Non-Haskell languages are already moving in the direction of “forward is better UX”, and even in Haskell, (#) is used more and more often.
<Profpatsch> infinisil: forEach and map don’t fold
<infinisil> Just as an example of flipped arguments
<Profpatsch> The order of the list doesn’t matter
<Profpatsch> Yes, but those cannot be confused.
<Profpatsch> If the order of the list matters you have 4 possibilities, and as we have seen it’s quite arbitrary which one is chosen.
<Profpatsch> So if one exists in trivial.nix, the other should not.
<jonringer> I would like to continue fixing some python packages from https://github.com/NixOS/nixpkgs/pull/71222#event-2723894663 is it okay for me to push to staging? or is that looked down upon?
<Profpatsch> infinisil: Another thing: if said function should be used by people, its name should be short.
<Profpatsch> pipe is a lot easier to type than compose :)
<Profpatsch> Also it evokes the image of unix pipes, which people are very familiar with
<infinisil> That's what I'm really not sure about, because `pipe` seems to indicate it actually being a pipe
<infinisil> But it's really just function composition
<Profpatsch> which is a fancy word for pipe
<infinisil> What if we actually add pipes to nix at some point? Or some functions to get pipe functionality?
<Profpatsch> wat
<infinisil> Haskell libraries like pipes/conduit/streaming
<infinisil> unix pipes
<Profpatsch> I have that primitive, I call it pipeDrv
<Profpatsch> “pipes” the output of one drv into another.
<infinisil> I mean on the eval level
<Profpatsch> Then we call it stream?
<infinisil> Though I don't see a use for pipes on the eval level right now
<Profpatsch> Or iterator
<Profpatsch> Even though I have no idea what those would be for :)
<Profpatsch> flip pipe is still nearly as short as compose btw :)
<Profpatsch> 7 vs 9 chars
<Profpatsch> flip pipe [ f1 .. fn ] there you go
* gchristensen dreams about tony hawk pro skater
<infinisil> Hah
<Profpatsch> We should ask Mario which he prefers
<Profpatsch> The pipe of-a course!
<infinisil> Lol
<Profpatsch> Now I’ve got a Nix-themed Mario cart track in front of my eyes, thank you very much
<Profpatsch> Nix-chan in Smash, when (okoko, I’m stopping)
drakonis1 has joined #nixos-dev
xwvvvvwx has quit [Quit: ZNC 1.7.5 - https://znc.in]
xwvvvvwx has joined #nixos-dev
Synthetica has quit [Quit: Connection closed for inactivity]
<worldofpeace> please forward readability ++ :)
<worldofpeace> Profpatsch++
<{^_^}> Profpatsch's karma got increased to 6
<Profpatsch> Opening a PR …
<worldofpeace> please do
<infinisil> Yeah after some more thought, the pipe thing doesn't sound bad Profpatsch
__Sander__ has quit [Quit: Konversation terminated!]
<kl3> `nix repl` dumped core on latest -unstable: https://discourse.nixos.org/t/nix-repl-segmentation-fault/4424
<clever> mine coredumps half the time i eval a large expr
<clever> and the other half of the time, sets turn into strings at random
<Profpatsch> infinisil: worldofpeace jtojnar https://github.com/NixOS/nixpkgs/pull/71348
<{^_^}> #71348 (by Profpatsch, 11 seconds ago, open): lib/trivial: add `pipe` function
<clever> it makes no sense how it happens
<kl3> oh, so this is normal?
<Profpatsch> Ah, I should add tests as well.
<Taneb> kl3: Normal, yes, welcome, no
<gchristensen> shouldn't be 'normal' :/
<clever> kl3: normal, but it shouldnt happen
<gchristensen> Taneb++ clever++
<{^_^}> Taneb's karma got increased to 12, clever's karma got increased to 220
<Taneb> kl3: thanks for making the post
<kl3> you're welcome
<clever> kl3: you also dont have to mix nixpkgs and nixos, you can just directly `nix repl '<nixpkgs/nixos>'`
<clever> nix-repl> config.boot.kerAborted (core dumped)
<clever> and i broke mine, just by evaluating `config.boot` then trying to tab-complete `config.boot.ker`
* kl3 lowers his expectations
<clever> #1 0x00007efc4101edc1 in abort () from /nix/store/6yaj6n8l925xxfbcd65gzqx3dz7idrnn-glibc-2.27/lib/libc.so.6
<clever> #2 0x00007efc41cfb4d3 in nix::showType[abi:cxx11](nix::Value const&) [clone .cold.796] () from /nix/store/igc3zwndrl6aa60y2rfbx1f98d7wrqnv-nix-2.3/lib/libnixexpr.so
<gchristensen> has anyone opened a ticket for this?
<clever> gchristensen: previously, i had only been able to reproduce it with haskell.nix, which is fairly hefty and not a good reproduce case
<clever> heh, i can break it without even tab completion
<worldofpeace> Profpatsch: you've made my day 🎊 nix + pipe function == programming peace
<clever> gchristensen: https://gist.github.com/cleverca22/c6fa65a1209b161dad12ac95d5777200 try the nix repl here, and eval the 3 strings i evaled, in that order, without any tab completion
<kl3> is offline documentation available for nix repl? no manual, and except for two examples in the html docs under nixos-help i could not find anything
<clever> kl3: there is :?, and it accepts some basic things that all nix tools accept, like --arg, --argstr, and -I
<Profpatsch> worldofpeace: Oh, I have more ideas :)
<Profpatsch> e.g. document all builtins in the stdlib as well instead of only exporting them.
<kl3> clever: i was looking for documentation, that is to say more than a usage text on `nix repl --help`
<clever> kl3: no man page exists for the new `nix` command
drakonis has quit [Ping timeout: 240 seconds]
drakonis1 has quit [Ping timeout: 250 seconds]
drakonis has joined #nixos-dev
drakonis1 has joined #nixos-dev
<kl3> another question: configuration.nix(5) says for fileSystems.<name?>.neededForBoot (Default: false) "By default, this applies to the root file system [..]", yet I see
<kl3> nix-repl> config.fileSystems."/".neededForBoot
<kl3> false
<worldofpeace> Profpatsch: I swoon 🤣
<worldofpeace> > (2) overwhelmed by ecstatic joy.
<{^_^}> error: syntax error, unexpected ')', expecting ID or OR_KW or DOLLAR_CURLY or '"', at (string):270:1
<clever> kl3: the real logic, is an `op` operation, against neededForBoot, or being present in this list
<clever> `or` operation*
<worldofpeace> infinisil: I don't think the bot is safe to parse my joy
<kl3> clever: i see, so it's internally treated as neededForBoot=true unconditionally - makes sense, although it's confusing to still see the false there
<clever> kl3: yeah
drakonis1 has quit [Quit: WeeChat 2.6]
justanotheruser has quit [Ping timeout: 264 seconds]
drakonis_ has joined #nixos-dev
drakonis1 has joined #nixos-dev
drakonis has quit [Ping timeout: 268 seconds]
drakonis has joined #nixos-dev
drakonis_ has quit [Ping timeout: 246 seconds]
jonringer has quit [Ping timeout: 240 seconds]
justanotheruser has joined #nixos-dev
drakonis1 has quit [Ping timeout: 246 seconds]
MichaelRaskin has joined #nixos-dev
ris has joined #nixos-dev
<gchristensen> clever: can you poke disasm for me?
<disasm> hello :)
<gchristensen> woot
orivej has quit [Ping timeout: 240 seconds]
worldofpeace_ has joined #nixos-dev
Guanin has joined #nixos-dev
worldofpeace_ has quit [Quit: worldofpeace_]
worldofpeace_ has joined #nixos-dev
xwvvvvwx has quit [Quit: ZNC 1.7.5 - https://znc.in]
xwvvvvwx has joined #nixos-dev
orivej has joined #nixos-dev
drakonis_ has joined #nixos-dev
<gchristensen> some ideas from disasm on making release management nicer: https://gist.github.com/grahamc/8e2e5e275610d9e07a5549bcc0f15ab5
<worldofpeace_> edef: 1 patch merged so far 🎊
<edef> :3
psyanticy has quit [Quit: Connection closed for inactivity]
orivej has quit [Ping timeout: 265 seconds]
lopsided98 has joined #nixos-dev
drakonis_ has quit [Ping timeout: 240 seconds]
drakonis_ has joined #nixos-dev
drakonis has quit [Ping timeout: 245 seconds]
drakonis has joined #nixos-dev
<worldofpeace_> edef: Ok reviewed or merged all your patches. One's that could be backported were.
<worldofpeace_> Feel free to request my review in the future, I review when I make it mean something 👍
<edef> <3
<edef> really wish github would show interdiffs for force-pushes ;_;
<edef> i have a tool that lets me view GitHub PRs as git-series branches in the works
<edef> mostly for playing around, the other plan is to let me view GitHub stuff over NNTP
<NinjaTrappeur> wow, nice
<NinjaTrappeur> Is it public?
<Profpatsch> edef: Github does show diffs of force-pushes.
<worldofpeace_> edef: there's https://imgur.com/sPcOc2F
<worldofpeace_> though I don't think that's a diff?
<Profpatsch> YOu have to click on “force-pushed”
<worldofpeace_> what!!!
<worldofpeace_> lol
<worldofpeace_> all this time I haven't known this
<Profpatsch> it won’t work very well for rebasing on master, but it’s great for small changes
<samueldr> I seem to remember they changed it recently to be the link on the "force-pushed" words
<Profpatsch> It’s a slightly lighter grey than the surrounding text.
<samueldr> that the link was elsewhere in the text before
<Profpatsch> But yeah, not really visible.
<samueldr> but haven't found validation of what I think :/
<edef> Profpatsch: neat! that's still not quite at the level of an interdiff (which would work fine for rebase-on-master) but it's a start
<NinjaTrappeur> oO
__monty__ has quit [Quit: leaving]
justanotheruser has quit [Ping timeout: 276 seconds]
ixxie has quit [Ping timeout: 240 seconds]
justanotheruser has joined #nixos-dev
drakonis__ has joined #nixos-dev
drakonis__ has quit [Client Quit]
worldofpeace_ has quit [Quit: worldofpeace_]
eraserhd has quit [Quit: WeeChat 2.6]
eraserhd has joined #nixos-dev
drakonis1 has joined #nixos-dev
orivej has joined #nixos-dev
drakonis_ has quit [Ping timeout: 240 seconds]
drakonis_ has joined #nixos-dev