{`-`} has joined #nixus
<bqv> i.e. reference the flake by flake uri, not have it as part of the same git repo
<infinisil> I was thinking of using git's remote mechanism to synchronize between machine
<infinisil> Because then you can use git pull/merge/push/etc. to coordinate changes happening on different machines
<sphalerite> infinisil: https://logs.nix.samueldr.com/nixus/ for the topic? :)
<infinisil> Ah yes, will do shortly
<bqv> infinisil: yeah, but i would have assumed that'd be separate-ish to the versioning of the flake, but come to think of it that might be overcomplicating things
<infinisil> Hm, or maybe we don't put the full repo at the target machine
<infinisil> But rather only the commit sha1 of the current state
<infinisil> Eh maybe not
<infinisil> The idea being you can rebuild locally on a machine if necessary
<bqv> yeah
ChanServ changed the topic of #nixus to: Nixus is an experimental deployment tool for NixOS systems - https://github.com/Infinisil/nixus - https://logs.nix.samueldr.com/nixus/
<infinisil> Eh, it's an idea-in-progress, but I feel like it might work well with flakes, because they really ensure that the git repo describes the whole system
<bqv> sorry, people wont leave me the heck alone
<bqv> yeah, i like that idea
<bqv> have a nixus.nix next to your flake.nix, or something?
<bqv> or have it as part of the flake as a defined attr?
<infinisil> Well in the nixus repo it would just be a flake.nix I guess, which defines the function to build the deployment
<infinisil> But in your own repo you'd depend on the nixus flake and use that function in your flake.nix probably
<bqv> makes sense
<infinisil> Oh and you'd probably depend on all the nixpkgs versions you wanted for your systems too as a flake input
<infinisil> And would pass that to the function somehow (probably via the nixpkgs option in nixus)
<bqv> right, that was the big issue with nixus, it integrates tightly to the nixosSystem so it needs a nixpkgs and to be imported as a module(?)
<infinisil> Yeah it currently wants the path to nixpkgs directly
<infinisil> Hm does flakes have no way of doing that actually?
<bqv> no that's possible, easily
<bqv> inputs.nixpkgs (or whatever it is) will just be a nixpkgs tree
<infinisil> Ah I see
<bqv> but then it'll need manual plumbing in as a module too
<bqv> but that can just be a module provided by nixus's unat.
<bqv> *flake
<bqv> sorry, switching between dvorak and qwerty rapidly
<infinisil> Hm, but like
<infinisil> Isn't then all that's needed a flake.nix that exports that function?
<infinisil> Because you can already pass the nixpkgs
<bqv> i think that's what i tried the other time, and the issue was to do with the use of lib.nixosSystem
<infinisil> Oh you couldn't use that then
<infinisil> It would just be something like `outputs.deployScript = inputs.nixus.buildDeployment { nodes.foo = { configuration = ...; nixpkgs = inputs.nixpkgs; }; }`
<infinisil> If I had to guess
<bqv> configuration could loopback to inputs.self.nixosConfigurations.${hostname}.config then, i guess
<bqv> i feel like there was a deeper issue that i'm not remembering
<bqv> ah
<bqv> i forget exactly what it was,
<bqv> [18:30:05] <infinisil> Hm so the problem is that nixus uses NixOS *as a submodule*, seen here: https://github.com/Infinisil/nixus/blob/bbf5f6062dea40fb13d3c302e0fe7ccb2f0b936d/modules/options.nix#L55-L64
<bqv> [18:30:27] <infinisil> So it never calls eval-config.nix or lib.evalModules directly for NixOS
<infinisil> That was at least the problem with using lib.nixosSystem
<infinisil> But I don't think that's even necessary now
<bqv> for flakes?
<infinisil> Yea
<bqv> howso?
<bqv> i thought it was
<infinisil> Why would it be necessary?
<infinisil> I think that's just what nixpkgs exposes so the nixos-rebuild script knows how to build a flake system
<infinisil> Lemme take a closer look
<bqv> oh, i was thinking because it would be nice to retain the way to access the configuration without going through nixus
<bqv> but i suppose if you just want the config, that works
<infinisil> Oh well that's never going to work, because Nixus isn't just NixOS
<bqv> i also do use many, many custom modules, and that's the nature of flakes, so there'd need to be a way to insert those either way
<bqv> as long as there is, nixosSystem is kinda superfluous anyway
<infinisil> bqv: Oh, do you have your config public?
<bqv> yep
<infinisil> bqv: How do you pass in the modules?
<bqv> infinisil: lib.nixosSystem :p
<infinisil> Damn, your flake.nix is huge
<bqv> trust me, i know
<bqv> i've tried to trim it down several times
<bqv> it's still smaller than nix's though
<bqv> infinisil: thoughts?
<infinisil> I was kind of hoping to see a simple example of flake usage but your big file was a bit too much xD
<bqv> hah, yeah perhaps. uhh, this probably shows it better
<drakonis> ah nixus
<infinisil> bqv: Ah yeah that's a bit simpler
<infinisil> Is there a reason to define nixosModules to be an output?
<infinisil> Instead of just using a `let in`
<bqv> none beyond convenience
<drakonis> i want to set it up
<bqv> it allows other flakes to reuse them later
<bqv> and also allows you to access it from cli easily
<bqv> well, i guess the latter makes no sense for modules, really
<bqv> but things like dwarffs define a nixosModule that people then import into their nixosConfigurations
<infinisil> Ah and nixosConfigurations is assigned because that's what nixos-rebuild looks at
<bqv> yes
<infinisil> bqv: Ahh I see
<bqv> come to think of it, i feel like i could abuse the modules thing harder to replace my whole 'profiles' thing...
<bqv> meh
<infinisil> I made pretty much my whole config be enabled with options
<infinisil> And I like it :)
<bqv> most of mine is too
<bqv> so it's just system-specific flags in hosts/
<infinisil> Yeah that's what I'm slowly going for too
<infinisil> (currently I still have some umbrella enables that turn on too many things for certain hosts)
<bqv> my problem is just that i copy my homeconfigurations for every host, and my stuff is evenly balanced between nixos and hm
<bqv> so i have my keyboard daemon on my servers too, heh
<bqv> (fixed that particular instance, but there's some others)
<drakonis> neat.
<drakonis> is there any docs written on how to set it up?
<infinisil> Btw we are talking about mostly flakes right now, not nixus
<drakonis> i see
<bqv> infinisil: so ideally, nixus would be a module, and a function that acts on a set of systems, i guess?
<drakonis> well, i'm looking into basalt with flakes
<bqv> a function that acts on a set of nixus-enabled systems
<drakonis> not sure how it interacts with flakes right now, as it's kinda badly documented right now
<infinisil> bqv: Probably the function would have Nixus' own modules included by default
<bqv> but how to pas
<bqv> s host-specific options then?
<bqv> or are we thinking of not using lib.nixosSystem
<bqv> having nixus call that itself and inject it's modules
<infinisil> Hm nope
<infinisil> Nixus has its own set of base modules that work differently than NixOS
<infinisil> I feel like we're talking past each other heh
<infinisil> But like, nixos-rebuild can't be used for nixus
<infinisil> And a Nixus specification already gives each host its own config
<infinisil> You won't be able to have `outputs.nixosConfigurations.host1 = ...`
<infinisil> Because Nixus works on all hosts together
<bqv> yeah, i'm also trying to painfully multitask :D hmm, right
<infinisil> So it's more like `outputs.nixusDeployScript = ...`
<infinisil> But I guess for repl convenience each machines config could be exposed as well
<bqv> that would be helpful
<bqv> do it the reverse way, have everything feed through nixus first, then have them linked to by nixosConfigurations
<bqv> if that's the case, that would work as-is, right?
<infinisil> Why nixosConfigurations though? It wouldn't work under nixos-rebuild
<bqv> true, doesn't have to be that name
<bqv> just, something accessible from the toplevel flake
<bqv> for flake-path usage
<infinisil> Yeah a different name
<infinisil> outputs.nixusHosts.host1 =
<infinisil> Or nixusNodes
<bqv> i'm mainly figuring that because flakes used to mandate specific attr names and choke on any others
<infinisil> Oh, that's not the case anymore then?
<bqv> i don't think so
<bqv> at least, i've seen a good few people breaking that rule
<bqv> i still pass extra stuff via .passthru out of habit
<infinisil> Cool, I now feel like nixus should work with a pretty simple flake.nix already
<bqv> yeah
<infinisil> I'm currently doing something else, but I intend to try out flakes soon after that :)
<drakonis> it is very cool and fun
<drakonis> the great hellscape of managing channels is over
<bqv> i might try it, at the behest of all the things i should be doing
<bqv> because it looks like the nodes are already exported, so nixus needs no modification to be used by a flake
<infinisil> Yeah it might be pretty simple
<bqv> infinisil: does evalModules treat a list of modules as a module?
<bqv> wait
<bqv> nevermind
<bqv> ok this'll be easier if i just try some things