gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
<clever> ,profiling taktoa[c]
<{^_^}> taktoa[c]: Use NIX_COUNT_CALLS=1 and/or NIX_SHOW_STATS=1 to profile Nix evaluation
rajivr has joined #nixos-chat
neeasade has joined #nixos-chat
tilpner_ has joined #nixos-chat
tilpner has quit [Ping timeout: 256 seconds]
tilpner_ is now known as tilpner
cjpbirkbeck has joined #nixos-chat
<drakonis> ughhh nvidia is so bad
<drakonis> it runs like arse on linux 5.8
<drakonis> i had to use 5.4 to get reasonable performance again
<drakonis> and i wouldnt be surprised about that getting worse as new kernels come out
<Ashy> obligatory friendly-message-from-torvalds-to-nvidia.gif.png
<drakonis> yes
<drakonis> i agree
<drakonis> i think i got a 70% perf loss just from bumping the kernel to the latest
<drakonis> which made using kde the slowest thing ever
<Ashy> i do my best to vote with my dollars and buy amd gpus
<Ashy> don't always succeed with work machines but at least with my personal machines
cole-h has joined #nixos-chat
<ldlework> Anyone know the file on nixos that has the battery level?
<ldlework> nevermind
<cole-h> ldlework: Something in /sys/class/power_supply/BAT0/, probably
<cole-h> oh
xd1le has quit [Read error: Connection reset by peer]
xd1le has joined #nixos-chat
maxdevjs has quit [Ping timeout: 246 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
<aleph-> Man wireguard is being so dang finicky to set up this go around
endformationage has quit [Quit: WeeChat 2.9]
cjpbirkbeck has quit [Quit: Goodbye, take care]
evanjs has quit [Quit: ZNC 1.8.1 - https://znc.in]
evanjs has joined #nixos-chat
evanjs has quit [Read error: Connection reset by peer]
evanjs has joined #nixos-chat
evanjs has quit [Read error: Connection reset by peer]
<aleph-> And that's fun. My postgres instance had a db get overwritten. :|
evanjs has joined #nixos-chat
cole-h has quit [Quit: Goodbye]
<lejonet> aleph-: finicky how?
evanjs has quit [Read error: Connection reset by peer]
evanjs has joined #nixos-chat
monsieurp has quit [Remote host closed the connection]
monsieurp has joined #nixos-chat
xd1le has quit [Read error: Connection reset by peer]
xd1le has joined #nixos-chat
johanot has quit [Ping timeout: 256 seconds]
johanot has joined #nixos-chat
<colemickens> I really can't believe people start new projects in a language where they have no problem carting around split_string functions to every new project
<JJJollyjim> doesn't nix not have a split string function? :P
<colemickens> if someone tried to write general purpose apps in nix I'd probably have a similar disbelieving reaction :P
<tazjin> colemickens: uhh
* tazjin hides various generic purpose Nix program
<tazjin> +s
<tazjin> nothing to see here
<colemickens> tazjin: oh no, :( no no.
<colemickens> I shouldn't have been so negative, plus my reaction when you said something was curiosity :P
<tazjin> (the former makes https://tazj.in/feed.atom, the latter makes https://todo.tvl.fyi/)
<colemickens> I think they're neat, and I hope to do something similar one day!
<colemickens> tazjin: how about a desktop launcher tho :P
parsley936 has joined #nixos-chat
__monty__ has joined #nixos-chat
ravndal has quit [Ping timeout: 240 seconds]
<philipp[m]> Does anybody have a clever way handy to execute a oneshot systemd service exactly twice?
<eyJhb> && .... start ....? :D
<eyJhb> What is the end goal philipp[m] ? Why would you want to do it twice?
<philipp[m]> I'm having some rsync backups here and it's nice to invoce rsync twice since you get a more consistent result the second time.
<eyJhb> Why not just run the command two times then?
<philipp[m]> I guess, I could.
<eyJhb> If you have more than one, then make a function which takes the func as a argument and eval/exec it I guess
<philipp[m]> Aha! I can run it a second time in ExecStartPre and prefix it with a `-`, so the exit code is ignored.
<eyJhb> Ohh god :p
<philipp[m]> That's actually pretty exactly what I want. First run best effort to try to get the environment as good as it gets, then run it and complain about all errors.
<eyJhb> philipp[m]: sounds perfect then :D
<eyJhb> I am really considering buying a new phone (I have a OnePlus One atm.) because I want 5g support. Any ideas?
<immae> philipp[m]: or you can just put two ExecStart lines and they will get both executed :)
<philipp[m]> immae: Nix doesn't like that though, does it?
<immae> you need to put it as an array
<immae> (note that it works only with oneshot systemd service type)
<V> colemickens: my entire website is generated using an HTML templating language I wrote in Nix
<etu> V: That sounds both painful and awesome :D
<etu> V: But I generate my website using Emacs and Nix... :p
<V> At the top of the file I have a comment containing a quote from the paper
<V> "The Nix expression language is a simple, untyped, purely functional language. It is not a general purpose programming language. Its only purpose is to describe components and compositions."
<V> etu: it is awesome!
<V> My entire system is slowly turning into a NixOS config monorepo
<V> I just run nixos-rebuild and I have a new copy of my website seamlessly deployed
<makefu> V: welcome to the future! For me one of the main things is that my hosts "accidentally" install the latest version when i deploy new configuration with an udated nixpkgs rev. It may be a hassle sometimes but it is better than being scared of updating like in the old times
<V> Hate it when I have up-to-date software ;)
<makefu> you can also stay on your favorite nixpkgs rev forever and nobody can do anything about it!
<makefu> in one of my configs i include nixpkgs-18.03 for an old version of nodejs
* etu run some 19.09 on unstable for packages that have been dropped
evanjs has quit [Ping timeout: 256 seconds]
evanjs has joined #nixos-chat
monsieurp has quit [Ping timeout: 256 seconds]
monsieurp has joined #nixos-chat
waleee-cl has joined #nixos-chat
<aleph-> lejonet: Despite a wiped/blank firewall and an open port, having issues connecting my client to my server/routsr
<aleph-> Which is annoying. Didn't have this issue last time. Which is bothersome as I followed the guide verbatim on the wiki
ravndal has joined #nixos-chat
<lejonet> aleph-: o.O no typo in the keys? I had that once, was very annoying
<aleph-> Seems to be that
maxdevjs has joined #nixos-chat
ixxie has joined #nixos-chat
disasm has quit [Ping timeout: 240 seconds]
disasm has joined #nixos-chat
ixxie has quit [Remote host closed the connection]
ixxie has joined #nixos-chat
FRidh has joined #nixos-chat
rajivr has quit [Quit: Connection closed for inactivity]
cole-h has joined #nixos-chat
ixxie has quit [Quit: Lost terminal]
FRidh has quit [Quit: Konversation terminated!]
cjpbirkbeck has joined #nixos-chat
ixxie has joined #nixos-chat
<pie_> iirc there was a way to do something like sudo, but temporarily add an extra group, and i cant manage to ask google the right way to get the answer im looking for instead of a bunch of unrelated spam
<samueldr> pie_: newgrp?
<pie_> i cant quite tell from the man page if that just overwrites it so ill test
<samueldr> pie_: SEE ALSO in that manpage might guide you
<pie_> "newgrp: failed to crypt password with previous salt: Invalid argument" 0_o
<pie_> todays yak shave: /dev/ttyACM0 gets recreated when i try to upload to my arduino so chmod downst work. also me: adding group is broken.
<pie_> i could try fiddling with udev
<colemickens> pie_: are you part of 'dialout' ?
<colemickens> does that work for /dev/ttyACM0 too? I think it might?
<colemickens> oh wait, maybe you already did that?
ixxie has quit [Quit: Lost terminal]
<pie_> thats what im trying to do
<pie_> err, no im not part of dialout yet
<pie_> i figured there should be a tool that can give it to me for a process
<pie_> colemickens: well, newgrp worked if i add myself first
<pie_> though actually at that point i probably might as well just use su or something so thats pointless
<samueldr> IIRC groups can have a password
<samueldr> for similar use cases
<samueldr> but that's probably like a relic of some scheme of old times UNIX
<pie_> ive also got an stm32 but the serial device for that doesnt show up for some reason even though i vaguely remember uploading ages ago the (presumably) blink example thats running on it right now
<pie_> meh. should hook up the st-link thingy to it after i buy some new breadboard because the old one got disappeareds
<pie_> actually the stlink is disappeared too . sigh
<pie_> fml im going to bed
* colemickens has weird emotions about supporting non-flake nix
__monty__ has quit [Quit: leaving]
<colemickens> cole-h: "It's not limited to channels", the things my brain rejects? :P or do you mean the <> syntax?
<cole-h> <> :P
<cole-h> e.g. I used it for accessing secret files at one point -- `secrets=/path/to/secrets` and <secrets/secret1>
<colemickens> it's a good point, the evil derives from NIX_PATH.
<cole-h> Yep
<cole-h> Although I don't think NIX_PATH should ever go away...
<cole-h> How else will I be able to get a repl with nixpkgs if not `nix repl '<pkgs>'`
wildtrees has joined #nixos-chat
wildtrees_ has joined #nixos-chat
wildtrees has quit [Ping timeout: 240 seconds]
wildtrees__ has joined #nixos-chat
wildtrees_ has quit [Ping timeout: 240 seconds]
<V> Have nix repl use nixpkgs implicitly? :p
<V> That seems like the more user-friendly option
<samueldr> but nix != nixpkgs!
wildtrees_ has joined #nixos-chat
<cole-h> ^
<cole-h> Sometimes I like doing `nix repl` to see how far I can get with builtins
<infinisil> cole-h: :l <nixpkgs> inside the repl btw
<infinisil> To import nixpkgs after starting
wildtrees__ has quit [Ping timeout: 256 seconds]
<cole-h> Yeah
<samueldr> (still doesn't change the crux of the argument about NIX_PAT)
<samueldr> NIX_PATH*
<cole-h> Still requires <nixpkgs> (or an analogue) in NIX_PATH :P
<infinisil> Ah
<infinisil> :l channel:nixos-unstable
<infinisil> :)
<samueldr> but my <nixpkgs> points to [my custom fork, your custom fork, an old version, not nixpkgs]!
<infinisil> (not sure if this was directed at me but channel:nixpkgs-unstable doesn't rely on <nixpkgs>)
<samueldr> yeah, that's if you wanted to use your own nixpkgs that's not a nixos.org channel, it gets less ergonomic without a NIX_PATH or similar scheme
<cole-h> I use `nix repl '<pkgs>'` because I have a shim that makes my overlayed packages available to it x)
wildtrees__ has joined #nixos-chat
wildtrees__ has quit [Remote host closed the connection]
wildtrees_ has quit [Ping timeout: 240 seconds]
wildtrees has joined #nixos-chat
wildtrees has quit [Max SendQ exceeded]
parsley936 has quit [Remote host closed the connection]
parsley936 has joined #nixos-chat
parsley936 has quit [Remote host closed the connection]
<elvishjerricco> Wait wtf. With -e, a function in bash doesn't exit on the first failed command??
<cole-h> `set -e; fjdskl` -> exits with 127
<cole-h> WFM
<samueldr> a function fn() {}?
<cole-h> o
<samueldr> it might be because of how it's used at its call-site
<samueldr> or pipefail?
<elvishjerricco> samueldr: Try `(set -e; function foo { false; echo foo; }; foo && echo bar)`
<samueldr> yeah, looks like what you said
<samueldr> bash!
<elvishjerricco> Wtf bash
<elvishjerricco> That's insane
<infinisil> As if I didn't have enough reasons to not use bash!
<cole-h> :D
<samueldr> >> When not in posix mode, bash clears the -e option in such subshells.
<cole-h> y tho
<elvishjerricco> samueldr: Adding another `set -e` in the function body doesn't change anything
<elvishjerricco> Even surrounding the body in parens to make it a subshell, and keeping the `set -e` in that subshell, it doesn't work
<elvishjerricco> I'm baffled
<cole-h> bash pls
<elvishjerricco> This function is supposed to be quite a few lines long. Am I just supposed to add `|| return 1` to every line?
<elvishjerricco> `(set -e; false; echo foo; false; echo bar) && echo baz`
<elvishjerricco> Prints foo bar and baz
<elvishjerricco> wut
<cole-h> F
aleph- has quit [Ping timeout: 260 seconds]
<elvishjerricco> I cannot find any documentation on why this happens anywhere
<infinisil> elvishjerricco: Maybe try #bash :)
<infinisil> Have gotten good answers from there
<samueldr> >> Because once you are in a context that ignores 'set -e', the historical behavior is that there is no further way to turn it back on, for that entire body of code in the ignored context. That's how it was done 30 years ago, before shell functions were really thought about, and we are stuck with that poor design decision.