gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
Lisanna has quit [Quit: Lisanna]
Sonarpulse has joined #nixos-chat
FRidh has joined #nixos-chat
lassulus_ has joined #nixos-chat
<pie_> because i didnt get any attention in the main channel im reposting :PP https://i.imgflip.com/2eiht1.jpg
lassulus has quit [Ping timeout: 268 seconds]
lassulus_ is now known as lassulus
pie_ has quit [Read error: Connection reset by peer]
pie_ has joined #nixos-chat
Jason_Grossman has quit [Remote host closed the connection]
<dtz[m]> Lmao
FRidh has quit [Quit: Konversation terminated!]
Jason_Grossman has joined #nixos-chat
<infinisil> Haha
<kalbasit> infinisil: I'm so behind on functional programming, last I used one was 10 years ago :o. Anyway, I'm trying to figure out how to loop over some data to contruct the config. I remember doing recursive in Scheme but I'm not sure how to do that in Nix yet. I know Go is not your lang of choice, but I've put together an example of what I'm trying to do: https://play.golang.org/p/7zNyJfzWMUh
<kalbasit> how would you write that in Nix?
<kalbasit> infinisil: my goal is to refactor https://github.com/kalbasit/system/blob/master/machines/imports/publica.nix so it's not so messy
<infinisil> kalbasit: something like `services.nginx.virtualHosts = mapAttrs (name: port: { serverName = name; ... locations."/".extraConfig = '' ... proxy-pass ...:${toString port}''; }) { "console.publica.dev" = 7000; "api.publica.dev" = 8080; }`
<kalbasit> infinisil: awesome!!
<kalbasit> Thank you!
<infinisil> Could also use mapAttrs' (subdomain: port: valueNamePair "${subdomain}.publica.dev" { serverName = "${subdomain}... }) { dev = 7000; api = 8080; }
<infinisil> kalbasit: ^^
<infinisil> > valueNamePair
<{^_^}> undefined variable 'valueNamePair' at (string):162:1
<infinisil> > lib.valueNamePair
<{^_^}> attribute 'valueNamePair' missing, at (string):162:1
<infinisil> > lib.nameValuePair
<{^_^}> <LAMBDA>
<infinisil> Ah it's that one
<infinisil> Check out the implementation of mapAttrs' and nameValuePair for some docs
<infinisil> ,find attrsets.nix
<kalbasit> infinisil: thank you infinisil, I'll try that
<kalbasit> looks pretty awesome
<kalbasit> infinisil: the only problem I see with `services.nginx.virtualHosts = ` is that it will override any other `services.nginx.virtualHosts = ` that I have in a different imported file. so I'll have to merge the value if it exists before right?
FRidh has joined #nixos-chat
Jason_Gr` has joined #nixos-chat
Jason_Grossman has quit [Ping timeout: 240 seconds]
Jason_Gr` has quit [Ping timeout: 260 seconds]
<infinisil> kalbasit: nah the module system handles that for you
<infinisil> All different files get merged automatically
<kalbasit> infinisil: awesome, thank you!
<kalbasit> side note, where can I find github/irc commands for the bot?
<infinisil> If you were to set this option multiple times in the same file, then you'd need mkMerge for that to manually merge it
<kalbasit> for instance, can I ask it to label a PR?
<kalbasit> infinisil: oh I se
<infinisil> The bot can't do anything with pr's, it only links them #10
<{^_^}> https://github.com/NixOS/nixpkgs/pull/10 (by garbas, closed): afew and alot updates
<infinisil> ,
<{^_^}> All commands: -A IFD NUR arm ask bootfull callPackage channels cloudfront context dnw error escape" escape'' escape-special fancy-uninstall find github hardware help home-manager library locate logs luck nix-env-r nix-info nix-repl nixGL nixcon nixeval nixpkgsVersion not-os notfound outPath overlay paste pills pinning pr profiling pure-eval replaceModule runtimeDeps stateVersion stuck tell thesis timer tofu unfree unstable which-channel whomademe
<infinisil> Special ones are ,find ,locate and ,tell. Invoke them without arguments to see what they're doing. The rest are just string substitution
<infinisil> ,help
<{^_^}> Use `,` to list all commands, `,foo = Foo!` to define foo as "Foo!", `,foo =` to undefine it, `,foo` to output "Foo!", `,foo somebody` to send "Foo!" to the nick somebody
<infinisil> (You can't use this ^^ for the special ones)
<samueldr> kalbasit: on github it is another bot, unrelated
<samueldr> for tagging purposes, you have to annoy someone who can commit :/
<samueldr> s/tagging/label/g
<samueldr> no need for /g :)
<kalbasit> I see
<kalbasit> thank you samueldr and infinisil
<samueldr> though, for what it's worth, I don't think there's any value in adding a "bug" label?
<samueldr> the labels here are almost abused to be indicators more than actual labels
<samueldr> like "this changes THIS much" or "this affects THAT thing"
<kalbasit> oh I see
<kalbasit> sounds good then
<samueldr> yeah, your PR looks fine, (not talking about the code though)
<samueldr> (though for a byte, this too looks fine, it'd need testing :))
Sonarpulse has quit [Ping timeout: 276 seconds]
<samueldr> oh, you've been busy, three closed, three open in 11 days
<kalbasit> samueldr: I tested it myself
<samueldr> ah, didn't mean to imply anything, just can't say "yes" since I looked no more than 5 seconds at the changes ;)
<kalbasit> now I can :)
<kalbasit> samueldr: true :)
sir_guy_carleton has quit [Quit: WeeChat 2.0]
Jason_Grossman has joined #nixos-chat
pie__ has joined #nixos-chat
pie_ has quit [Read error: Connection reset by peer]
__Sander__ has joined #nixos-chat
__Sander__ has quit [Ping timeout: 240 seconds]
__Sander__ has joined #nixos-chat
jD91mZM2 has joined #nixos-chat
Jason_Grossman has quit [Ping timeout: 244 seconds]
Jason_Grossman has joined #nixos-chat
Jason_Grossman has quit [Ping timeout: 268 seconds]
Jason_Grossman has joined #nixos-chat
Guanin has joined #nixos-chat
__monty__ has joined #nixos-chat
Sonarpulse has joined #nixos-chat
yurb has quit [Ping timeout: 256 seconds]
tazjin has quit [Ping timeout: 256 seconds]
sppky has quit [Ping timeout: 256 seconds]
vdemeester` has quit [Ping timeout: 256 seconds]
sppky has joined #nixos-chat
pie__ has quit [Read error: Connection reset by peer]
Sonarpulse has quit [Ping timeout: 276 seconds]
tazjin has joined #nixos-chat
vdemeester` has joined #nixos-chat
__monty__ has quit [Quit: leaving]
pie_ has joined #nixos-chat
pie_ has quit [Remote host closed the connection]
pie_ has joined #nixos-chat
__Sander__ has quit [Quit: Konversation terminated!]
pie_ has quit [Read error: Connection reset by peer]
pie_ has joined #nixos-chat
Sonarpulse has joined #nixos-chat
yurb has joined #nixos-chat
vdemeester` has joined #nixos-chat
vdemeester` has quit [Changing host]
__monty__ has joined #nixos-chat
Sonarpulse has quit [Ping timeout: 264 seconds]
FRidh has quit [Quit: Konversation terminated!]
Sonarpulse has joined #nixos-chat
jD91mZM2 has quit [Ping timeout: 244 seconds]
pie__ has joined #nixos-chat
pie_ has quit [Ping timeout: 260 seconds]
pie_ has joined #nixos-chat
pie___ has joined #nixos-chat
pie__ has quit [Ping timeout: 240 seconds]
pie_ has quit [Ping timeout: 260 seconds]
Lisanna has joined #nixos-chat
Jason_Grossman has quit [Read error: Connection reset by peer]
Jason_Grossman has joined #nixos-chat
Lisanna has quit [Ping timeout: 240 seconds]
__monty__ has quit [Quit: leaving]
d1rewolf has quit [Ping timeout: 268 seconds]
d1rewolf has joined #nixos-chat
sir_guy_carleton has joined #nixos-chat