!9IQChSjwSHXPPWTa:lix.systems

Lix

735 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms223 Servers

Load older messages


SenderMessageTime
18 Dec 2024
@guiniol:matrix.orgguiniolnot encouraging for the prebuilt version00:04:44
@guiniol:matrix.orgguiniol
In reply to @irenes:matrix.org
if you're working in a flake, one trick I find really useful for debugging is that if I have a nix expression that returns the derivation I want to hack on, I export that derivation from outputs.packages.x86_64-linux.whatever and then I can just do nix build .#whatever
What do you mean export? (I'm brand new to this) You make it it's own flake or something?
00:05:30
@irenes:matrix.orgIrenesoh, welp00:06:11
@irenes:matrix.orgIrenesoh, no, so00:06:15
@irenes:matrix.orgIrenes your flake.nix file is really just a big list of uh........ dependencies, and then.... different kinds of things that it exports 00:06:36
@irenes:matrix.orgIrenessome of the things might be machine configurations, others might be modules that can be included in configs, others might be packages that can be build00:06:51
@irenes:matrix.orgIrenes*built00:06:53
@irenes:matrix.orgIrenesthere's like a dozen different things00:06:58
@guiniol:matrix.orgguiniolsure, I'm following you00:07:14
@irenes:matrix.orgIrenesthis only applies if you're using flakes, if you're not it's not worth setting up flakes over00:07:17
@irenes:matrix.orgIrenes so half the flake.nix is this big output block and there's a few different things that can be under it, and one of the things is packages 00:07:43
@irenes:matrix.orgIreneswhich is just a set of derivations you can build00:08:15
@irenes:matrix.orgIrenes the same way that if you do nix build nixpkgs#hello it builds the "hello" package from upstream nixpkgs 00:08:29
@irenes:matrix.orgIrenes if you do nix build .#hello it looks in the current directory (or the closest enclosing one that has a flake.nix file in it, I think) and looks for a "hello" package defined there 00:08:58
@guiniol:matrix.orgguiniol(I am using flakes. It seemed a good way to modularise my build, but I may be compltely wrong)00:09:07
@irenes:matrix.orgIrenes(I think it is, yeah. the concept of flakes needs some tweaking and I'm excited for the lix project to eventually get to where we're in a good position to experiment with it, but the basic idea is a reasonable one)00:09:39
@guiniol:matrix.orgguiniol
In reply to @irenes:matrix.org
if you do nix build .#hello it looks in the current directory (or the closest enclosing one that has a flake.nix file in it, I think) and looks for a "hello" package defined there
Yes. That's what I do to have one config per host in a single flake
00:09:42
@irenes:matrix.orgIrenes(that is my personal view and not the view of the project)00:09:51
@guiniol:matrix.orgguiniol(for now, I'm just trying to be along for the ride :D )00:10:16
@irenes:matrix.orgIrenes right, yes. packages and hosts are in a slightly different namespace, nix build .#foo checks outputs.packages.${system}.foo while nixos-rebuild --flake .#foo checks outputs.nixosConfigurations.foo 00:10:47
@irenes:matrix.orgIrenes it's just a shorthand, you can also write out the full attribute path after the # 00:11:02
@irenes:matrix.orgIrenes(thanks for being on this ride with us! it's so great how much energy the community has)00:11:29
@guiniol:matrix.orgguiniolack. Makes sense since nixos-rebuild is rebuilding the whole system00:11:30
@irenes:matrix.orgIrenesexactly00:11:36
@irenes:matrix.orgIrenesI do wish the docs said this more prominently. I should send a patch :)00:11:50
@irenes:matrix.orgIrenesso even if you are mostly using a repo to define your machines, you can still have it define some packages too00:12:43
@irenes:matrix.orgIrenesand rapid iteration on stuff you use in your infrastructure is a reason you might want to00:12:55
@guiniol:matrix.orgguiniolyes, I tried defining one for caddy with modules00:13:12
@irenes:matrix.orgIrenesthe only reason I'm aware of you might not want to is that if the flake.nix gets really long and unwieldy it can be hard to read00:13:18
@irenes:matrix.orgIrenesI see I see00:13:24

Show newer messages


Back to Room ListRoom Version: 10