gchristensen changed the topic of #nixos-chat to: NixOS but much less topical || https://logs.nix.samueldr.com/nixos-chat
<samueldr> hmmm, I'm annoyed at how my phone only has one usb port
<samueldr> so I can't use a usb drive for stage-2
<samueldr> * and still keep the usb network thing to debug
<samueldr> I guess SD will do
<infinisil> USB hub?
<samueldr> can't be both OTG and usb device :/
<infinisil> OTG?
<samueldr> like host, but with a device port
<samueldr> though doing it the dumb way with a usb ethernet adapter + usb drive would work too, I guess lol
<samueldr> I was using the usb gadget thingy from the kernel so the device itself does the ethernet adapter via usb
<elvishjerricco> I use the new CLI all the time, though I use this patch: https://github.com/NixOS/nix/pull/2423
<{^_^}> nix#2423 (by ElvishJerricco, 9 weeks ago, open): nix build: Print result paths to stdout with --no-link
<infinisil> Nice
<infinisil> Oh and the CLI...
<infinisil> nix-env should just be discarded
<infinisil> It's horrible in so many ways
<elvishjerricco> Haha yea. We need some kind of `nix install` first though.
<infinisil> I wonder if anybody would have anything against people (e.g. me) implementing `nix install` in Haskell
<elvishjerricco> Personally I'd love to see home-manager get a command line tool that mutates a JSON file and builds / activates the home-manager config, which would read the JSON file to put packages in `home.packages`
<infinisil> Well eelco probably, but I sure as hell won't learn C++ just to help with this
<elvishjerricco> infinisil: The C++ in Nix is shockingly good.
<elvishjerricco> I hate C++ but working on the Nix codebase is surprisingly pleasant.
<samueldr> not a C++ fan, worked with it in the past, and I concur, nix has a good codebase
<drakonis_> consolidate the nixos suite into nix, ty
<samueldr> no idea what you mean by those words
<infinisil> Hmm yeah
<infinisil> But still, I just don't feel comfortable in imperative languages
pie_ has joined #nixos-chat
<drakonis_> i mean that the commands to manage NixOS could be rolled into nix
<pie_> hi guys how do i not fail at learning emacs
<drakonis_> same ^
<elvishjerricco> infinisil: How would you implement a Nix subcommand in Haskell?
<samueldr> except nixos is not part of nix
<samueldr> rolling them up into nix breaks the separation
<infinisil> elvishjerricco: I think the plugin infrastructure supports custom CLI commands
<pie_> elvishjerricco: pretty sure profpatsch has done something like that?
<elvishjerricco> infinisil: The manual claims it does, but it does not
<drakonis_> who was it that was trying to allow modules outside of nixos?
<elvishjerricco> infinisil: Adding plugins occurs after command line parsing has completed
<infinisil> Ahh darn..
<pie_> ah wait i misunderstood
<elvishjerricco> drakonis_: The NixOS module system? It's already perfectly usable outside NixOS. home-manager and nix-darwin both use it
<samueldr> hm, I could take a look again, but I think the change needed for a custom command wouldn't be too onerous to add
<mdash> pie_: what do you want to learn about emacs
<elvishjerricco> samueldr: Parsing some command line args first is a necessity since --plugin-files can be specified on the command line
<pie_> mdash: just...you know....how to use it for programming
<pie_> or like, at all
<infinisil> How about `nix <subcommand>` just calling `nix-<subcommand>` if it doesn't have any <subcommand> itself
<samueldr> elvishjerricco: thankfully, part of the good codebase is the args parsed in nix :)
<samueldr> infinisil: that approach is good, but a bit impure :/
<infinisil> samueldr: Could register the binaries in the config too
<elvishjerricco> Wait really? Like Nix code is executed to parse args? That's neat
<samueldr> elvishjerricco: no, C++, I meant nix as the project name
<infinisil> samueldr: Maybe just a `subcommand.<subcommand> = /path/to/binary` in nix.conf
<elvishjerricco> Ohhh
<samueldr> infinisil: ah, not a bad idea
<samueldr> I was about to say: but a good way to try new ideas
<elvishjerricco> That has a similar problem to args parsing though.
<infinisil> elvishjerricco: What problem?
<drakonis_> why is it necessary to separate nix and nixos?
<elvishjerricco> Args and nix.conf are parsed before doing anything, and parsing a subcommand would require parsing nix.conf first.
<elvishjerricco> drakonis_: Not all Nix users use NixOS.
<infinisil> Ah I see
<elvishjerricco> samueldr: What about that file in particular?
<samueldr> that's what I was referring to earlier, the good codebase for arguments parsing
<elvishjerricco> ah
<samueldr> (it also inherits common arguments in some way, don't know how off the top of my head)
<infinisil> You know what would be cool (just throwing ideas out there): To have interactive variants of all commands
<elvishjerricco> huh
<drakonis_> i'm aware of that, but couldn't the linux exclusive features like boot generations and most modules depend on linux?
<samueldr> interactive nix repl? nobody wants that
<infinisil> So you could `nix install` and it opens a repl where you can list packages to install and it gives continuous feedback
<mdash> pie_: there's a builtin tutorial but you might like Sasha Chua's
<drakonis_> infinisil: yesssss
<drakonis_> dnf has that
<infinisil> Or `nix eval` could track files and automatically reevaluate if the file changes
<mdash> drakonis_: they aren't exactly separate, they're inthe same repo :)
<elvishjerricco> infinisil: Or just run `nix` and be able to do commands like `eval nixpkgs.foo` and `build nixpkgs.foo`
<infinisil> elvishjerricco: Yeah!
<infinisil> Subrepls
<elvishjerricco> infinisil: Then nix repl basically just becomes an alias for `nix eval`
<infinisil> Yeah, very nice
<infinisil> Pretty much everything could just be an alias to nix repl/nix eval
<infinisil> With different modes of operation
<infinisil> (reload on file change)(build/instantiate/eval)
<infinisil> Well not for `nix copy`, that's something different, same for a couple other commands
<elvishjerricco> Anyway, I'm struggling to think of any way to make it possible to add sub commands using `nix --plugin-files ...`, short of just having `nix` parse some options itself and setting the config before pass the remainder off to a subcommand, which would then mutate the config
<pie_> mdash thanks
<pie_> mdash: i tried some fancy distribution or addon pack for emacs at some point, and that had something for searching for commands
<drakonis_> spacemacs?
<pie_> right that
<elvishjerricco> infinisil: How do you envision `nix install` working? Just like `nix-env` but minus the insanity in the command line interface?
<drakonis_> why not install to a generation in particular?
<drakonis_> default to current
<drakonis_> and removal behaves the same way
<elvishjerricco> that doesn't make sense. Generations aren't mutable.
<drakonis_> sorry, i should've expanded, you can create a new generation based on that one
<drakonis_> ie: create new generation from another then work on it before locking it
<drakonis_> then that one becomes the current one
<elvishjerricco> Isn't that basically how it works now?
<drakonis_> i don't think it is exactly like this
<infinisil> elvishjerricco: I'd like it to be like emacs customize
<infinisil> It should do something like the json thing you mentioned
<infinisil> But with a nix file instead
<elvishjerricco> Hm. Well, it's very hard to do it in a nix file
<elvishjerricco> Mutating a turing complete AST sounds hard :P
<infinisil> The file shouldn't ever be changed by humans though
<elvishjerricco> But I wanna touch it
<infinisil> There's a seperate file for you to touch
<infinisil> Call the generated one ~/.config/nix/pkgs-generated.nix
<infinisil> Although, Maybe a json would be better
<elvishjerricco> If humans don't touch it then why shouldn't it be a proper serialization format like JSON?
<infinisil> I thought i had a reason for it at some point
<infinisil> Ohh i got it
<elvishjerricco> infinisil: I wouldn't mind something nixos-rebuild-esque. i.e. You have a file where your manually written things go, and the command just evaluates that with some Nix wrapper that also includes stuff from a JSON file
<infinisil> elvishjerricco: json files are bad at encoding nix expressions
<infinisil> And people can install arbitrary expressions
<infinisil> Not just attr paths
<elvishjerricco> true
<samueldr> also, nix-env works on `name` attributes, which is... not the most convenient way to track something :/
<infinisil> samueldr: let
<colemickens> love that nix build is just ignoring --builders and building locally anyway and that '-v' gives no extra output
<infinisil> samueldr: Let's just pretend the name thing never happened
<colemickens> (and I am a trusted user in /etc/nix/nix.conf)
<elvishjerricco> colemickens: I think I've used `--builders` with nix build. You sure your user is trusted?
<elvishjerricco> ah
<elvishjerricco> infinisil: Maybe just go full nixos-style and say all package management is done by your hand-written nix config?
<infinisil> elvishjerricco: i really want an imperative command though
<elvishjerricco> I kinda don't :P
<infinisil> And i bet if we don't have one, people will write a hacky one themselves
<infinisil> It's just much easier and faster
<elvishjerricco> I dunno. You don't see people doing that to NixOS
<colemickens> oh well, NIX_REMOTE + nix-build works I guess
<infinisil> elvishjerricco: Yup, that's why I'm sometimes ending up nix-env installing things just because i can't be bothered editing my config and rebuilding..
<elvishjerricco> Hah fair enough, I've done that
<infinisil> (Okay that's mostly because rebuilding takes so long.. which is another problem..)
<colemickens> +1
<elvishjerricco> But I still don't think we want the state file to be a nix expression. The argument that people want to install arbitrary expressions doesn't work because they don't want those expressions re-evaluated every time they install anything else; they want the same store path as before.
<infinisil> elvishjerricco: counterpoint: people want to update their packages, which requires reevaluation and different store paths
<elvishjerricco> infinisil: But if your expression includes a path literal then re-evaluating will surely fail when you change directory
<infinisil> Huh, what do you mean?
<elvishjerricco> `nix install '(import ./foo.nix)'`
<elvishjerricco> Next time I `nix install` something, if that exact string is re-evaluated and I'm not in the same directory, it'll break
<infinisil> Ahh, need to make paths absolute then
<infinisil> That's a rather simple AST transformation
<infinisil> Or just disallow relative paths
<elvishjerricco> infinisil: I prefer the nix-env model of updating; install things with one command and update them with another
<elvishjerricco> for imperative package management at least
<elvishjerricco> I shouldn't have to update a dozen unrelated packages to install something new just because I updated my channel
<infinisil> I mean, updating would still be a separate command in my idea. The generated file just has something like 'import <nixpkgs> {}' at the top, and nixpkgs only changes on updates triggered by the update command (via some json rev/sha256 file)
<colemickens> then why update the channel if you're not going to update your system?
<infinisil> Ah
<infinisil> Yeah ^^
<infinisil> Okay, but that's a point, we should allow pinning of packages
<infinisil> This could be done within the generated nix expression
<infinisil> And add a command 'nix install --pin' or so
drakonis has joined #nixos-chat
drakonis_ has quit [Ping timeout: 268 seconds]
<colemickens> [root@xeep:/sys/devices/system/cpu/cpu0/cpufreq]# cat scaling_max_freq
<colemickens> 4000000
<colemickens> [root@xeep:/sys/devices/system/cpu/cpu0/cpufreq]# cat scaling_cur_freq
<colemickens> 399980
<colemickens> seems bad, or not?
lassulus_ has joined #nixos-chat
lassulus has quit [Ping timeout: 244 seconds]
lassulus_ is now known as lassulus
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 252 seconds]
drakonis has joined #nixos-chat
drakonis_ has quit [Ping timeout: 268 seconds]
drakonis_ has joined #nixos-chat
drakonis has quit [Ping timeout: 252 seconds]
drakonis has joined #nixos-chat
drakonis has quit [Quit: WeeChat 2.2]
jasongrossman has quit [Ping timeout: 272 seconds]
ninjin has quit [Remote host closed the connection]
ninjin has joined #nixos-chat
drakonis_ has quit [Ping timeout: 272 seconds]
lopsided98 has quit [Ping timeout: 264 seconds]
Lisanna_ has joined #nixos-chat
lopsided98 has joined #nixos-chat
jasongrossman has joined #nixos-chat
jD91mZM2 has joined #nixos-chat
<qyliss> I just had a build fail due to a random bit flip :D
<qyliss> An impurity that had not previously occurred to me
<jasongrossman> qyliss: I'm impressed that you managed to diagnose that.
jD91mZM2 has quit [Quit: WeeChat 2.2]
__monty__ has joined #nixos-chat
<qyliss> I got an error because of “#incl}de”
<qyliss> } is one bit off from u
<jasongrossman> qyliss: Ha.
lassulus has quit [Ping timeout: 244 seconds]
lassulus has joined #nixos-chat
jD91mZM2 has joined #nixos-chat
drakonis has joined #nixos-chat
<infinisil> qyliss: Whoa, never thought this would occur in reality
<infinisil> Ah, possibly your memory is starting to give up
<qyliss> It was on edef’s server, I’ll let her figure that out :P
<qyliss> Read some interesting stuff about it though. Apparently happens way more than you’d think.
<infinisil> :O
aszlig has quit [Quit: Kerneling down for reboot NOW.]
aszlig has joined #nixos-chat
drakonis has quit [Ping timeout: 245 seconds]
ottidmes has joined #nixos-chat
hdeshev has joined #nixos-chat
drakonis has joined #nixos-chat
pie_ has quit [Ping timeout: 256 seconds]
lassulus has quit [Ping timeout: 252 seconds]
drakonis1 has joined #nixos-chat
drakonis has quit [Ping timeout: 240 seconds]
drakonis has joined #nixos-chat
hdeshev has left #nixos-chat ["PING 1542565569"]
<samueldr> mildly annoyed at how the sd card doesn't seem to work on the aarch64 kernel for that phone...
jD91mZM2 has quit [Quit: WeeChat 2.2]
jasongrossman has quit [Ping timeout: 244 seconds]
<gchristensen> qyliss: wow!
__monty__ has quit [Quit: leaving]
pie_ has joined #nixos-chat
<pie_> this part though holy shit https://youtu.be/_e6BKJPnb5o?t=1003
drakonis has quit [Ping timeout: 240 seconds]
<drakonis1> oh its a lunduke video :|
jackdk has joined #nixos-chat
<pie_> i dont know the guy :D
<drakonis1> he's terrible
<pie_> haha
<infinisil> pie_: I liked it haha
lassulus has joined #nixos-chat