!yUrHuDcxUngfTlDbiy:matrix.org

flakelight

38 Members
https://github.com/nix-community/flakelight12 Servers

Load older messages


SenderMessageTime
14 Mar 2024
@wyndon:envs.netwyndon changed their profile picture.11:02:44
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.18:44:30
15 Mar 2024
@cmacr.ae:matrix.orgcmacrae me again accelbread 👋😅 looking at using flakelight-rust for our company's mono-repo. when using flakelight-rust in a flakelight flake, where I'm importing the flakelightModule, how can I set the fileset option? 14:51:25
@cmacr.ae:matrix.orgcmacrae also, out of curiosity, maybe you can help me figure out: looks like they're using a top level Cargo.toml in the root of the repo. it uses a large members section to define all its components, of which some are cargo packages. the top level Cargo.toml doesn't have a package section defined, so I added one and called it "<thing>-meta". which in turn seems like it's then instructing to build everything (the desired outcome). do you think this is a good approach for using flakelight-rust? 14:51:28
@accelbread:matrix.orgaccelbreadSounds like its using a cargo workspace; currently flakelight-rust builds the default package if it is set (it can be set to one of the other crates or the workspace itself can have a package section) If you want to build everything, a meta package seems fine for now with current support. Would be best if we add support for building all the crates in a workspace as separate packages though; that way nothing special has to be done. 15:17:38
@accelbread:matrix.orgaccelbread

fileset is set as a normal flakelight option, like so:

{
  inputs.flakelight-rust.url = "github:accelbread/flakelight-rust";
  outputs = { flakelight-rust, ... }:
    flakelight-rust ./. {
      fileset = ./.;
    };
}

Above is easy way which gives pacakges access to all files in the repo

15:19:32
@accelbread:matrix.orgaccelbreadbest practice to have a more restricted set though so that changes to README/etc dont cause a rebuild and better build isolation15:20:03
@accelbread:matrix.orgaccelbreadDocs for what you can do with filesets is here: https://nixos.org/manual/nixpkgs/unstable/#sec-fileset 15:21:17
@accelbread:matrix.orgaccelbreadcan just build one and pass it to flakelight. The default flakelight-rust one just uses Rust and Toml files15:21:57
@cmacr.ae:matrix.orgcmacrae okay, that's great, thanks for all that info! in your example for setting fileset above, that's just using flakelight-rust. how can I do that in a flakelight ./. { call where I'm using flakelight-rust's flakelightModule.default in flakelight's imports arg? 15:22:26
@cmacr.ae:matrix.orgcmacraeSorry, does that make sense?15:22:33
@accelbread:matrix.orgaccelbread * can just build one and pass it to flakelight. The default flakelight-rust one just uses Rust, cargo.toml, and cargo.locl15:22:37
@accelbread:matrix.orgaccelbread * can just build one and pass it to flakelight. The default flakelight-rust one just uses Rust, cargo.toml, and cargo.lock files15:22:42
@cmacr.ae:matrix.orgcmacrae
  outputs = { flakelight, flakelight-rust, devenv, ... }@inputs:
    flakelight ./. {
      imports = [ flakelight-rust.flakelightModules.default ];
      systems = inputs.nixpkgs.lib.systems.flakeExposed;

15:22:47
@cmacr.ae:matrix.orgcmacraelike this :)15:22:51
@accelbread:matrix.orgaccelbread

same way:

outputs = { flakelight, flakelight-rust, devenv, ... }@inputs:
    flakelight ./. {
      imports = [ flakelight-rust.flakelightModules.default ];
      systems = inputs.nixpkgs.lib.systems.flakeExposed;
      fileset = ./.;
15:23:32
@cmacr.ae:matrix.orgcmacraeoh, I tried that but it didn't seem to do what I wanted 😅 I must be doing something wrong15:23:59
@accelbread:matrix.orgaccelbreadcalling flakelight-rust is just a shortcut for calling flakelight and adding flakelight-rust.flakelightModules.default15:24:07
@accelbread:matrix.orgaccelbreadHmm, maybe the fileset is not matching your files?15:24:35
@cmacr.ae:matrix.orgcmacrae yeah, I tried ./. to do everything as a test, but it didn't look like the whole tree was in the build env 15:25:52
@cmacr.ae:matrix.orgcmacraeI'll mess around and see what I can get working. It was very likely user error 🤡15:26:13
@accelbread:matrix.orgaccelbreadHmm, odd, might be something with workspaces too; I havn't actually used workspaces for actual projects, that was contributed by others so might have to mess around with it more15:27:10
@cmacr.ae:matrix.orgcmacrae seems they do some cargo overrides in some .cargo* files in the tree in places where they're calling out to some shell scripts, hence why I need to expand the filter 15:27:41
@accelbread:matrix.orgaccelbreaddo you know which subset of files is being picked up? ah15:27:50
@cmacr.ae:matrix.orgcmacraeyeah, I mean I legit have no idea what I'm doing haha, i've never really used rust properly15:28:08
@accelbread:matrix.orgaccelbreadI'm wondering is it might be due to how crane works 15:28:34
@cmacr.ae:matrix.orgcmacrae
In reply to @accelbread:matrix.org
do you know which subset of files is being picked up?
ah
all the rust related stuff! so that's good, the default filter is working
15:28:35
@accelbread:matrix.orgaccelbreadAh15:28:41
@accelbread:matrix.orgaccelbreadSo probably not a crane issue15:28:55
@cmacr.ae:matrix.orgcmacraenope :) let me try and get a different filter working and report back15:29:13

Show newer messages


Back to Room ListRoom Version: 10