!yUrHuDcxUngfTlDbiy:matrix.org

flakelight

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

Load older messages


SenderMessageTime
11 Jun 2025
@accelbread:matrix.orgaccelbread this adds a hosts option to flakelight. The loading from ./nix/hosts will work automatically. 17:25:54
@accelbread:matrix.orgaccelbread * this adds a hosts option to flakelight. The loading from ./nix/hosts/ will work automatically. 17:26:03
@accelbread:matrix.orgaccelbreadTheres some docs on using the Nix module system here: https://nixos.org/manual/nixos/stable/#sec-writing-modules Also looks like some docs here: https://nix.dev/tutorials/module-system/index.html17:29:15
@accelbread:matrix.orgaccelbreadFeel free to ask more questions, and I can help with more specifics17:31:13
@hezhenxing:matrix.orgZhenxing HeThank you for the quick response, it works like a charm! I had thought I might need to use the extend or extraModules of mkFlake, what are those for and how to use them?23:39:38
12 Jun 2025
@accelbread:matrix.orgaccelbreadThose are intended for making flakes providing project integration with flakelight, i.e. stuff like https://github.com/accelbread/flakelight-rust or https://github.com/accelbread/flakelight-zig01:46:15
@accelbread:matrix.orgaccelbreadIts used here: https://github.com/nix-community/flakelight/blob/master/nix/flakelightModules/flakelightModule.nix01:46:36
@accelbread:matrix.orgaccelbread Those other repos use this module so that instead of calling flakelight ./. { imports = [ flakelight-zig.flakelightModules.default ], ... } in the consuming flakes, you can instead call flakelight-zig ./. { ... } 01:48:21
@accelbread:matrix.orgaccelbreadextend takes mkFlake and returns a version that automatically includes some modules01:49:13
@accelbread:matrix.orgaccelbread* extend takes mkFlake and returns a mkFlake function that automatically includes some modules01:49:32
@accelbread:matrix.orgaccelbreadextraModules is part of implementation of extend01:50:46
@accelbread:matrix.orgaccelbreadSo not really something consumers of flakelight really need to touch01:51:46
@accelbread:matrix.orgaccelbreadI should probably add to the comment where those are defined01:52:23
@hezhenxing:matrix.orgZhenxing HeThat's a lot of information, thanks a lot, it looks very cool, I actually have tried writing github:hezhenxing/flakelight-haskell, but I do not fully understand it when I wrote it. Just copy the others.01:57:15
@accelbread:matrix.orgaccelbreadoh cool! Yeah, copying from others should be fine for that. If you get the haskell project building =working, feel free to add it to the flakelight readme as an available module01:58:59
@accelbread:matrix.orgaccelbread* oh cool! Yeah, copying from others should be fine for that. If you get the haskell project building working, feel free to add it to the flakelight readme as an available module01:59:07
@hezhenxing:matrix.orgZhenxing HeOK, I'd be very glad to be able to do some contribution02:01:51
@hezhenxing:matrix.orgZhenxing HeI am also using flakelight for defining nixos configurations, I created a flake with some pre-configured nixosModules or homeModules for hyprland and xmonad, etc. These modules may referencing other modules by using inputs.self.nixosModules or inputs.self.homeModules, this works fine when defining new hosts within the flake. But when I want to use this flake as inputs in another flake, there will be problems with the inputs.self references. and also inputs.home-manager and other inputs used in the previous flake will also be missing. 02:04:03
@accelbread:matrix.orgaccelbreadyeah, for that you'd need to grab the other module from outside the module definition. Are these in your nix.nixosModules directory?02:07:57
@accelbread:matrix.orgaccelbread* yeah, for that you'd need to grab the other modules from outside the module definition. Are these in your nix.nixosModules directory?02:08:07
@accelbread:matrix.orgaccelbreadyou could also use relative paths for the modules02:08:19
@hezhenxing:matrix.orgZhenxing He Yes, they are in the nix/nixosModules directory of the first flake, but I want to use then in the second flake02:12:10
@accelbread:matrix.orgaccelbread ahh, then instead of imports = [ inputs.self.nixosModules.other-module ], imports = [ ./other-module.nix ] probably works. 02:13:44
@accelbread:matrix.orgaccelbread * ahh, then instead of imports = [ inputs.self.nixosModules.other-module ], imports = [ ./other-module.nix ] should work. 02:14:38
@hezhenxing:matrix.orgZhenxing HeJust tried, relative path seems to work, thanks! How to solve the reference problem with extra inputs used in the first flake?02:17:24
@hezhenxing:matrix.orgZhenxing Hefor example, I added home-manager inputs in the first flake and used in some of the modules, but they will cause error when used in the second flake, which only added my first flake as inputs.02:18:27
@hezhenxing:matrix.orgZhenxing HeHmm, found a solution, use inherit (myfirstflake) inputs; instead of inherit inputs; seems solve the problem, but I don't know if this is the right solution.02:21:29
@accelbread:matrix.orgaccelbreadfor that you want the first flake to export a flakelightModule. that modules can add its inputs as default values for inputs02:26:45
@accelbread:matrix.orgaccelbreadhttps://github.com/accelbread/flakelight-rust/blob/2e3d11f991c235eb7d499da301245bff1c323610/flake.nix#L1802:27:45
@accelbread:matrix.orgaccelbreadlike this02:27:53

Show newer messages


Back to Room ListRoom Version: 10