Hi!
I recently discovered how to manage configuration for multiple devices with nix flakes and I came up with the idea of splitting my configuration.nix into different files. I wanted them to use inherit to use my flake packages but I get The option 'inputs' does not exist error. How do we import use flake inputs across multiple files? Isn’t inherit keyword enough for that?
- flake.nix*
{
description = "Waves in a room";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
};
outputs = { self, nixpkgs, ...}@inputs:{
nixosConfigurations.laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {inherit inputs;};
modules = [ ./laptop/configuration.nix ];
};
nixosConfigurations."desktop" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [ ./wsl/configuration.nix ];
};
};
}
*./laptop/configuration.nix *
{ inputs, ... }:
{
imports =
[
./hardware-configuration.nix
../users/wavesinaroom.nix {inherit inputs;}
../common/shared.nix {inherit inputs;}
];
# My configuration
}
I’ve got really good support from the community so far and I’m working hard to learn more about it cause I love it. If you post an answer, can you please recommend me the topic I should read/review so I can understand what’s behind your answer please? Troubleshooting is rewarding indeed but getting why this work is extremely valuable for me ![]()