flakelight | 45 Members | |
| https://github.com/nix-community/flakelight | 13 Servers |
| Sender | Message | Time |
|---|---|---|
| 6 Apr 2024 | ||
Something I'm struggling a bit with now: I would like to use nixDir and have a NixOS configuration in each file, but I have some modules in my inputs I would like to add to each NixOS configuration. Currently, I add those modules by mapping(where nixosModules is a lit of the extra nixos modules), but I don't think this can be done with nixDir. Can this be done without just adding those modules to each config individually? | 13:20:56 | |
| Hey, thanks for reaching out! I appreciate hearing back For, withOverlays and NixOS, you'd either have to use the short form (where flakelight calls nixosSystem for you) or pass propagationModule Theres a line here (https://github.com/nix-community/flakelight/blob/a55ef9097613d99f293a532356d67b8ba8aff37f/API_GUIDE.md?plain=1#L959); I'll see about making it clearer. I'll add an example for it too. For packages from other flakes' packages outputs, I'll add some docs/examples as well | 22:03:35 | |
| * Hey, thanks for reaching out! I appreciate hearing back For, withOverlays and NixOS, you'd either have to use the short form (where flakelight calls nixosSystem for you) or pass propagationModule Theres a line here (https://github.com/nix-community/flakelight/blob/a55ef9097613d99f293a532356d67b8ba8aff37f/API_GUIDE.md?plain=1#L959); I'll see about making it clearer. I'll add an example for it too. For packages from other flakes' packages outputs, I'll add some docs/examples as well | 22:03:53 | |
For sharing module configuration between nixos systems, you could make nixos/default.nix in your nixDir and have that add the config to each system | 22:05:59 | |
| Let me get an example real quick | 22:06:06 | |
| * Hey, thanks for reaching out! I appreciate hearing back For, withOverlays and NixOS/home-manager, you'd either have to use the short form (where flakelight calls nixosSystem/homeManagerConfiguration for you) or pass propagationModule to the function yourself Theres a line here (https://github.com/nix-community/flakelight/blob/a55ef9097613d99f293a532356d67b8ba8aff37f/API_GUIDE.md?plain=1#L959); I'll see about making it clearer. I'll add an example for it too. For packages from other flakes' packages outputs, I'll add some docs/examples as well | 22:08:31 | |
| Assuming
and that will add some-flake.nixosModules.default to all you nixos systems, assuming you define your nixos systems something like follows:
| 22:21:01 | |
| * Assuming
and that will add some-flake.nixosModules.default to all you nixos systems, assuming you define your nixos systems something like follows:
| 22:21:12 | |
Or as another option, you can add inputs.self.nixosModules.common to each of your system, and import your common modules thereI do that for my config here: https://github.com/accelbread/config-flake/blob/ae52725fd660af550d66750707d649082786e332/nix/nixos/solace/configuration.nix#L5 https://github.com/accelbread/config-flake/blob/ae52725fd660af550d66750707d649082786e332/nix/nixosModules/common.nix#L7 | 22:24:30 | |
| IMO the latter is cleaner with importing common config, but if you want to not have common lines, the former works too. Whichever you like the best | 22:27:49 | |
| lunik1: LMK if that helps; I might be able to give better advice if you have the code available somewhere as well | 22:36:41 | |
| * Assuming
and that will add some-flake.nixosModules.default to all you nixos systems, assuming you define your nixos systems something like follows:
| 22:42:27 | |
* Or as another option, you can add inputs.self.nixosModules.common to each of your system, and import your common modules thereI do that for my config here: https://github.com/accelbread/config-flake/blob/ae52725fd660af550d66750707d649082786e332/nix/nixosModules/common.nix#L7 https://github.com/accelbread/config-flake/blob/ae52725fd660af550d66750707d649082786e332/nix/nixos/solace/configuration.nix#L5 | 22:43:47 | |
| My code is here https://gitlab.com/lunik1/nix-config/-/tree/flakelight | 23:29:28 | |
In reply to@accelbread:matrix.orgI could have sworn when I did this that the nixos config immediately complained about nonfree packages, indicating the config had not been carried over. I will take another look. | 23:31:04 | |
Those options for the common config look good. Is flakelight.importDir documented anywhere? I don't remember seeing it. | 23:32:07 | |
| 7 Apr 2024 | ||
In reply to@lunik1:lunik.oneHere's a mwe of the issue This system configuration fails to build with | 00:02:23 | |
| Yeah importDir is not documented yet; I need to add a section of lib functions. It does the same thing autoimport with nixDir would do | 00:03:48 | |