worldofpeace_ changed the topic of #nixos-dev to: #nixos-dev NixOS Development (#nixos for questions) | NixOS stable: 20.03 ✨ https://discourse.nixos.org/t/nixos-20-03-release/6785 | https://hydra.nixos.org/jobset/nixos/trunk-combined https://channels.nix.gsc.io/graph.html | https://r13y.com | 19.09 RMs: disasm, sphalerite; 20.03: worldofpeace, disasm | https://logs.nix.samueldr.com/nixos-dev
teto has quit [Ping timeout: 240 seconds]
<elvishjerricco> Should zfsUnstable be updated to 2.0-rc1 now that that's out?
<infinisil> :O
<infinisil> I'd say yes!
<infinisil> Makes me think, NixOS options like `enableUnstable` are kind of bad, because most users just want to temporarily enable it
<infinisil> Maybe this should rather be something like `unstableVersion = lib.mkOption { type = types.enum [ "0.8-rc1" "2.0-rc1" ]; }`
<infinisil> Where users will get an error if they select an unstable version not available anymore (because it's stable)
janneke has quit [Quit: janneke quits Mes'sing]
janneke has joined #nixos-dev
<elvishjerricco> infinisil: Eh, I see `enableUnstable` more like the nixos-unstable channel; it just keeps advancing faster than stable, even if a lot of it is effectively the same as stable
<elvishjerricco> s/faster/more aggressively/
<infinisil> elvishjerricco: Hm yeah. However I think we should distinguish between unstable as in "can just rollback if it breaks" and "oh no, I lost all my data"
<infinisil> For the former I think an `enableUnstable` option is fine. But for the latter, a `unstableVersion` one would be better
ris has quit [Ping timeout: 240 seconds]
justanotheruser has quit [Ping timeout: 240 seconds]
rajivr has joined #nixos-dev
<samueldr> in that mind set, why artificially limit how the package is set through a bool, and not set .package? (or for those that are against .package, let users manage that through an overlay)
justanotheruser has joined #nixos-dev
cptchaos83 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
cptchaos83 has joined #nixos-dev
<elvishjerricco> How do I get `machine.succeed` to output the command's stderr and stdout to the log?
<elvishjerricco> Regardless of if it succeeds or fails?
alp has joined #nixos-dev
orivej_ has quit [Ping timeout: 260 seconds]
janneke has quit [Remote host closed the connection]
janneke has joined #nixos-dev
alp has quit [Ping timeout: 272 seconds]
alp has joined #nixos-dev
cole-h has joined #nixos-dev
alp has quit [Ping timeout: 272 seconds]
<JJJollyjim> elvishjerricco: iirc something along the lines of machine.succeed("thecommand | systemd-cat")
<JJJollyjim> I really want to make the test driver stream command output to the log automatically, the status quo can make debugging pretty annoying
<elvishjerricco> *sigh*, updating zfsUnstable to 2.0-rc1 is going to require even more substituting /bin, /sbin, /usr/local/bin, etc...
<elvishjerricco> I'm too tired for that right now. Why are people so against PATH?
sgrunert has joined #nixos-dev
FRidh has joined #nixos-dev
teto has joined #nixos-dev
cole-h has quit [Quit: Goodbye]
alp has joined #nixos-dev
FRidh has quit [Ping timeout: 258 seconds]
FRidh has joined #nixos-dev
FRidh has quit [Ping timeout: 265 seconds]
FRidh has joined #nixos-dev
FRidh has quit [Quit: Konversation terminated!]
FRidh has joined #nixos-dev
alp has quit [Remote host closed the connection]
alp has joined #nixos-dev
lightbulbjim has joined #nixos-dev
lightbulbjim has quit [Quit: Connection closed for inactivity]
lightbulbjim has joined #nixos-dev
<Mic92> worldofpeace: spacekookie sphalerite are you in the meeting today? If we don't have at least three people we, we cannot have the meeting today.
<Mic92> niksnut said he is on vacation
<spacekookie> I'm still on sick leave until end of next week
<niksnut> Mic92: no I'm not on vacation
<Mic92> niksnut: ok. than we need just one more
<sphalerite> Mic92: yep I can make it
v0|d has quit [Remote host closed the connection]
<infinisil> samueldr: Oh yeah a package option sounds even better
<infinisil> Though then there's the same problem with pkgs.zfsUnstable
<infinisil> So maybe it should be pkgs.zfs_2_0_rc1 instead, and zfsUnstable be removed
<Mic92> infinisil: we need zfsUnstable every once in a while
<Mic92> Sometimes we point to master
<infinisil> Mic92: Did you see my argument regarding enableUnstable above?
<Mic92> infinisil: the semantic of enableUnstable is that it only points to unstable if the latest kernel is not supported otherwise.
<Mic92> so if 2.0-rc1 unlocks newer kernel we will point to that.
<Mic92> if you are running linux_latest you likely need zfs unstable sooner or later.
<infinisil> Yeah but the problem about it being able to wipe all your data is still there. That's the thing I'm worried about
<Mic92> than you should not use it
<Mic92> and run stable.
<infinisil> Well yeah, see my point above
<Mic92> I don't get your point
<infinisil> 02:42:35 infinisil | Makes me think, NixOS options like `enableUnstable` are kind of bad, because most users just want to temporarily enable it
<infinisil> 02:43:50 infinisil | Maybe this should rather be something like `unstableVersion = lib.mkOption { type = types.enum [ "0.8-rc1" "2.0-rc1" ]; }`
<infinisil> 02:44:26 infinisil | Where users will get an error if they select an unstable version not available anymore (because it's stable)
<Mic92> if it becomes stable than zfsUnstable will point to stable.
<infinisil> If you enable `enableUnstable`, you'll get the unstable version at that point. But if you then update nixpkgs, it might break your setup because unstable was updated to a "too unstable" version you haven't evaluated yet
<infinisil> What if there's a seriuos bug in zfs master that can wipe all your data for example. And nixpkgs happens to update zfsUnstable to it. For everybody having `enableUnstable` this could be pretty bad
<infinisil> Which is why I'm arguing that the user should *select* the unstable version they want, e.g. 2.0-rc1, such that if unstable is updated, they need to cosciously change an option to match the new unstable
<infinisil> *If* they still want to use unstable that is
<niksnut> sphalerite: joining?
<infinisil> The fundamental reasoning is that it's unsafe to update from "unstable -> another unstable". In comparison it's presumably always safe to update "stable -> another stable"
<Mic92> how is this different from running linux_latest?
<Mic92> It could also have a bad bug that make you loose all your data.
<Mic92> It's not like there are no regression tests.
<infinisil> Mic92: linux_latest is still stable though
<infinisil> And linux doesn't manage your data, the chance of making it loose all your data is negligible
<infinisil> In comparison, zfs unstable could be disastrous
<infinisil> And that without warning
orivej has joined #nixos-dev
lightbulbjim has quit [Quit: Connection closed for inactivity]
<Mic92> Linux manages your data and more.
alp has quit [Ping timeout: 244 seconds]
<Valodim> ZFS is not forwards compatible though
alp has joined #nixos-dev
<infinisil> elvishjerricco: Mic92: https://github.com/NixOS/nixpkgs/pull/96432
<{^_^}> #96432 (by hmenke, 10 hours ago, open): zfsUnstable: 0.8.4 -> 2.0.0-rc1
sgrunert has quit [Remote host closed the connection]
teto has quit [Ping timeout: 260 seconds]
<sphalerite> Valodim: how not?
<Valodim> zfs has feature flags, and an implementation needs to support the ones used by a pool to mount it: https://openzfs.org/wiki/Feature_Flags
<Valodim> no idea how much of an issue this is in practice
<sphalerite> right, but you need to upgrade a pool manually for it to become incompatible.
<Valodim> true
alp has quit [Remote host closed the connection]
alp has joined #nixos-dev
bennofs__ has joined #nixos-dev
bennofs_ has quit [Ping timeout: 240 seconds]
alp has quit [Ping timeout: 272 seconds]
ris has joined #nixos-dev
sgrunert has joined #nixos-dev
<eyJhb> Does it make sense, to use Nix to build a configuration that I can convert to Yaml? (there would be more to it of course, it would be used in a build process, where tho module inputs would be in the output as something.yml)
cole-h has joined #nixos-dev
<samueldr> it might
<samueldr> and you might be able to just output it as json, as yaml is (supposed to be) a superset of json
<eyJhb> I should do a POC, but I think it needs to be yaml, as it should be SOMEWHAT easy to edit
<eyJhb> *sigh* slowly getting better at Nix, but there is sooo much to learn.
<eyJhb> But it feels hacky to use Nix, because I will not get many to use it, and might scare some off. But on the other hand, we might get more people into Nix!
rajivr has quit [Quit: Connection closed for inactivity]
* cransom votes no on YamlOS.
justanotheruser has quit [Ping timeout: 240 seconds]
justanotheruser has joined #nixos-dev
FRidh has quit [Quit: Konversation terminated!]
alp has joined #nixos-dev
teto has joined #nixos-dev
teto has quit [Client Quit]
alp has quit [Ping timeout: 240 seconds]
sgrunert has quit [Remote host closed the connection]
lewo` has joined #nixos-dev
alp has joined #nixos-dev
<eyJhb> cransom: you want it, you know it
<ris> eyJhb: it makes sense to me
<eyJhb> Currently it is execution of it, that I have no idea how to do. E.g if I have this - https://termbin.com/3t7bk and I want to reuse it and have it a seperate thing. then I am unsure of 1. how to reuse it 2. how to run https://github.com/NixOS/nixpkgs/blob/master/nixos/lib/eval-config.nix on it
<infinisil> eyJhb: You just want to do a module evaluation with these options?
<infinisil> And nothing else?
<eyJhb> Want to create a instance that has these options, e.g. I want to have optSet1, optSet2, optSet3, then have these options and convert them to JSON/yaml and put them into a file
<eyJhb> Does that makes sense infinisil ?
<eyJhb> Basically the goal is still, in the form of cyber sec, where I might clone a repo with challenges, and then create config files for each challenge in the repo. So I can just nix-build to create all the challenge configs I need
<infinisil> How about `lib.evalModules { modules = [ ({ lib, config, ... }: { options.sets = lib.mkOption { type = types.attrsOf (submodule { options = <your options>; }); }; options.resultFile = lib.mkOption { default = pkgs.writeText "file.json" (builtins.toString config.sets); }; })]; }`
<samueldr> (I was already answering that on my end while eyJhb started asking here :))
<samueldr> you might end up wanting to filter out the _module key(s?) out of the attrset it builds
<infinisil> samueldr: Not necessary anymore :)
<samueldr> look at mr unstable here
<infinisil> :P
<samueldr> and true, they're gone
<infinisil> #82751 btw
<{^_^}> https://github.com/NixOS/nixpkgs/pull/82751 (by Infinisil, 23 weeks ago, merged): Minor module improvements
<samueldr> infinisil: do comment if you see anything wrong on my example, or things that could be better
<eyJhb> samueldr: ohh sorry :(
<samueldr> sorry?
<eyJhb> For asking all places at once :p
<samueldr> no worries, I didn't tell you because I didn't know if I was going to end up doing it
<eyJhb> ANd making you both work
<samueldr> oops, I left my pp in there
<eyJhb> pp?
<samueldr> (yes, I know there's on in lib that does the same thing, but I always forget its name)
<infinisil> samueldr: Looking good!
<samueldr> name borrowed from ruby's pp
<infinisil> lib.debug.traceValSeq
<infinisil> Took a while to remember the name lol
<samueldr> rolls off the tongue just like a frozen pole
<eyJhb> Ahhh. I couldn't think of anything else than naughty stuff...
<infinisil> Hehe
<eyJhb> Hmm sweet! Works :p
<samueldr> btw when I had linked to eval-config.nix earlier, this applies only if you want to evaluate a nixos or nixos-like system
<samueldr> (which I used for Mobile NixOS since it's a superset)
<eyJhb> But, regarding having a base set of options, can I just `optSet1 = origOptions; optSet1.option = something`etc.?
<eyJhb> Ohh, yeah okay :D
<eyJhb> As soon as I asked this question, I looked as nixus as well infinisil
<samueldr> that eval-config.nix ends up using that function
<eyJhb> Because I knew something must be used there as well!
<samueldr> I don't understand your question
<eyJhb> Ehmmm... When I declare options , with what you have done in the gist. how can I go about having multiple that use that
<eyJhb> Let me try to code what I mean
<samueldr> yeah, I still don't see :)
<eyJhb> This hideous example
<samueldr> oh, I forgot
<eyJhb> Of none working code
<samueldr> the whole chapter is your friend
<samueldr> oh, you would call "eval" in my example
<infinisil> Also all of nixpkgs/nixos/modules
<samueldr> oh wrong
<samueldr> you would make `eval` a function that takes `config: ` as an arg
<samueldr> you could even make the `writeText` part a function taking in a configuration attrset
<eyJhb> Ahh, I see now, thanks!
<samueldr> btw, both `config` and `options` technically respect the "Example 44.1. Structure of NixOS Modules"
cole-h has quit [Quit: Goodbye]
<samueldr> uh, not both config and options, but the `config` attrset, and the attrset that has the `options` value
<samueldr> see, there is the "abbreviated" format, where if you don't have options declarations you can define config values at the root
<samueldr> (not sure if I'm helping or causing confusion)
<eyJhb> Mostly confusion, but that is a general theme for me with NixOS
<samueldr> it all ends up making sense at some point
<eyJhb> Hoping so! Just need to put enough time into it
<eyJhb> Does Nix function well with building vbox images?
<samueldr> I think so, as one is built as part of the outputs of NixOS
<eyJhb> But does it only work with NixOS builts, or can I build e.g. Debian?
<eyJhb> Currently one of the biggest reasons I want to use Nix for building these challenges is, that when I want to pull stuff in from other repos, sources etc. they fill a TON! So just having .nix files, where I can build and maybe even specify what I want would be ideal. E.g. https://github.com/google/google-ctf is 200+ MB in size, which is one of the first ones I would pull in. ALso having defaults
<eyJhb> in options, without having to hack around and figuring out, where to place the defaults in my Go code instead
<samueldr> good question about debian
<samueldr> we do have the ability to build a *qemu* vm for debian
<samueldr> maybe it can be combined?
<adisbladis> eyJhb: In personal projects I use Nix as an excuse not to have config file parsing ^_^
<adisbladis> Why have a config file when I can use Nix to generate a command line
<adisbladis> eyJhb: I don't know what your packaging requirements on Debian are, but maybe fpm is for you?
<adisbladis> > fpm.meta.description
<{^_^}> "Tool to build packages for multiple platforms with ease"
<adisbladis> > fpm.meta.homepage
<samueldr> adisbladis: make a debian VM AFAIUI
noonien has joined #nixos-dev
<eyJhb> adisbladis: generally I just need some docker and vbox I assume, qemu might work as well
<eyJhb> I just want to get this project off the groud sooooon
<eyJhb> ground* will work a little more on the basics tomorrow, and then I can hopefully make my monorepo thingy
<eyJhb> But all the guys involved in the project, are not Nix fans. So hard to push anything with it :p
<eyJhb> Unless I can make the most sweet sweet lib ever
<eyJhb> Currently my idea, is to have all the small building blocks for challenges, such as web content, basic versions of libc, etc. available which can then be pulled in
<eyJhb> samueldr++ infinisil++
<{^_^}> infinisil's karma got increased to 341
<{^_^}> samueldr's karma got increased to -2147483648
<eyJhb> Sad day samueldr
worldofpeace_ has joined #nixos-dev
worldofpeace_ has quit [Quit: worldofpeace_]
worldofpeace_ has joined #nixos-dev
worldofpeace_ has quit [Client Quit]