Would it be possible to split out all the generic modules into a separate repository and import them into a flake?
I have currently 4 systems in my flake which starts to be a bit much.
I imaging a system which as a roles/features repo which I then can define as an input and in the configuration I could do something like this:
{
description = "Nixos configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
roles.url = "github:Nebucatnetzer/nix-roles";
};
outputs =
inputs @ { self, nixpkgs, roles }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
};
};
in
{
nixosConfigurations.nixos-vm = nixpkgs.lib.nixosSystem {
inherit system pkgs roles;
modules = [
roles.cli-tools;
roles.vim;
roles.git;
];
};
};
}
Is this possible?
Do I have to do something special with the existing modules or could the be used 1:1?
What about the roles repo?